Beau Schwabe
Active Member
Hello,
I am using MPLAB X IDE (V4.01) on a Linux system and a PicKit 3, and all is good with 4 of the 6 I/O's on the PIC16LF15313 but I can't seem to properly configure PA3 and PA5 as outputs. PA0, PA1, PA2, and PA4 all test ok. Any clues would be helpful as there doesn't seem to be much in the way of example code for this micro that I have been able to find.
Here is a code snip that will configure PA4 as an output and wiggle the pin at about 167kHz ... Thanks again for any help !!
I am using MPLAB X IDE (V4.01) on a Linux system and a PicKit 3, and all is good with 4 of the 6 I/O's on the PIC16LF15313 but I can't seem to properly configure PA3 and PA5 as outputs. PA0, PA1, PA2, and PA4 all test ok. Any clues would be helpful as there doesn't seem to be much in the way of example code for this micro that I have been able to find.
Here is a code snip that will configure PA4 as an output and wiggle the pin at about 167kHz ... Thanks again for any help !!
Code:
#include "p16lf15313.inc"
CONFIG1 = _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_ON
CONFIG2 = _MCLRE_OFF & _PWRTE_OFF & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_ON & _STVREN_ON
CONFIG3 = _WDTCPS_WDTCPS_31 & _WDTE_OFF & _WDTCWS_WDTCWS_7 & _WDTCCS_SC
CONFIG4 = _BBSIZE_BB512 & _BBEN_OFF & _SAFEN_OFF & _WRTAPP_OFF & _WRTB_OFF & _WRTC_OFF & _WRTSAF_OFF & _LVP_ON
CONFIG5 = _CP_OFF
org 0
goto Init
org 100
Init:
movlw b'00000000'
movwf ANSELA
movlw b'00000000'
movwf ODCONA
movlw b'00000000'
movwf LATA
movlw b'00000000'
movwf TRISA
Main:
bsf PORTA,4 ;0,1,2,4 Works for these but I also need 3 and 5
nop
nop
bcf PORTA,4
goto Main
end
Last edited by a moderator: