Dear board, I have an issue with the input capture functioniality of the RX62T MTU3 timer unit. I have configured the MTIOC6A Pin for Input Capture on rising edge. But the CPU is also generating sometimes ISRs on the falling edge. void InitCounterInput() { MSTP(MTU0) = 0;//Enable Power MTU.TSTRB.BIT.CST6 = 0; PORTA.ICR.BYTE |= 0x02; //Enable input buffer MTU6.TIORH.BYTE = 0x08; MTU6.TIER.BYTE = 0x11; //MTU6 TimerA-TimerD ICU.IPR[0x5C].BYTE = 10; // Set priority of Interrupt ICU.IER[0x11].BIT.IEN6 = 1; // TGIA6 MTU.TSTRB.BIT.CST6 = 1; } We use also the overflow ISR for frequency measurement but I skipped this part. So if I count now the Pin States I also get Low Pin States, altough the signal is very Slow ~25 Hz (50/50 duty cycle). The only thing is, we have a capacitor 0,1uF on the pin, this results in a derating curve on the neg. trans. If I remove the capacitor only high Level interrupts occur. void Excep_MTU36_TGIA6(void){ static short counter[2] = {0,0}; if(!PORTA.PORT.BIT.B1) counter[0]++; else counter[1]++; } Attached you can see the signal on the CPU Pin The Signal is with 300Hz but we have the same behaviour on 25Hz and 4,4V (VCC=5V). Nothing is blocking the isr so long (25Hz) that the ISR cannot run immediatley after a slope is detected, as you can also see that it is running fine without capacitor.
↧