Hey GeoJoe, thanks for the input, I've mad ethe changes but still no joy :-s - the intcon bits are the same according to the data sheet "The T0IF bit
(INTCON<2>) must be cleared in software by the
Timer0 module Interrupt Service Routine before reenabling
this interrupt."
but no luck yet, do you think it might be something to do with running an external clock?
also - how do i place the code in a special little code box on here??
@ DEVICE PIC16F676, XT_OSC, MCLR_OFF, PROTECT_OFF, BOD_ON, CPD_OFF
TRISA = %000000
TRISC = %101100
ANSEL = %10000000 'enable ch7 analog
CMCON = 7 'Disable comparitor
OPTION_REG = %00010111
INTCON.2 = 0 ' Clear Timer0 int flag
INTCON.5 = 1 ' Enable Timer0 int
TMR0 = 0 ' Set TMR0 to 0.
ON INTERRUPT GOTO int
red var PortC.0
green var PortA.2
PDWN var PortC.1
DAT var PortC.2
pwr var PortC.4
Switch var PortC.5
clear
PortA = 0
PortC = 0
Start:
goto start
disable
int:
TMR0 = 0
toggle red
intcon.2 = 0 ' reset interupt flag
resume
enable
Bookmarks