Worked well until I pulled up to the checkpoint doing it. Thought they were going to take me to secondary...How'd that work out for you?
Ken,
Here is code using DT's INTs giving an interrupt at 200 Hz.
All I did was tweak Darrel's blinky example.
Code:<font color="#008000"><b><i>'FL PIC16F887 '16F887 DT INT RUPT '44 PIN DEMO BOARD 'REMOVE THIS LINE IF NOT SETTING THE CONFIGS IN CODE SPACE </i></b>@ __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF </font><font color="#0000FF"><b>OSCCON </b></font>= <font color="#800000"><b>%01100000 </b></font><font color="#008000"><b><i>'4 Mhz </i></b></font><font color="#FF0000"><b>DEFINE </b></font><font color="#0000FF"><b>OSC </b></font><font color="#800000"><b>4 </b></font><font color="#0000FF"><b>LED1 </b></font><font color="#FF0000"><b>VAR </b></font><font color="#0000FF"><b>PORTD</b></font>.<font color="#800000"><b>4 </b></font><font color="#0000FF"><b>wsave </b></font><font color="#FF0000"><b>VAR BYTE </b></font><font color="#800000"><b>$70 </b></font><font color="#0000FF"><b>SYSTEM </b></font><font color="#FF0000"><b>INCLUDE </b></font><b><i>"DT_INTS-14.bas" </i></b><font color="#008000"><b><i>' Base Interrupt System </i></b></font><font color="#FF0000"><b>INCLUDE </b></font><b><i>"ReEnterPBP.bas" </i></b><font color="#008000"><b><i>' Include if using PBP interrupts </i></b></font><font color="#FF0000"><b>ASM </b></font><font color="#008000">INT_LIST macro <b><i>; IntSource, Label, Type, ResetFlag? </i></b>INT_Handler TMR1_INT, _ToggleLED1, PBP, yes endm INT_CREATE <b><i>; Creates the interrupt processor </i></b></font><font color="#FF0000"><b>ENDASM </b></font><font color="#008000"><b><i>'5.0 mSec OR 200 Hz INTERRUPTS </i></b></font><font color="#0000FF"><b>T1CON </b></font>= <font color="#800000"><b>%00000001 </b></font><font color="#008000"><b><i>'Prescaler = 1:1, TMR1ON 'PRELOAD 60543 </i></b></font><font color="#0000FF"><b>PreLoad </b></font><font color="#FF0000"><b>VAR WORD </b></font><font color="#0000FF"><b>PreLoad </b></font>= <font color="#800000"><b>60543 </b></font><font color="#0000FF"><b>TMR1L </b></font>= <font color="#0000FF"><b>PreLoad</b></font>.<font color="#0000FF"><b>LowByte TMR1H </b></font>= <font color="#0000FF"><b>PreLoad</b></font>.<font color="#0000FF"><b>HighByte </b></font><font color="#008000">@ INT_ENABLE TMR1_INT <b><i>; enable Timer 1 interrupts </i></b></font><font color="#0000FF"><b>Main</b></font>: <font color="#008000"><b><i>'DO WHATEVER YOU WANT HERE </i></b></font><font color="#FF0000"><b>PAUSE </b></font><font color="#800000"><b>1000 </b></font><font color="#FF0000"><b>HIGH </b></font><font color="#0000FF"><b>PORTD</b></font>.<font color="#800000"><b>7 </b></font><font color="#FF0000"><b>PAUSE </b></font><font color="#800000"><b>1000 </b></font><font color="#FF0000"><b>LOW </b></font><font color="#0000FF"><b>PORTD</b></font>.<font color="#800000"><b>7 </b></font><font color="#FF0000"><b>GOTO </b></font><font color="#0000FF"><b>Main </b></font><font color="#008000"><b><i>'---[TMR1 - interrupt handler]-------------------------------------------------- </i></b></font><font color="#0000FF"><b>ToggleLED1</b></font>: <font color="#FF0000"><b>TOGGLE </b></font><font color="#0000FF"><b>LED1 </b></font><font color="#FF0000"><b>TOGGLE </b></font><font color="#0000FF"><b>PORTC</b></font>.<font color="#800000"><b>6 </b></font><font color="#008000"><b><i>'CONNECTED TO METER </i></b></font><font color="#0000FF"><b>TMR1L </b></font>= <font color="#0000FF"><b>PreLoad</b></font>.<font color="#0000FF"><b>LowByte </b></font><font color="#008000"><b><i>' Load the timer with preload value. </i></b></font><font color="#0000FF"><b>TMR1H </b></font>= <font color="#0000FF"><b>PreLoad</b></font>.<font color="#0000FF"><b>HighByte </b></font><font color="#008000">@ INT_RETURN </font>
Bookmarks