I have been struggling for 2 days with a program for a PIC 12F509.
Odd things were happening, so I wrote a simple test program:
Try as I may, I cannot get pin 5 (GP2) to go high. I have tried 4 dip chips (one was new), 3 SOIC chips (2 were new), two computers (one had a real serial port, the other used a USB to serial adapter cable), and 2 programmers (PicStart Plus and Inchworm --an MPLAB ICD2 emulator).
Both computers and programmers, including the adapter cable, had worked in the recent past. Contact to the #5 pin have been checked and appear to be OK.
I need a fresh brain and set of eyes to look at this for possible problems/solutions.
Thanks.
John
Odd things were happening, so I wrote a simple test program:
Rich (BB code):
;**********************************************************************
list p=12F509 ; list directive to define processor
#include <p12F509.inc> ; processor specific variable definitions
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _IntRC_OSC
; __CONFIG 0FFA
;***** VARIABLE DEFINITIONS
List
d1 equ 0x11
d2 equ 0x0b
;*******************************************************************
RESET_VECTOR
ORG 0x3FF ; processor reset vector
; Internal RC calibration value is placed at location 0x3FF by Microchip
; as a movlw k, where the k is a literal value.
MAIN
ORG 0x000
movwf OSCCAL ; update register with factory cal value
start
movlw b'001000' ; sets all pins to output, except GPIO,3 (pin4)
tris GPIO
flash
movlw b'110111' ; sets all pins high
movwf GPIO
call dly_2E5
; movlw b'000000' ; sets all pins low
; movwf GPIO
; call dly_2E5
goto flash
dly_2E5
clrwdt
movlw 0x3f
movwf d1
movlw 0x9d
movwf d2
delay
decfsz d1,f
goto $+2
decfsz d2,f
goto delay
retlw 0
END ; directive 'end of program'
Both computers and programmers, including the adapter cable, had worked in the recent past. Contact to the #5 pin have been checked and appear to be OK.
I need a fresh brain and set of eyes to look at this for possible problems/solutions.
Thanks.
John
Last edited: