You could try putting the code you want to be called the fastest, closest to zero vector.
Labels called with a Goto command causes the program counter to start looking for your label from zero,
so the closest it is to zero, the faster it is found, and run.
So without looking at anything else about your code:
Code:// the following is not run time code, so who cares… @ device pic16F819, wdt_off, hs_osc, pwrt_on, mclr_off, lvp_off, protect_on DEFINE OSC 16 ' We're running at 16 Mhz led var PORTB.1 i var byte // jump to config vector Goto Config Main: high led CCP1CON = %00001100 ' Normal PWM mode T2CON.2 = 1 ' Timebase ON PAUSE 15 low led T2CON.2 = 0 ' Timebase OFF CCP1CON = %00000000 ' Disable PWM to regain control of PortA.2 PAUSE 5 Goto Main Config: ADCON1=%01001110 ' Digital only for all pins CCP1CON = %00001100 ' Normal PWM PR2 = 3 CCPR1L =0 CCP1CON.5 = 1 CCP1CON.4 =1 For i = 0 to 9 Toggle LED Pause 500 NEXT // run main program Goto Main




Bookmarks