Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/23/03 18:38
Read: times


 
#53192 - RE: Timer2 in Capture Mode
Responding to: ???'s previous message
Hi,
now i suppose to fine value in RCAP2L e RCAP2H but nothing
Could you explain your but nothing?
Looking on the code you show, I think that you read random values because there is not sync between input sequence and start of capture mode. You should do:
- either modify main loop something like:
while(!EXF2);
TR2=0;
TL2=0;
TH2=0;
EXF2=0;
TR2=1; 
while(!EXF2);
// now read correct value of timer2 ticks between two pulses

- or use timer2 as counter of input clocks on T2 pin. In this case you may clear the counter, then run it for 1 second, stop it and read your sequence value. (Running time may be other with coresponded calculation).

Good days!


List of 3 messages in thread
TopicAuthorDate
Timer2 in Capture Mode            01/01/70 00:00      
   RE: Timer2 in Capture Mode            01/01/70 00:00      
   RE: Timer2 in Capture Mode            01/01/70 00:00      

Back to Subject List