hello,
I am working on a PIC18F46K22 with the DAC 5 bits for DDS signal generation .(sinus,triangle,carre..)
RA2 is dedicated for the DAC output. ... it's works fine !
Code:
void Config_DAC(void)
{
// init DAC 5bits output
VREFCON0=0x00;VREFCON0bits.FVREN=1; // valid Fixed REF. Voltage
VREFCON0bits.FVRS1=1; // Voltage ref= 4.096V
VREFCON0bits.FVRS0=1;
Tempo(1000L);
VREFCON1bits.DACEN=1 ; // valide DAC
VREFCON1bits.DACLPS=0; // sortie a 0 en mode Low Power
VREFCON1bits.DACOE=1; // sortie DAC sur PIN
VREFCON1bits.DACPSS1=1; // DAC positive source is FVR Buff1 output
VREFCON1bits.DACPSS0=0;
VREFCON1bits.DACPSS0=0;
VREFCON1bits.DACNSS=0; // DAC Negative source is 0V (=VSS)
VSSVREFCON2=0x00; // output level=0}
But i wand to add an offset to the DAC output, by adding a litle level as +0,2V via the pin -REF...
In DAC configuration we can choose
Maximum reference as +VDD , or 4,096V or 2,048V or 1,024V
and for mimimum reference VSS or -REF ..(with VREFCON1bits.DACNSS=1
for DAC voltage output
as we can see on the datasheet drawing.
or if i look on I/O configuration list, i see RA2 is also -REF ???
what is wrong..
it seems -REF can be used , only with ADC , not with DAC ?
am i wrong somewhere ?
Is it possible to use other minimum reference as VSS for the DAC ?
if yes, and How can we do it ?