??? 09/05/08 07:48 Read: times |
#157969 - Auto reload |
I want to reload the TH0,TL0 registers with different values for different time delays. I am defining timer 0 in mode 1 (16-bit) and timer 0 overflow interrupt .
ORG 0000H LJMP MAIN ORG 000BH ;INTERRUPT ROUTINE FOR TIMER0 CALL TOV ORG 0030H MAIN: MOV R0,#00h MOV R1,#00h MOV IE,#10000010B ;ENABLE TIMER 0 INTERRUPT MOV IP,#00000010B ;TIMER 0 HIGEST PRIORITY MOV TMOD,#01H ;TIMER 0 IN MODE 1 16-BIT TIMER MOV TL0,#R0 MOV TH0,#R1 Update: ;routine to change the value of r0 and r1 ajmp update TOV: CLR TRO ;???????? MOV TL0,R0 MOV TH0,R1 SETB TR0 ;???????? RETI END Is it necessary to use the instructions clr TR0 and setb TR0 to resart the timer with new timer values. |
Topic | Author | Date |
Auto reload | 01/01/70 00:00 | |
See any potential problems? | 01/01/70 00:00 | |
Enable interrupts last | 01/01/70 00:00 | |
RE: | 01/01/70 00:00 | |
this may, some day, bite you in your lagest muscle | 01/01/70 00:00 | |
also may, some day, bite you in your lagest muscle | 01/01/70 00:00 | |
CALL or JMP | 01/01/70 00:00 | |
good catch | 01/01/70 00:00 | |
RE: | 01/01/70 00:00 | |
find out![]() | 01/01/70 00:00 | |
Remember the update | 01/01/70 00:00 | |
So, what the final answer ? | 01/01/70 00:00 | |
diplomatic answer - OK and the direct too | 01/01/70 00:00 | |
care with multi-read/multi-write of running timers | 01/01/70 00:00 | |
Re:problem with updating a 16-bit counter | 01/01/70 00:00 | |
If you knew that.................. | 01/01/70 00:00 | |
RE:If you knew that.................. | 01/01/70 00:00 |