| ??? 03/13/03 13:51 Read: times |
#41424 - RE: Split timer mode (mode3) Responding to: ???'s previous message |
Your pulse counting rate is very low. So even
with one counter also you can implement multiple counter of low frequency (upto 500-1000 hz ie 1000 pulse/sec , depending upon crystal u are using). These counter you can call software counters. I have used this technique succ in past. Here how it works. (1) Use any one timer to interrupt process at regular interval say after every say 1 ms (2) In timer ISR do bank switching( and timer value loading if you r not using reload function). (3) Pulses to be counted can be applied on any free i/o pins. (4) During ISR read these i/o pins status and compare it with i/o pins stattus during last IRS.it may work like this // counter 1 pulse are on p1.1 if(c_pin_last .ne. p1.1) count1 = count+1 endif c_pin_last = p1.1 // this is just a psedo code (5) This way during ISR it can do software counting for 3-4 counter easily.(it will take aroun (20 % proc time) (6) using appro flag counter values can be transferred any variable. Anil Gupta |



