Matthew, The first thing I see wrong I believe is that you have the "INTERRUPT VECTOR" at 0x03. It should be 0x04. Everything else looks okay from my initial glance. I think if you get the interrupt vector corrected, it'll work as planned. Regards, Jim >This is a multi-part message in MIME format. > >------=_NextPart_000_000F_01BF1A6A.0D3FBE00 >Content-Type: text/plain; > charset="iso-8859-1" >Content-Transfer-Encoding: quoted-printable > > Hi All, > >Can someone tell me why the following code will not work. Is this the >correct way to initilise the timer and use the timer overflow interupt. > >Thanks in advance > >Mathew Cohen > > > ORG H'50' > >Start > Call Initporta > Call Initportb > Call Initmr > GOTO Checkswitch > >;------------------------------------------------------------------------ >-- > > ORG H'03' >TmrInterupt > > BTFSC PORTB,7 > call Initmr > goto toggleleds > >Initmr > CLRF TMR0 > BSF STATUS,RP0 ;select bank 1 > CLRF OPTION_REG > MOVLW B'00000111' > IORWF OPTION_REG,1 > BCF INTCON,T0IF > BSF INTCON,T0IE > > RETURN > > >Initporta > > BSF STATUS,RP0 > MOVLW 0 > TRIS PORTA > BCF STATUS,RP0 > MOVLW 31 > MOVWF PORTA > > RETURN > >Initportb > > BSF STATUS,RP0 > MOVLW H'FF' > MOVWF TRISB > BCF STATUS,RP0 > RETURN > >Checkswitch > BTFSS PORTB,7 > BSF PORTA,4 > BTFSC PORTB,7 > BCF PORTA,4 > GOTO Checkswitch > > >toggleleds > > BTFSS PORTA,1 > goto LedsOFF > BTFSC PORTA,1 > goto Ledson > >Ledson > > MOVLW 15 > MOVWF PORTA > CALL Initmr > GOTO Checkswitch > > >LedsOFF > > MOVLW 0 > MOVWF PORTA > CALL Initmr > GOTO Checkswitch > > END > >------ extPart_000_000F_01BF1A6A.0D3FBE00