MOUNTAIN747
- 30th March 2020, 19:06
So I’m stumped over this one. Using a PIC16F1936 on a lighting project. Trying to run some simple code to blink A.7, A.6, C.0, C.1, C.2, …….. All lights are blinking except PortA.7.
; MPASM
asm
__config _CONFIG1,_FOSC_INTOSC & _CLKOUTEN_OFF & _MCLRE_ON & _BOREN_OFF & _WDTE_OFF & _FCMEN_OFF & _CP_OFF & _CPD_OFF & _IESO_OFF
__config _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_ON & _BORV_LO & _LVP_OFF
endasm
define osc 8
;--[ Set Hardware ]---------
OSCCON=%01110000
ANSELA=$0
ANSELB=$0
ADCON0=$0
PortA=0
PortB=0
PortC=0
TrisA=0
TrisB=0
TrisC=0
Start:
PortA.7=1
pause 500
PortA.6=1
pause 500
PortC.0=1
pause 500
PortC.1=1
stop
END
RA.6 and RA.7 are also oscillator pins and must be set to I/O outputs in CONFIG1 with CLKOUTEN=1 (_CLKOUTEN_OFF) and FOSC= INTOSC (CLKOUTEN_OFF). According to the data sheet this should give digital I/O on both RA.6 and RA.7. RA.6 is responding as expected. RA.7 is NOT giving me a digital output. I have tried on multiple 1936’s on my design board and LAB-X2. No 5V output on RA.7. What have I overlooked?
Thanks,
Wayne
; MPASM
asm
__config _CONFIG1,_FOSC_INTOSC & _CLKOUTEN_OFF & _MCLRE_ON & _BOREN_OFF & _WDTE_OFF & _FCMEN_OFF & _CP_OFF & _CPD_OFF & _IESO_OFF
__config _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_ON & _BORV_LO & _LVP_OFF
endasm
define osc 8
;--[ Set Hardware ]---------
OSCCON=%01110000
ANSELA=$0
ANSELB=$0
ADCON0=$0
PortA=0
PortB=0
PortC=0
TrisA=0
TrisB=0
TrisC=0
Start:
PortA.7=1
pause 500
PortA.6=1
pause 500
PortC.0=1
pause 500
PortC.1=1
stop
END
RA.6 and RA.7 are also oscillator pins and must be set to I/O outputs in CONFIG1 with CLKOUTEN=1 (_CLKOUTEN_OFF) and FOSC= INTOSC (CLKOUTEN_OFF). According to the data sheet this should give digital I/O on both RA.6 and RA.7. RA.6 is responding as expected. RA.7 is NOT giving me a digital output. I have tried on multiple 1936’s on my design board and LAB-X2. No 5V output on RA.7. What have I overlooked?
Thanks,
Wayne