I am building an application using the PIC18F24K22 (first time I've encountered this particular species). It's got an on-chip DAC. I am driving the DAC from Vdd to Vss. Not using the onchip FVR.
Assume the DACOUT pin (RA2) is buffered, as indicated as necessary by the datasheet (actually, for debugging, the pin is floating). Comparators are disabled.
Here are my control registers:
TRISA.2 = 0 (or 1, datasheet says don't care)
PORTA.2 = 0
ANSELA.2 = 1
VREFCON0 = b'00010000' -> FVR off
VREFCON1 = b'10100000' -> DAC Enabled/DACOUT OE Enabled/Vdd/Vss
VREFCON2 = 20 -> Vout = 20/32 * Vdd (3.125V @ Vdd=5V)
I get 0V out of the pin, regardless of what I try. I've even tried powering from the FVR with no result. This is puzzling me...usually I have no issues using PIC hardware. Any ideas?
FWIW, I know that I am doing something stupid and obvious, just can figure out what it is.
Assume the DACOUT pin (RA2) is buffered, as indicated as necessary by the datasheet (actually, for debugging, the pin is floating). Comparators are disabled.
Here are my control registers:
TRISA.2 = 0 (or 1, datasheet says don't care)
PORTA.2 = 0
ANSELA.2 = 1
VREFCON0 = b'00010000' -> FVR off
VREFCON1 = b'10100000' -> DAC Enabled/DACOUT OE Enabled/Vdd/Vss
VREFCON2 = 20 -> Vout = 20/32 * Vdd (3.125V @ Vdd=5V)
I get 0V out of the pin, regardless of what I try. I've even tried powering from the FVR with no result. This is puzzling me...usually I have no issues using PIC hardware. Any ideas?
FWIW, I know that I am doing something stupid and obvious, just can figure out what it is.