We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I am using ADUC842.
Continuous pulse is being fed at port P2.6
I need to calculate rising edges of the pulse for 10ms time interval..
how should i proceed?
pls help.
Regards Mayuri
counter in 8051 takes high to low transition...
...
i just want to count high to low transitions....
So, the timer counts the falling edge, and you want to count the falling edge. But you do not think the timer is the way to go?
Whatever. You can use the INTx pin to count. Another solution would be pulling:
pulse_counter += ((port_prev ^ port_now) & port_prev)?1:0;
If any of the pins on the port has a falling edge, pulse_counter is incremented. You can mask it to just count certain pins (or a single pin).
pulse_counter += ((port_prev ^ port_now) & port_now)?1:0;
counts the rising edge, in case you want.