??? 04/21/05 18:07 Read: times |
#92059 - good idea Responding to: ???'s previous message |
This maybe a stupid idea from me, but if you try using >= instead of ==. I'm thinking maybe your program is not checking the if statements at the exact time that they are true. Just a quick thought between bites of my lunch.
That wasn't a stupid idea at all - so I implemented it, to no avail :/ Meanwhile, timer-init is back to this setup: EA = 0; /* disable interrupts */ TMOD = (TMOD & 0xF0) | 0x01; /* Set T/C0 Mode */ ET0 = 1; /* Enable Timer 0 Interrupts */ TR0 = 1; /* Start Timer 0 Running */ EA = 1; /* enable all interrupts */ And I added a pin-toggle to the interrupt-routine as well one as to the main-routine, just before the if-statements. The interrupt is triggered approx. 25 times per second, the main-routine quite a lot more often (my poor old scope was almost at the end of its capabilities ...). /Thomas |