Hello
I use aduc7061 with accelerometer to make angle sensor, and now I'm trying mo set up ADC
In datasheet it is said, that ADC of Aduc7060/7061 is 24bit, but when I read it, I see only 16 bits of value with maximum of 0x7fff and minimum 0x8000 value.
What should I do to enable 24 bits?
I have experimented with conversion rate, but nothing changes. Result of adc conversion is more precise, but it is still 16 bit (with right align)
void initAdc(){ // Configure ADC0 for continuous conversions, 1Khz, AIN0 in Single-ended mode ADCMSKI = BIT0; // Enable ADC0 result ready interrupt source //ADCFLT = 0x7; // Chop off, 1Khz samping rate, SF = 7. No averaging //ADCFLT = BIT15 + BIT14 + BIT8 + 127; ADCFLT = 127; //ADCFLT = BIT15 + BIT14; ADCMDE = BIT0 + BIT7; // Continuous Conversion mode, Normal mode, 4Mhz clock source to ADC.
ADC0CON = // BIT0 + // pga gain// BIT4 + // external ref// BIT6 + // AIN0 selected in Single ended mode BIT7 + // AIN0 selected in Single ended mode
// BIT10 + // Unipolar ADC output// BIT11 + // pga output common-mode voltage to avdd/2// BIT12 + // external referene exceeds 1.35v BIT15; // enable adc ADCCFG = 0;
IRQEN = BIT10 + BIT11; // Enable ADC and UART interrupts
}
__irq void IRQ_Handler(void) { unsigned long IRQSTATUS = 0; unsigned char ucCOMIID0 = 0;
IRQSTATUS = IRQSTA; // Read off IRQSTA register if ((IRQSTATUS & BIT11) == BIT11) //UART interrupt source { ucCOMIID0 = COMIID0; // Read the UART IRQ ID register
if ((ucCOMIID0 & 0x2) == 0x2) // Transmit buffer empty { ucTxBufferEmpty = 1; } if ((ucCOMIID0 & 0x1) == 0x1) // Receive buffer Full { ucRxChar = COMRX; // read COMRX register bSendResultToUART = 1; // Set flag to return a string to the PC } } if ((IRQSTATUS & BIT10) == BIT10) //If ADC0 interrupt source { ulADC0Result = ADC0DAT; // Read ADC0 conversion result bSendResultToUART = 1; }
Please make sure that you have correct input range. And find the corresponding RMS noise or ENOB in Table 36 and 37 based on your update rate and PGA configuration.
It doesn't mean that ADuCM7060/1 can realize the 16bit ADC performance in any case. It depend on your configuration of update rate and PGA value.
Well the signal is going inside the ADC Aux my setting are:
ADC2/ADC5
ADC5 biased 0.20V
Single Ended
Unipolar
I have used Vref for AVDD/2 and Vref 2.5ADC the same result.
If i assume i got a 16bit ADC the measurement is spot on.
The measure Voltage I am trying to get is 1.15 or somewhere around there.
Does the PGA affects the AUX according to Table 36 as there is no table for the AUX...
I haven't touched the PGA at all on the settings.
I am uploading the project, small changes on one that MMA gave me way back.
If you are not getting the same output then it must be my hardware set up, if you are could you spot the problem, I am not sure there is one?
ADuC7061_MiniKit_ADC0_ADC5[T].zip