Hi all,
I have a low RPM motor which is connected to a sensor which outputs a pulse with every rotation. Now I want to connect this sensor with the 8051 counter. I will also be using a momentary switch which when pressed will short to ground.
Now I want the counter to only operate when the switch is pressed (ex: if the switch is pressed for 5seconds, the counter will only count the rotations for that period). When the switch is released I need to read the counts to determine the rotations at that period and reset the counter for the next button press.
A timer of 2 seconds will also be enables with the switch release.
I other words, I need a counter and a timer. I was planning to use Timer 0 in Mode 1 as the counter and Timer 1 in mode 0 for the 2 seconds delay.
Which is the best mode to use for this combination?
Is is possible to achieve a 2seconds delay in Mode 0 using the prescaler?
Any help would be highly appreciated.
I have a low RPM motor which is connected to a sensor which outputs a pulse with every rotation. Now I want to connect this sensor with the 8051 counter. I will also be using a momentary switch which when pressed will short to ground.
Now I want the counter to only operate when the switch is pressed (ex: if the switch is pressed for 5seconds, the counter will only count the rotations for that period). When the switch is released I need to read the counts to determine the rotations at that period and reset the counter for the next button press.
A timer of 2 seconds will also be enables with the switch release.
I other words, I need a counter and a timer. I was planning to use Timer 0 in Mode 1 as the counter and Timer 1 in mode 0 for the 2 seconds delay.
Which is the best mode to use for this combination?
Is is possible to achieve a 2seconds delay in Mode 0 using the prescaler?
Any help would be highly appreciated.
Last edited: