18F2321 MPLABX 5.45 PICKit4 Win10 Assembly
Two problems that I could not solve after many days trying:
1st problem) if the micro was previously blank, after being programmed with the PICKit4, the program does
not start but, by briefly disconnecting and reconnecting power, it starts with no problem.
Just in case, my configuration follows:
2nd problem) I need RA0,RA1 and RA2 to be available as digital OUT.
I know that on POR, all analog inputs become digital but, just in case I load ADCON1, explicitly:
LOADREG_IN_ACC ADCON1,00001111B ;all ADC inputs are made digital
I also know that on POR, both comparators are turned off but, just in case again I load CMCON, explicitly:
LOADREG_IN_ACC CMCON,00000111B ;for 18F2321 turn comparators OFF
I finally do
BCF TRISA,0 ;pin is OUT
BCF TRISA,1 ;pin is OUT
BCF TRISA,2 ;pin is OUT
I could not get any output through those pins.
Is there any way too obvious step I did not consider?
Thanks for any help.
Two problems that I could not solve after many days trying:
1st problem) if the micro was previously blank, after being programmed with the PICKit4, the program does
not start but, by briefly disconnecting and reconnecting power, it starts with no problem.
Just in case, my configuration follows:
Code:
;------------------------------------------------------------------------------
CONFIG OSC = INTIO2, FCMEN = OFF, IESO = OFF, PWRT = OFF
CONFIG BOR=0, BORV = 3, WDT = OFF, WDTPS = 1
CONFIG CCP2MX = RC1, PBADEN = DIG, LPT1OSC = OFF, MCLRE = ON
CONFIG STVREN = OFF, LVP = OFF, BBSIZ = BB256, XINST = OFF
CONFIG DEBUG = OFF, CP0 = OFF, CP1 = OFF, CPB = OFF
CONFIG CPD = OFF, WRT0 = OFF, WRT1 = OFF, WRTC = OFF
CONFIG WRTB = OFF, WRTD = OFF, EBTR0 = OFF, EBTR1 = OFF
CONFIG EBTRB = OFF
;------------------------------------------------------------------------------
I know that on POR, all analog inputs become digital but, just in case I load ADCON1, explicitly:
LOADREG_IN_ACC ADCON1,00001111B ;all ADC inputs are made digital
I also know that on POR, both comparators are turned off but, just in case again I load CMCON, explicitly:
LOADREG_IN_ACC CMCON,00000111B ;for 18F2321 turn comparators OFF
I finally do
BCF TRISA,0 ;pin is OUT
BCF TRISA,1 ;pin is OUT
BCF TRISA,2 ;pin is OUT
I could not get any output through those pins.
Is there any way too obvious step I did not consider?
Thanks for any help.