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.

CC2530 ADC calc

Expert 1205 points

Replies: 5

Views: 517

HI,


Please help me i am using CC2530 ADC but not getting correct values after conversion. Please find attached files used in program and results found.

0257.ADC calc.xls

2110.ADC.c

Regards

Sai

5 Replies

  • Hi,

    I reviewed your code and I noticed several things that must be corrected.

    Please use as reference http://www.ti.com/lit/pdf/swru191

    First of all, as explained in 12.2.5 of the user's guide, you should not truncate the digits of the MSB, rather you should get all the 14 bits of the results (MSB --> 8 bits, LSB(7:2)) and then truncate the last two bits of the result, eliminating the two least significant bits of the 16 bit word MSB LSB(7:2) to get the effective 12 bit conversion of the result.

    In your code, it seems instead you are truncating the most significant bits.

    As mentioned also in 12.2.7 of the same guide, the reference clock system should be 32 Mhz using an external oscillator.

    While you are setting your clock configuration to be using an external 32 Mhz crystal and an internal 32 Khz RC OSC, in the clock status register you are checking if the internal 16 Mhz RC OSC is active.

    Also, I think selecting the system clock should be the first thing you do in your code, and not late when you are calling the uart() function to configure the pins as UART pins.

    I would encourage you to look at some reference code in Z-stack, for instance HAL_BOARD_INIT to learn how to properly configure system clock settings and the hal_adc.c module to see an implementation of the ADC driver.

    Thanks,

    TheDarkSide

    If my post answers your question, please click on "Verify Answer" button to benefit others who have the same issue

  • In reply to TheDarkSide:

    Hi Dark Side ,

    I want to implement an Application that supports multiple profiling, That's Why I want to purchase CC2538 till now, I was using CC 2530 but due to its its constraint of not supporting multiple Profiling I need to switch to some other Version, So, I want to know CC2538 supports Multiple Profiling?,If yes then please let me know, As I have to purchase and start my development further]

    I have already sent you the friend request, and Mailed at technical support please let em know

    thanks & regards

    Manish

  • In reply to TheDarkSide:

    I agree with TheDarkSide.

    Please have a look at our foundation software offering, its open source and free to use on our devices. There is a wealth of information in there about how to get started using this device.

    http://www.ti.com/tool/cc2538-sw

    Regards,
    /TA

    ---------------------------------------------------------------------------------------------------------
    Please click the Verify Answer
     button on this post if it answers your question.
    ---------------------------------------------------------------------------------------------------------

  • In reply to manish kumar4:

    Manish Kumar, 

    I am not sure what "Multiple Profiling" mean. Please start a new thread, because if you just append yourself to a different thread like this we will likely not find your question.

    Regards,
    /TA

    ---------------------------------------------------------------------------------------------------------
    Please click the Verify Answer
     button on this post if it answers your question.
    ---------------------------------------------------------------------------------------------------------

  • In reply to TA12012:

    Hi,

    i responded to the original thread on multiple profile (http://e2e.ti.com/support/wireless_connectivity/f/158/t/251234.aspx)

    I apologize for the delay.

    As TA12012 suggests, please try not to append a different topic to an existing thread so the threads stay 'on topic'.

    I understand you have been doing this in the first place, as you correctly opened the post on "multiple profile" and I apologize again for the delay, however I wanted to clarify this for the sake of clarity for you and the entire community that we are trying to help in using our parts.

    Thanks,

    TheDarkSide

    If my post answers your question, please click on "Verify Answer" button to benefit others who have the same issue

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.