Be careful, you interrupt service routine is rather dangerous: 1: you are not saving an registers (should save at least STATUS and W). 2: you are not ensuring correct bank on entry. As written, this handler will zero W as seen by non-interupt code. Bob Ammerman RAm Systems ----- Original Message ----- From: "Tony Nixon" To: Sent: Wednesday, February 13, 2002 2:05 PM Subject: Re: [PIC]: Timer Benjamin Menk|c wrote: > > but it goes already to timer0_int so the bank should be right.... And i am > pretty sure that my pic is not broken.. However i am doing isp debuggin... > might that be the reason? I just simulated that code with this simple program and it works ok, so perhaps you have the WDT enabled, or something is wrong in the main loop. list P = 16F84 #include "p16f84.inc" ORG 0h goto start ORG 0x0004 btfsc INTCON,T0IF goto timer0_int goto end_int timer0_int movlw 0 movwf TMR0 bcf INTCON,T0IF goto end_int asdaa nop goto asdaa end_int retfie start bsf STATUS,RP0 ; prescale = 1:2 clrf OPTION_REG bcf STATUS,RP0 clrf INTCON bsf INTCON,T0IE ; enable TMR0 IRQ bsf INTCON,GIE Loop nop nop goto Loop end -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.