How can I set a NHS3100 GPIO pin to open-drain mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I set a NHS3100 GPIO pin to open-drain mode

1,386 Views
tillostermann
Contributor II

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

0 Kudos
Reply
4 Replies

1,205 Views
weidong_sun
NXP TechSupport
NXP TechSupport

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 

pastedImage_2.png

Have a nice day!

Best Regards,

TIC weidong sun

1,205 Views
tillostermann
Contributor II

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 level
The rules show that the pins mirror the current logic level. Therefore floating pins may
drive 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

0 Kudos
Reply

1,205 Views
driesmoors
NXP Employee
NXP Employee

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.

1,205 Views
tillostermann
Contributor II

Hi,

thank you for your reply. I found a Hardware workaround for my application.

BR

Till

0 Kudos
Reply