I would like to use one NHS3100 pin as a open-drain output:
low active, pin internally connected to GND
high impedance, pin floating
A short code snippet is appreciated! Are there limits to pins that can be used?
Of all the 12 GPIOs in NHS3100, not every one can be configured as open-drain GPIO, you can read and check IOCON register, and you will find that only 2 pads for I2C can be configured as open-drain GPIO.
see um10876.pdf, please!
---IOCON register descriptions (base address 0x4004 4000)
You can download it from the link:
NHS3100: NTAG SmartSensor with Temperature Sensor and Digital IOs|NXP
Have a nice day!
TIC weidong sun
thank you very much for your reply. Indeed this fixed my problem. Unfortunately, I have another, similar issue:
I need to switch one GPIO pin from input to output, not mirroring the previous state. The User manual page 190 states:
The following rules apply when the pins are switched from input to output:•Pin is configured as input with a HIGH level applied:–Change pin to output: pin drives HIGH level•Pin is configured as input with a LOW level applied:–Change pin to output: pin drives LOW levelThe rules show that the pins mirror the current logic level. Therefore floating pins maydrive an unpredictable level when switched from input to output.
Is there a way to switch to the output without mirroring the previous state? Can I write GPIODATA and DIR in one command?
Retrieving data ...