i've been working with Darryl's instant interrupts for PWM LED's and they work great! now i'm moving over to work directly with timers with a new-to-me PIC and have hit a wall.
i've reduced my code down to what i think are the bare essentials and i still don't have blinky. here's the code that compiles:
@ __CONFIG _CONFIG1H, _OSC_INTIO67_1H
@ __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOREN_OFF_2L
@ __CONFIG _CONFIG2H, _WDT_OFF_2H
@ __CONFIG _CONFIG3H, _MCLRE_ON_3H
@ __CONFIG _CONFIG4L, _LVP_OFF_4L & _DEBUG_OFF_4L
define OSC 8
clear
CCP1CON=0 'turn off capture and compare module 1
CCP2CON=0 'turn off capture and compare module 2
SSPCON1.5=0 'disables SPI and I2C modules on portC
ADCON1=%00001111 'turns all AD pins to digital and tells module to use Vdd and Vss
ADCON0.0=0 'disables AD module
CMCON.0=0 'disables comparator module for portA
CMCON.1=0 '(ditto)
CMCON.2=0 '(ditto)
CVRCON.7=0 'disables comparator voltage reference module for portA
TRISB=%11101111 'PortB.4 => HB LED pin set to output
LED1 VAR PORTB.4
loop var byte
INCLUDE "DT_INTS-18.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ' Include if using PBP interrupts
'lets me know the PIC is doing something after programming
for loop=1 to 4
toggle led1
pause 50
next loop
;-----------------------------------------------------------------------------
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR0_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
;-----------------------------------------------------------------------------
T0CON=%10011000 ; TMR0ON, 16-bit, internal clock, high>low, no prescaler
@ INT_ENABLE TMR0_INT ; enable Timer 0 interrupts
;-----------------------------------------------------------------------------
Main:
PAUSE 1
GOTO Main
'---[TMR1 - interrupt handler]--------------------------------------------------
ToggleLED1:
TOGGLE LED1
@ INT_RETURN
i've read read read the datasheet and have done many, many searches on this forum to try and find the small thing i'm missing. this is why i'm finally posting here for assistance.
Bookmarks