No response from 16F15323
Ok, I've been writing PIC code and programming them since there were OTP versions. It hurts me to admit this, but I cannot get a 16F15323 to respond. It's on a minimal board, and is way overkill for what the board will do, but it fit the needs for the application, and was cheaper than the other possibles.
In short, it programs fine, verifies fine, and the -MCLRE pin shows external differences between programming as an input versus a reset pin; otherwise, I'd be tempted to say the chip was damaged.
It programs, verifies, and then does ... nothing. All pins except power, ground and MCLRE stay at ground as measured by an oscilloscope. I put this down to the new, more complex config words and bank select scheme, and proceeded to spend most of the day reading the datasheet, resetting config words, messing with disabling a-d inputs, ports and pin mapping. Nothing so far changes how it acts.
I'm pretty certain there is a config bit or register setting that I'm missing, but danged if I can find it. If you can, I'll owe you several virtual beers, at a minimum.
As things kept not working, I stripped the code down further to what you see below. The test is to simply fire it up with the low frequency internal oscillator, then blink all the PORTA and PORTC pins with 1s and 0s alternately. Which bit am I missing?
Here's the code:
; TEST 0 to make sure the board's working
; TEST CODE HERE ========================================================
; Fuse Configuration
; PIC16LF15323 Configuration Bit Settings
__CONFIG _CONFIG1, _FEXTOSC_OFF & _RSTOSC_LFINT & _CLKOUTEN_OFF & _CSWEN_OFF & _FCMEN_OFF
__CONFIG _CONFIG2, _MCLRE_OFF & _PWRTE_ON & _LPBOREN_OFF & _BOREN_OFF & _BORV_LO & _ZCD_OFF & _PPS1WAY_ON & _STVREN_OFF
__CONFIG _CONFIG3, _WDTCPS_WDTCPS_31 & _WDTE_OFF & _WDTCWS_WDTCWS_7 & _WDTCCS_SC
__CONFIG _CONFIG4, _BBSIZE_BB512 & _BBEN_OFF & _SAFEN_OFF & _WRTAPP_OFF & _WRTB_OFF & _WRTC_OFF & _WRTSAF_OFF & _LVP_OFF
__CONFIG _CONFIG5, _CP_OFF
; CONSTANTS Variable Declarations
ORG 0x0000 ; processor reset vector
NOP ; walk into code with NOPs
; FIX OSCILLATOR TO STAY AT 31KhZ
MOVLB D'17' ; point at bank 17
MOVLW B'01010000' ; loading for OSCCON1
; NOSC = RSTOSC, NDIV = 1:1
MOVWF OSCCON1 ;
MOVLB D'62' ; set up bank select for ANSELA and ANSELC
MOVLB D'0' ; point at register bank 0
MOVWF PORTA ; fill PORTA with 1s
MOVWF LATA ; port a output latch all 1'a
MOVWF PORTC ; PORT C ALL 1'S
MOVWF LATC ; LATC alL 1S
MOVWF TRISA ; port a all OUTPUTS
MOVWF TRISC ; PORT c ALL OUTPUTS
CLRW ; w ALL ZEROS
COMF W, f ; toggle W
MOVWF LATA ; fill PORTA with W
MOVWF LATC ; fill PORTC with W
; TEST CODE ENDS HERE ========================================================