With a prescaler of 64 at 20MHz, Timer0 will overflow in about 3.2mS. With your loop from 0 to 200, you're going to have to send a LOT of serial data before it can make it through your loop and toggle PORTB.2 off.
Every 3.2mS it jumps to your SERIN interrupt routine. It's going to sit there until it receives a byte of data. So it's going to take a good while before making it through your first loop.
And, you really don't know what the count in Timer0 is when you exit your interrupt routine, so you might want to clear Timer0 before exiting just in case.
You can check to make sure your Timer0 interrupt is happening by commenting out the SERIN line, and toggling another LED in your interrupt routine.
Something like this;
Code:DISABLE INTERUPTROUTINE: 'serin PortB.3, T2400, RX 'Receive menu 'Cnt = Rx TOGGLE PORTB.3 TMR0=0 ;clear Timer0 before exit INTCON.2 = 0 ;clears the interrupt flag. RESUME ;resume the main program ENABLE ;DISABLE and ENABLE must bracket the int routine




Bookmarks