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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/22/04 11:33
Read: times


 
#67187 - RE: pulse counter
Responding to: ???'s previous message
hi,
I have no time to look at the all links you provided now, but the idea is:

- use T0 as input for pulses;
- configure timer 0 as counter 0 with C/T0# bit set;
- enable counter 0 interrupt if it is possible that there will be more than 65535 pulses during control time. This ISR should increase an additional byte as extra MSB counter;
- configure timer 1 to keep track of time;
- load initial values to TL0/TH0 and TL1/TH1;
- run timer 1 and at same time enable counter 0 (both bits TR0 and TR1 are located at same register TCON so no problems with sync);
- wait till timer 1 interrupt and stop counter 0 in its ISR;
- read value of TH0 and TL0 (and extra byte if it presents);
- reconfigure timer 1 as baud rate generator for UART;
- send number of counted pulses to PC.

Regards,
Oleg

List of 15 messages in thread
TopicAuthorDate
pulse counter            01/01/70 00:00      
   RE: pulse counter            01/01/70 00:00      
      RE: pulse counter            01/01/70 00:00      
         RE: pulse counter            01/01/70 00:00      
         RE: pulse counter            01/01/70 00:00      
            RE: pulse counter            01/01/70 00:00      
   RE: pulse counter            01/01/70 00:00      
   RE: pulse counter            01/01/70 00:00      
      RE: pulse counter            01/01/70 00:00      
         RE: pulse counter            01/01/70 00:00      
   RE: pulse counter            01/01/70 00:00      
      RE: pulse counter            01/01/70 00:00      
   RE: pulse counter            01/01/70 00:00      
   RE: pulse counter            01/01/70 00:00      
      RE: pulse counter            01/01/70 00:00      

Back to Subject List