Hi Graham, This code definitely works on my 12C509. Plonk it into MPASM (or whatever) and compile it. Then program your chip. A LED connected to GPIO 1 (pin6) through a 330R resistor to ground should flash at about a 1/2 second rate when you connect power. If yours does not work there will be other problems. Verify your chip after programming and make sure your circuit connections are correct. If it does work, try integrating some of your code into this, a little at a time, until you get it all going. The prescaler setting has been changed to allow the code to detect when TMR0 = 0. To get a faster flash rate change the value of "LOOP1". LIST P=12C509 RADIX DEC INCLUDE CBLOCK 0X07 LOOP1 ENDC __CONFIG _CP_OFF & _MCLRE_OFF & _WDT_OFF & _IntRC_OSC ORG 0X3FF MOVLW 0X80 ORG 0X0000 MOVWF OSCCAL GOTO START DELAY MOVF TMR0,w ; TMR0 must be zero for these instructions if the loop is to work BTFSS STATUS,Z ; TMR0 must be zero for these instructions if the loop is to work GOTO DELAY ; TMR0 must be zero for these instructions if the loop is to work DECFSZ LOOP1 GOTO DELAY RETLW 0 START MOVLW 0 ; set al pins = 0 MOVWF GPIO MOVLW 0 ; set all pins as outputs TRIS GPIO MOVLW B'11010010' ; TMR0 internal clock, PRESCALER 1:4 OPTION FLASH MOVLW B'00000010' XORWF GPIO CLRF LOOP1 ; LOOP1 value determines delay. 0 = MAXIMUM CALL DELAY GOTO FLASH END -- Best regards Tony http://www.picnpoke.com mailto:sales@picnpoke.com