mcs51mc said:When is an interrupt generated?
Once you know that, what is the time between 2 interrupts with the above code?
Assuming the interrupt is generated at 1sec per beat, the time between 2 interrupts will be 2secs.
Yea, i understand the meaning of:
Code:
Time_1 equ 65535[B]-10000[/B] ;10ms interrupt assuming 12MHz xtal
Time_1 equ 65535[B]-2000[/B] ;2ms interrupt assuming 12MHz xtal
ok... i'll try that on Excel...
Hmm... I thought of another easier method. That is to set the timer to run for 5 secs and count the number of pulses during that 5 secs than using the answer to multiply by 12 to get BPM.
Last edited: