hjl4
Member
Why is this not working?
Is chip kapput?
I have a 12f629 that refuses to flash simple led(green) with 330ohm resistor, tied into GP0. or GPIO,0. This is my 50th time, with no success.
I'm using a JDM programmer, and ICProg reports everytime, that everything OK.
I read the chip before trying anything out, and everything seems OK.
Here is the program.
; This file is a basic code template for assembly code generation *
; on the PICmicro PIC12F29. This file contains the basic code *
; building blocks to build upon. *
; *
; If interrupts are not used all code presented between the ORG *
; 0x004 directive and the label main can be removed. In addition *
; the variable assignments for 'w_temp' and 'status_temp' can *
; be removed. If the internal RC oscillator is not implemented *
; then the first four instructions following the label 'main' can *
; be removed. *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler (Document DS33014). *
; *
; Refer to the respective PICmicro data sheet for additional *
; information on the instruction set. *
; *
;**********************************************************************
; *
; Filename: xxx.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
; *
;**********************************************************************
; *
; Files required: *
; *
; *
; *
;**********************************************************************
; *
; Notes: *
; *
; *
; *
; *
;**********************************************************************
list p=12f629 ; list directive to define processor
#include <p12f629.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file
__CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT
; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
; See data sheet for additional information on configuration word settings.
;This program will blink a LED connected to pin 7 17-12-2005
fileA equ 26h
fileB equ 27h
fileC equ 28h
; bits on GPIO
pin7 equ 0 ;GP0 output to LED
pin6 equ 1 ;GP1
pin5 equ 2 ;GP2
pin4 equ 3 ;GP3
pin3 equ 4 ;GP4
pin2 equ 5 ;GP5
Start org 0x0000 ;program starts at location 000
nop
nop
nop
nop ;NOPs to get past reset vector address
nop
nop
SetUp bsf STATUS, RP0 ;Bank 1
movlw b'10000110' ;Turn off T0CKI, prescale for TMR0 = 1:128
movwf OPTION_REG
movlw b'00110111' ;Set GP0 (pin 7) as output
movwf TRISIO
;calibrating the internal oscillator
call 0x3ff ;get the calibration value
movwf OSCCAL ;calibrate oscillator
bcf STATUS, RP0 ;bank 0
clrf GPIO ;Clear GPIO of junk
LED bsf GPIO,pin7 ;turn on LED
call Del
bcf GPIO,pin7 ;turn off LED
call Del
goto LED
;Delay 1 sec
Del movlw 40h
movwf fileC
DelX decfsz fileA,1 ; ,1 denotes the result of the decrement
goto DelX
decfsz fileB,1 ; is placed in the file
goto DelX
decfsz fileC,1
goto DelX
retlw 00
;OSCCAL calibration value
org 0x3ff
movlw 0x20
end
any help would be appreciated.
Is chip kapput?
I have a 12f629 that refuses to flash simple led(green) with 330ohm resistor, tied into GP0. or GPIO,0. This is my 50th time, with no success.
I'm using a JDM programmer, and ICProg reports everytime, that everything OK.
I read the chip before trying anything out, and everything seems OK.
Here is the program.
; This file is a basic code template for assembly code generation *
; on the PICmicro PIC12F29. This file contains the basic code *
; building blocks to build upon. *
; *
; If interrupts are not used all code presented between the ORG *
; 0x004 directive and the label main can be removed. In addition *
; the variable assignments for 'w_temp' and 'status_temp' can *
; be removed. If the internal RC oscillator is not implemented *
; then the first four instructions following the label 'main' can *
; be removed. *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler (Document DS33014). *
; *
; Refer to the respective PICmicro data sheet for additional *
; information on the instruction set. *
; *
;**********************************************************************
; *
; Filename: xxx.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
; *
;**********************************************************************
; *
; Files required: *
; *
; *
; *
;**********************************************************************
; *
; Notes: *
; *
; *
; *
; *
;**********************************************************************
list p=12f629 ; list directive to define processor
#include <p12f629.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file
__CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT
; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
; See data sheet for additional information on configuration word settings.
;This program will blink a LED connected to pin 7 17-12-2005
fileA equ 26h
fileB equ 27h
fileC equ 28h
; bits on GPIO
pin7 equ 0 ;GP0 output to LED
pin6 equ 1 ;GP1
pin5 equ 2 ;GP2
pin4 equ 3 ;GP3
pin3 equ 4 ;GP4
pin2 equ 5 ;GP5
Start org 0x0000 ;program starts at location 000
nop
nop
nop
nop ;NOPs to get past reset vector address
nop
nop
SetUp bsf STATUS, RP0 ;Bank 1
movlw b'10000110' ;Turn off T0CKI, prescale for TMR0 = 1:128
movwf OPTION_REG
movlw b'00110111' ;Set GP0 (pin 7) as output
movwf TRISIO
;calibrating the internal oscillator
call 0x3ff ;get the calibration value
movwf OSCCAL ;calibrate oscillator
bcf STATUS, RP0 ;bank 0
clrf GPIO ;Clear GPIO of junk
LED bsf GPIO,pin7 ;turn on LED
call Del
bcf GPIO,pin7 ;turn off LED
call Del
goto LED
;Delay 1 sec
Del movlw 40h
movwf fileC
DelX decfsz fileA,1 ; ,1 denotes the result of the decrement
goto DelX
decfsz fileB,1 ; is placed in the file
goto DelX
decfsz fileC,1
goto DelX
retlw 00
;OSCCAL calibration value
org 0x3ff
movlw 0x20
end
any help would be appreciated.