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: It has voltage drop when do ADC sampling on Pin0.4

Part Number: CC2530

Hi,

CC2530,Z-STACK2.5.1a

IO configuration code:

  P0DIR&=~0X3F;

  P0SEL|=0X3F;  

  APCFG = 0x3F;  

Do 3 times ADC sampling at 1 second interval.

It has obvious voltage drop when do ADC sampling on P0.4. But it has't voltage drop if sampling on other Pins such as P0.5. Voltage always keep at high level. What's the reason?

Voltage sampling circuit

  • Hi

    Is there any comments?

    I find it call HalAdcRead (uint8 channel, uint8 resolution) to do ADC conversion. It disable ADC function by set it to GPIO in HalAdcRead() function. 

    /*Disable channel after done conversion*/
    ADCCFG &= (adcChannel ^ 0xFF);

    If we disable ADCCFG &= (adcChannel ^ 0xFF); no voltage drop happens again. 

    My question is why it has voltage drop on P0.4, it has no voltage drop on P0.0 and P0.5 even don't disable ADCCFG &= (adcChannel ^ 0xFF);?

    Is there some internal difference on P0.4 and P0.5&P0.0? Thanks.

  • Sorry, already find the root cause.
    It's caused by GPIO wrong setting.