| ??? 07/21/99 12:35 Read: times |
#568 - RE: Emulating PIC uP Change level INT. |
Hi Fran,
The /INT0 pin act also as gate for T0 (/INT1 for T1). If the Gate bit on TMOD is set, CT0 can only count during high on /INT0. Also you must set TL0 and TH0 to 0FFh. Then every time if /INT0 goes high T0 roll over and generate a T0 interrupt on the next cycle. The T0 interrupt handler should disable itself (clr ET0) and enable /INT0 (setb EX0). Then the /INT0 interrupt can serve the low state and reenable T0 (also must set TL0 and Th0 to 0FFh again). If you set T0 to the 8-bit auto reload mode you must only after reset load TL0 and TH0 with 0FFh, not during every /INT0 interrupt. If you need T1 for the UART and also a timer interrupt, you can split T0 in 2 timers: TL0 to serve high on /INT0 and TH0 as 8 bit timer. Then TH0 use interrupt T1, but this is no problem, since T1 need its interrupt no longer, if acting as baud rate genrator for the UART. Regards, Peter |
| Topic | Author | Date |
| Emulating PIC uP Change level INT. | 01/01/70 00:00 | |
RE: Emulating PIC uP Change level INT. | 01/01/70 00:00 |



