| ??? 11/14/02 11:05 Read: times |
#32452 - RE: timer0,timer1 |
If you set a timer to Mode 1, it operates as a 16-bit counter which is incremented every 12 clock-cycles; for a 12 Mc clock this means once every 1 us.
An overflow of the timer occurs when it wraps back from 0xffff to 0x0000; this may trigger the timer interrupt (if set). So, you need to count from 0xffd9 to 0x0000 (0xffff - 0x27 + 1), so you set your pre-load THx to 0xff and TLx to 0xd9 and off you go. As for the PWM: if you want to use the built-in PWM, you'll have to live with either f(osc)/12 or f(osc)/4 for your PWM frequency, which is approx. 833 kc or 2.5 Mc |
| Topic | Author | Date |
| timer0,timer1 | 01/01/70 00:00 | |
| RE: timer0,timer1 | 01/01/70 00:00 | |
RE: timer0,timer1 | 01/01/70 00:00 |



