Erik Werner wrote: > > The programer I got from amazon electronics. It's model 96. The PC is a > laptop running NT. Software is picallw. There is a hardware check built in > the software for pic16's and kit number 96. > > attached is my asm file. I have made mention of some bugs in you code, and at the end, the code I would write to overcome them. This may not explain programmer bugs, but the code should work. ;Erik Werner ;1st PIC tests. FLASH AN LED list p=16F84 radix hex __config 0x3ffd You have left the WDT on. Try using this format which is easier to read... __Config _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC ; #INCLUDE Include what ???? Perhaps... #INCLUDE "P16F84.inc" org 0x000 COUNT equ 0Xfa ;250 in decimal You can write COUNT equ d'250' if it's more readable. PORTB equ 0X06 PORTA equ 0x05 If you added the include p16f84.inc, then these ports are already pre-defined and you don't need to do it. counter equ 0x0c ; org 0x004 start of the interupt routine ; START movlw 0x00 ;put zero into W movwf PORTB ;put w into f tris PORTB ;make all B-ports output (w) Microchip recommends not useing TRIS instructions and since PORTA is also a part of the 16F84, it should also be initialised. If it is not used, I would set all pins to low outputs and leave them unconnected. clrf PORTA ; all port pins = low clrf PORTB bsf STATUS,RP0 clrf TRISA ; all port pins = outputs clrf TRISB bcf STATUS,RP0 I would put this line in the PAUSE subroutine. movlw COUNT call OFF call PAUSE call ON call PAUSE This will cause the PORTS to be re-initialised and you may see 'funny' results. goto START ON movwf 0x00 ;turn on LED subroutine This line does not appear to be needed, and would write the W reg data to the RAM register pointed to by the value in the FSR register - eg. Indirect Addressing. bsf PORTB,0 ;turn on RB0 bcf PORTB,1 ;turn on RB1 It's not wise to use multiple BSF BCF instructions on a PORT. Why not combine both instructions like this... movlw b'00000001' ; RB0 = on, RB1 = off movwf PORTB return OFF bcf PORTB,0 ;turn off RB0 bsf PORTB,1 ;turn on RB1 Same here.... movlw b'00000010' ; RB0 = off, RB1 = on movwf PORTB return PAUSE movwf counter ;pause time. I would do this... PAUSE movlw COUNT movwf counter decfsz counter,0 This line will make sure the pause subroutine never exits goto PAUSE This line not needed.. movlw COUNT return Try... PAUSE movlw COUNT movwf counter P_Loop decfsz counter goto P_Loop return end You still may not see the LED's flash and this will depend on you crystal speed. If you are using 4MHz, then you will need to change the pause subroutine to make it longer. Something like... PAUSE clrf Pause_L clrf pause_M movlw 3h movwf Pause_H P_Loop decfsz Pause_L goto P_Loop decfsz Pause_M goto P_Loop decfsz Pause_H goto P_Loop return You would need to define the new pause registers.. Pause_H equ 0x0C Pause_M equ 0x0D Pause_L equ 0x0E Or let the assembler do it for you like this... CBLOCK 0x0C Pause_H Pause_M Pause_L ENDC The CBLOCK statement is explained in the MPASM help file. Here is the modified code and may now work with the programmer... ;Erik Werner ;2nd PIC tests. FLASH 2 LEDs :-) list p=16F84 radix hex __Config _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC #INCLUDE "P16F84.inc" org 0x000 ; ; RAM DEFINITIONS ; CBLOCK 0x0C Pause_H Pause_M Pause_L ENDC ; ; PROGRAM START ; START clrf PORTA ; all port pins = low clrf PORTB bsf STATUS,RP0 clrf TRISA ; all port pins = outputs clrf TRISB bcf STATUS,RP0 ; ; MAIN PROGRAM LOOP ; Led_Loop call OFF call PAUSE call ON call PAUSE goto Led_Loop ; ; LED ON SUBROUTINE ; ON movlw b'00000001' ; RB0 = on, RB1 = off movwf PORTB return ; ; LED OFF SUBROUTINE ; OFF movlw b'00000010' ; RB0 = off, RB1 = on movwf PORTB return ; ; TIME DELAY SUBROUTINE ; PAUSE clrf Pause_L clrf pause_M movlw 3h ; changing Pause_H, means a coarse movwf Pause_H ; change in time delay P_Loop decfsz Pause_L goto P_Loop decfsz Pause_M goto P_Loop decfsz Pause_H goto P_Loop return end -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads