You need to log in to create posts and topics.

Falling edge capture mode on the ATMEGA328

'm having trouble getting the capture mode to work on the falling edge. Even setting the ICSE1 bit to 0, it only works on the rising edge.

Hi.

Input Capture Unit in Atmega328 is working for me at both edges.
Can you share circuit and firmware to reproduce the issue?

Themoteo has reacted to this post.
Themoteo
I observe the capture of TCNT1 to ICR1 in MCU MONITOR and, even changing the value of the ICSE1 bit, the capture only happens on the rising edge.
Uploaded files:

Thank you for the files.

Your code works for me in rising or falling edge.
But I have to use a pullup resistor on PB0:

sbi PORTB,0             ; pulup do pino PB0

 

Uploaded files:
Themoteo has reacted to this post.
Themoteo