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.

CC2540 ADC conversion sequence and op amp

Other Parts Discussed in Thread: CC2530

If  APCFG = 0xFF ( all Port 0 I/O are analog ones) and the op amp is turned on through OPAMPC |= 0x01 , does this operation prevent from considering also AIN0, AIN1, AIN2 as ADC inputs in the setup of a conversion sequence ? That is : if I program ADCCON2.SCH = 7 , the conversion sequence comprises also op amp pins or not  (as would be logical) ?

  • I am afraid the sequence in this case also includes the op-amp input pins.

  • hec said:

    I am afraid the sequence in this case also includes the op-amp input pins.

    Hello Hec and thank you for your reply.

    So, we have to perform a sequence ADC conversion but we cannot do it automatically : some microcontroller instructions are needed.

    How can we handle potential conflicts with other microcontroller tasks (which incidentally are at a higher priority) ?

    Can we momentarily stop any other activity , do some operations for a very little time ( about 20 ms) and then restore all?

    Anyway, our costrain is that the ADC sequence shall be continued for a precise and specified conversion time.

     

  • hello, I have just finished the function of the ADC sequence plus DMA on the cc2530 plateform.

    Based on the post from Siri about cc1110  (http://e2e.ti.com/support/low_power_rf/f/156/t/143710.aspx#520330), 

    made a little modification , it works on the cc2530.

    8 channels ADC + DMA(channel 3)   ,  the whole process is hardware control .

    Just  need start it as below:

         // Start a conversion (ST = 1)

           ADCCON1 |= 0x40;

      the  conversion end is informed by the DMA interrupt . 

    The conversion is instant,  I have tried 4 channels and 8 channels , there is no significant difference in time.

    It took me much time at the beginning, for ADC sequence ,especially the DMA, few sample code  exist. 

    for example, happened to use the DMA channel 2, tried many times, it worked abnormally, turned to DMA channel 3 ,it was OK.

    So if consider the interference with other tasks,  maybe the DMA confliction is of one matter.

  • Hi Chen bono,

    Can you post the entire modified code that works on the CC2530 please? I am having trouble getting mine to work.