aduc7061 adc resolution

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;
    } 


}

Parents
  • I have pulled ADC5 to AVDD/2 (1.2v), and I have 0x7fff when input is 2.4v, and 0x8000 when input is 0v

    In all conditions significant are only low 2 bytes of register (16 bit). Other = 0

    I have tried to set unipolar output coding. Values of conversion were changed, but max and min values still are 16 bit (0x0000 and 0xffff respectively)

    p.s. I'm using Keil for debug.

    I've tried to watch memory in address, where ADC0DAT is situated, but bits, higher than 16 are still = 0

Reply
  • I have pulled ADC5 to AVDD/2 (1.2v), and I have 0x7fff when input is 2.4v, and 0x8000 when input is 0v

    In all conditions significant are only low 2 bytes of register (16 bit). Other = 0

    I have tried to set unipolar output coding. Values of conversion were changed, but max and min values still are 16 bit (0x0000 and 0xffff respectively)

    p.s. I'm using Keil for debug.

    I've tried to watch memory in address, where ADC0DAT is situated, but bits, higher than 16 are still = 0

Children
No Data