I have read some notes on inturrupts and have come up with the following, however, it doesn't do anything !! Of course with what i know about PICs, im not surprised. I am learning quickly though !!
This is what i have so far. Can you correct me if i've gone wrong on the interrupt side please?
ADCON1=7 'disable analog to digital converter
OPTION_REG.7=0 'enable pull-up resistor on PORTb
Led1 VAR PORTC.0 ' All LEDs
Led2 VAR PORTC.1 ' Connected between
Led3 VAR PORTC.2 ' RC pins and ground
Led4 VAR PORTC.3 ' via resistor
Led5 Var PORTC.4 '
ON INTERRUPT GOTO start ' Interrupt handler is start
INTCON = %10010000 ' Enable RB0 interrupt
Bright var byte
PushHowManyTimes var byte
Delay VAR BYTE
Delay=0
PushHowManyTimes=0
start:
DISABLE ' Disable interrupts in handler
branch PushHowManyTimes , [Start,StayOn,Blink,Fade,Wink]
PushHowManytimes=PushHowManytimes+1 ' Changing task
If PushHowManytimes=5 then PushHowManytimes=1
RESUME ' Return to main program
ENABLE ' Enable interrupts after handler
GOTO START
StayOn **** Routine *****
etc etc etc etc
Blink **** Routine *****
etc etc etc etc
Many thanks for any help received.
Bookmarks