Closed microbit-carlos closed 11 months ago
Just to clarify - this is that the HIGH
voltage is not reaching 3v3.
I've not been able to test this yet, but does this also happen if we use an edge connector pin in capacitive sensing mode, or is it just the logo that is affected?
No sorry, that will be covered in:
This is that running uBit.touchSensor.removeTouchButton()
doesn't always have the same result.
Together with setDigitalValue(1)
then pin voltage either goes to the expected 3.3V ✅, or it goes down to V1.7 ❌
Should this actually be the case? Technically as we don't track the pin state on anything other than the pin peripheral itself, by removing the touch sensor we're getting into an undefined state.
We could proactively set the pin high or low, but we can't possibly know what the application requriements are for this, so is it better to leave this as it is, and require that if applications need a pin to be in a specific state after removing touch sensing they should actively drive high or low?
Removing the touch sensor should leave the pin in whatever is the default state for any other digital pin, no? How are the "normal" digital pins configured on startup?
Thanks folks. I've looked into this - the issue was coming from the NRF52TouchSensor not letting go of the NRF52 GPIOTE channels when a button is disconnected.
I've run a fair few tests, including the ones listed above. This should now be fixed in main branches of the codal-core and codal-nrf52.
Okay, we can close this one as fixed! 🎉
When a pin is registered as a TouchButton and it is set as digital output high, the voltage on the pin is less than Vin. For example, when USB connected and the MCU is running at 3.3V, setting
uBit.io.logo.setDigitalValue(1)
produces ~2.6V on the pin instead of 3.3V. This is lower than expected voltage issue is reported in:Using
TouchSensor::removeTouchButton()
should technically remove the touch functionality from the pin. By doing so, it should be back to normal, so when setting it as digital output high, the pin should reach the 3.3V again. However, with this example programme we can see that is not always the case.Button A sets the pin logo high, and button B runs
removeTouchButton()
. To run this test we need a voltmeter to measure the voltage in the face logo.isTouched()
MICROBIT.hex.zip