| ??? 08/19/02 21:10 Read: times |
#27527 - IE0 and TF0 |
Hello all, I've run into another weird problem that doesn't make sense.
;INT0--- keyboard interrupt ;TF0----timer0 interrupt main: MOV A, NBYTES ;if nbytes=1, key was pressed JZ MYLOOP MOV IE, #00H MOV A, KEYBUFF ;get keycode MOV NBYTES, #00H MOV R1, RX_POSITION;save it into buffer MOV @R1, A INC R1 MOV RX_POSITION,R1 MOV IE, #81H ;i thought timer0 has a lower priority than INT0, when the time between two keys pressed is much shorter than timer period.. I think the program will wait at here, but it didn't, what's the problem? In my ISR, i reset the TH0 and TL0,but still not work.. MOV TH0,#11 ;50ms timer MOV TL0,#220 MOV TMOD,#01 SETB TR0 JNB TF0,$ ;I thought program will wait here until timer overflow. I reset the TH0 and TL0 in my ISR, is it real help? MOV R3, #00 MOV R2, RX_POSITION MOV R0, #RX_BUFFER MOV R1, #TX_BUFFER MYLOOP1: MOV A, @R0 MOV @R1, A INC R1 INC R0 DEC R2 INC R3 CJNE R2, #RX_BUFFER, MYLOOP1 MYLOOP: RET Regards Frank |
| Topic | Author | Date |
| IE0 and TF0 | 01/01/70 00:00 | |
| RE: IE0 and TF0 | 01/01/70 00:00 | |
| RE: IE0 and TF0 | 01/01/70 00:00 | |
| RE: IE0 and TF0 | 01/01/70 00:00 | |
| RE: IE0 and TF0 | 01/01/70 00:00 | |
| RE: Alan | 01/01/70 00:00 | |
| RE: Alan | 01/01/70 00:00 | |
| Hope this works for you. | 01/01/70 00:00 | |
| RE: Hope this works for you. | 01/01/70 00:00 | |
| RE: IE0 and TF0 | 01/01/70 00:00 | |
The problem is solved | 01/01/70 00:00 |



