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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/10/04 05:10
Read: times


 
#70097 - RE: Can we expand the timers in 89c52 uC
Responding to: ???'s previous message
I normally have one of the 89c52 timers set up for a 10mS tick (you choose whatever value is suitable for you) and have the interrupt routine decrement some software timers. In most instances you don't need timers with a very fast time (<10mS) so this solution should serve your purposes.

There a many other ways of performing the same task, but this should give you a hint. Note the following are 8 bit timers that count down - therefore if the value equals 0 then the timer has finished. So this example gives you 2 timers with a resolution of 10mS and a max time of 2550mS (2.55S). If you need some timers with a resolution of same 100mS, decrement the timers every 10 ticks etc.

eg:

timer1 ds 1
timer2 ds 1

timer0_int:
push psw
push a
;
; reload timer with 10mS
;


mov a,timer1
jz t0_1
dec a
mov timer1,a
t0_1
mov a,timer2
jz t0_2
dec a
mov timer2,a
t0_2
pop a
pop psw
reti


remember a PLC is just a microcontroller with a program to interpret the ladder logic instructions. I know that Allen Bradley use a dallas ds80c320 cpu in their smaller plcs.

List of 7 messages in thread
TopicAuthorDate
Can we expand the timers in 89c52 uC            01/01/70 00:00      
   RE: Can we expand the timers in 89c52 uC            01/01/70 00:00      
      RE: Can we expand the timers in 89c52 uC            01/01/70 00:00      
      48 Timers?!            01/01/70 00:00      
         RE: 48 Timers?!            01/01/70 00:00      
   RE: Can we expand the timers in 89c52 uC            01/01/70 00:00      
   Same old wine in a new bottle            01/01/70 00:00      

Back to Subject List