One thing i don't understand here... It's working @4MHz. I'm not really much familiar with timer but...
Original code:- 1. Prescaler 1:8
2. interrupt on Timer overflow
3. Must interrupt each and every : (1/(4MHZ / 4))*8*256 = 2 mSec
BUT i read 3 pause 7 in your interrupt routine... longer than interrupt itself... this is why i don't understand why it was working without at least disable interrupts.
DISABLE or INTCON=0 at the begining of your interrupt routine may do something.
By the way, let's say you have 20Mhz:
- 1. prescaler 1:256
2. Interrupt on Timer overflow
3. Must interrupt each and every : (1/(20Mhz/4))*256*256 =13 mSec.
reduce your PAUSE to... let's say 3 or 4 and post what's happen now.
Last edited by mister_e; - 22nd December 2004 at 23:40.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks