Hi,
I would like to use one NHS3100 pin as a open-drain output:
State 1:
low active, pin internally connected to GND
State 2:
high impedance, pin floating
A short code snippet is appreciated! Are there limits to pins that can be used?
BR
Till
Hi Till,
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!
Best Regards,
TIC weidong sun
Hi Wigros,
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?
Have a nice day!
BR
Till
Hi Till,
No that's not possible. When the direction is switched, the current state on the line will be maintained. That cannot be overridden. You'll need to issue two commands, unfortunately.
Is this is a problem for you? Perhaps there is another way out? Can you explain?
Best,
Dries.
Hi,
thank you for your reply. I found a Hardware workaround for my application.
BR
Till