This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GPIO Current Drive

My application uses the nRF51822 with a GPIO configured as output and another GPIO is configured as input. Connected to the GPIO_OUT is a resistive load (Rload) which then connected to GPIO_IN. When GPIO_OUT drives a '1' and if the load has low resistance, we would expecte a '1' at GPIO_IN.

GPIO_OUT ------------------ Rload -----------------------GPIO_IN 

Per spec, the VDD is 3.3V.

With GPIO_PIN_CNF_DRIVE is set to S0S1, the spec say this would drive 0.5mA. The max Rload measdured to be around 6K ohm.

When GPIO_PIN_CFG_DRIVE is set to H0H1, we get the same result.

I would expect the high-drive to allow for more resistance on the load. 

Is this correct? Why would the S0S1 and H0H1 have the same result?

  • So are you actually trying to measure the resistance, then?

    Or just detect whether the chemical is present ("low" resistance) or not ("high" resistance)?

  • Just detect whether chemical present/not present.

  • So you want to detect whether the resistance is "high" (1M) or "low" (20k)

    The arrangement you showed will not do that.

    What you need is a potential divider, and user either the ADC or Comparator to look at the voltage and, thus, decide whether the resistance is "high" or "low".

  • Are you suggesting to use the GPIO as analog with the LPCOMP logic? I came to that conclusion as well. If that is the case, can you give/point to more details on how to set it up?

  • Yes.

    I would read the section on the comparator in the Product Specification, and then look for an example in the SDK examples.

    Note that the nRF51 chips are not recommended for new BLE designs.

1 2 3