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 - floating pin detection

Other Parts Discussed in Thread: CC2530

Hi,

I'm trying to implement an application which detects if there is any external device/MCU connected to the P0 pins. If there is a device it is quite easy cuz there will be a certain voltage level on connected pins. 

But what in case if there is no device connected and pin is in "floating" state? Is there any way to detect it directly on CC2530 mcu? I tried to:

1. Set port as GPIO

2. Configure pulldown for pins (using P0INP register).

3. Used ADC to read voltage level. (As I assumed 0x00 will be considered as no device connected).

However ADC gives some random values (seems like pulldown is not configured when ADC is running - is that correct?).

Could you tell me how to detect floating pins? Is it possible without having an external resistor connected as a pulldown? If not then 1M Ohm would be good for pulldown?

Thanks for any help.

Best regards,

Lukasz Spas

  • This may be better in the MCU subforums since this has nothing to do with ZigBee or 802.15.4.

    Regardless is your "certain voltage level" high or low enough to be considered a 0 or 1 when reading a pins GPIO state (reference datasheet to determine the thresholds)?  If so I would disable the A/D on P0, configure either a pull-up or pull down and when the external device is plugged in it will reverse the polarity of the input configured GPIO.

    Need to make sure not too much current is being sourced or sinked via these internal pullup/pulldowns for risk of blowing these up.

  • You can't detect a floating pin without pull up or pull down resistor. If you want to use pull up or down resister, it is 4K7 or 10K in general.