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.

CCS/RF430FRL152H: RF430FRL152HEVM

Part Number: RF430FRL152H
Other Parts Discussed in Thread: REF2033

Tool/software: Code Composer Studio

Hi,
I used 12-bit ADC for measurement and got the ADC value as below.
But the ADC0 value is incorrect sometimes.
I use P1.0 to measure the time it takes to catch ADC0.
In the TRM, 12-bit ADC conversion time is 128ms. This is different from what I measured.
Does the following code have any setting error?

ADC0  Time (ms) Result
6186 31.62 correct
672 64.31 incorrect
671 64.3 incorrect
6180 31.62 correct

===========================================================
void SetupSD14(u08_t channel)
{
// setting: channel to be sampled, the programmable amplifier gain (2x), CIC filter, SD14INTDLY0 needed since CIC filter needs atleast two consecutive samples before producing an accurate result
// SDRATE at fastest result possible but also not the most accurate, also enabled is the SD14RBEN which is the current source into the thermistor and references resistor
//SD14CTL1 = SD14RBEN1 + SD14RBEN0 + SD14UNI + SD14GAIN0 + SD14INTDLY0 + channel;
SD14CTL1 = SD14UNI + SD14INTDLY0 + channel;
SD14CTL1 |= (channel == THERMISTOR_ADC2_CHANNEL) ? SD14RBEN1 : SD14RBEN0;
SD14CTL1 |= (channel == ADC0_CHANNEL) ? (SD14RATE1 + SD14RATE0) : SD14RATE1; // 12-bit

SD14CTL0 = SD14EN + VIRTGND; // SD14 module enabled,
SD14CTL0 |= SD14SC; // start the conversion
}

void main()
{
...
...
// Set and Read ADC0
SetupSD14(ADC0_CHANNEL);

// Setup P1.0 output
P1DIR |= 0x01;
// Toggle Output High/Low
P1OUT |= 0x01;
while(!(SD14CTL0 & SD14IFG)) {
};
P1OUT &= ~0x01;

nfc_sys_data.ADC0_Buffer[0] = SD14MEM0;
SD14CTL0 &= ~SD14IFG; // clear the data available interrupt
...
...
}

===========================================================

Thanks.

  • Hi,

    My test step as below:

    1. SD14INCH = 0x03    // Enable ADC1

        SD14RBEN = 0x01    // Enable reference current 2.4uA

    2. wait for 10 second

    3. SD14INCH = 0x00    // Enable ADC0

        Read ADC0 value SD14MEM0

    The ADC1 will provide reference current 2.4uA and used 124k ohm resistor convert to 0.3V.

    This 0.3V voltage is the input of ADC0.

    But we find the reference current 2.4uA will be turn off when ADC0 enabled even if "SD14RBEN = 0x01".

    So I will get incorrect ADC0 value.

    May I ask this is normal?

    Thanks.

  • Hello Allen,

    I probably will need to defer this to another colleague who is out of office for a few days, but for starters:

    1) What is the frequency of the signal being sampled?

    2) Have you reviewed the schematic carefully regarding external components including their value? See Section 2.3 of the FAQ for a summary: http://www.ti.com/lit/pdf/sloa247 - missing components could result in issues with device operation.

  • Hi Jacobi,

    1) The ADC0 sample rate is 2kHz.

    2) Yes, we have check the schematic.

    Have any update for this question?

    Thanks.

  • Hello Allen,

    To clarify, I was not asking the ADC sample rate, but the frequency of the input signal that is being sampled if it's notable at all as it is not clear what is being sampled.

  • Hi Jacobi,

    We used the ADC1 provide reference current 2.4uA and used 124k ohm resistor convert to 0.3V.

    And this 0.3V voltage is the input of ADC0.

    Thanks.

  • Hi Jacobi,

    Have any update for this question?

    Thanks.

  • Hello Allen,

    I will follow-up with my colleague, I think we had a miscommunication on who is picking up providing you support here and that is my fault.

  • Allen Chen 3 said:
    But we find the reference current 2.4uA will be turn off when ADC0 enabled even if "SD14RBEN = 0x01"

    The ADC AINx  inputs must charge the internal 20pf capacitor and starts to sample when the SSIO is enabled. Conversion only occurs after Trigger Processor is initiated or an interrupt (IE) ends the configured SSIO step. Please be aware there is a AREF input  that can be connected to REF2033 precision reference current source, NOT an resistor divider between 3v3 and GND. 

    Check the datasheet electrical specifications for loading of AINx inputs.

     

  • Hi BP101,

    Sorry... My description is causing your misunderstanding.
    Now we would like to turn on the reference current 2.4uA("SD14RBEN = 0x01") and enable ADC0 at the same time.
    But the reference current 2.4uA will be turn off when ADC0 enabled.
    Could you know how to turn on the reference current and enable ADC0 at the same time?

    Thanks.

  • Hello Allen,

    sorry for the delayed answer, but as Ralph wrote it was a kind of communication problem on my side.

    I just check your observation regarding the reference current provided at the resistive bias interface. The current source is only enabled when also the belonging ADC channel is selected. Because the device was developed for battery operation, the current source is disable when not in use to extend the battery life. That should be stated in the TRM but it seems it wasn't.

    Did you manage to solve your problem with the conversion times and inconsistent ADC values? I did not saw a setup of the clock system in your code but assume that you posted just the SD14 part.

    Best regards,

    Helfried

  • Hi Helfried,

    1. The 12-bit ADC0 value is work fine. But 12-bit ADC conversion time is 128ms. This is different from what I measured.

    2. You mean if the reference current from ADC1 channel, and then we change to ADC0 channel, the reference current will be turn off, right?

    Thanks.

  • Hi Allen,

    1. I did a test on my side with your supplied code and added the clock settings. I was able to measure the correct 128ms for 12bit CIC . What I did is, I set the interrupt delay to 0, mean interrupt after first conversion and set to single conversion instead of continuous conversion. I let this running in a loop. For the clock setting I used ACLK for the SD14. ACLK is set to VLO (256kHz) divided by 4 in the clock system und divided by 32 in the SD14 module which results in the needed 2kHz clock for the SD14.

    2. Yes, that is correct understanding, the reference current will be turned off when selecting a different channel.

    Best regards,

    Helfried

  • Hi Allen,

    Oddly this post had TM4C1294 MCU listed when I replied.