This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADC12_B_startConversion examples only work because they use ADC12_B_MEMORY_0

All the driverlib examples use ADC12_B_MEMORY_0 as the parameter to ADC12_B_startConversion().

This only happens to work as ADC12_B_MEMORY_0 is defined as 0. If you tried another memory the wrong ADC would be read. The parameter to ADC12_B_startConversion is an index NOT address offset.

eg. To select memory 3, use 3 not ADC12_B_MEMORY_3.

  • Chris,

    Which 430 device are you using?

    Mike
  • Hello,

    this error still exists.

    Example:

    The ADC12_B_MEMORY_1 is defined as 0x0002, which means the second bit in the word.

    But the CSSTARTx bits in the ADC12CTRL3 needs the number typically binary. Here the number 1 should be 0x0001.

    The problem in the driverlib is here:

    void ADC12_B_startConversion(uint16_t baseAddress,
                                 uint16_t startingMemoryBufferIndex,
                                 uint8_t conversionSequenceModeSelect)
    {
        //Reset the ENC bit to set the starting memory address and conversion mode
        //sequence
        HWREG8(baseAddress + OFS_ADC12CTL0_L) &= ~(ADC12ENC);
        //Reset the bits about to be set
        HWREG16(baseAddress + OFS_ADC12CTL3) &= ~(ADC12CSTARTADD_31);
        HWREG16(baseAddress + OFS_ADC12CTL1) &= ~(ADC12CONSEQ_3);

        HWREG16(baseAddress + OFS_ADC12CTL3) |= startingMemoryBufferIndex;
        HWREG16(baseAddress + OFS_ADC12CTL1) |= conversionSequenceModeSelect;
        HWREG8(baseAddress + OFS_ADC12CTL0_L) |= ADC12ENC + ADC12SC;
    }

    In the red line there is now written 0x0002 inside the register ADC12CTL3, but this does't work. It has to be 0x0001, cause here not every single bit stands for a single memory.

    Hopefully the error will be soon corrected.

    MCmajus

**Attention** This is a public forum