LPC55S69 : GPIO pin state

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC55S69 : GPIO pin state

281 Views
Senior Contributor I

Hi !

It is not so clear if it possible to read set state of GPIO pin what is configured as output.

I can configure Pin to output and set it to High level. But if due external shortcut, this pin is connected to ground,

by use PIN register I will read 0 state even I set it to 1.

From what GPIO register I can read output value if pin what was really set by software, but not real state what is on that pin ( e.g. as it read if it input ?)

Regards,

Eugene

Labels (1)
0 Kudos
6 Replies

50 Views
NXP TechSupport
NXP TechSupport

Hi, Eugene,

Even if you set the GPIO pin as OUTPUT mode, you can read the pin logic. For example, if you output HIGH logic, the pin will be high, you read the pin as 1, if you output LOW logic, the pin will be LOW, you read the pin as 0.

But if you output HIGH logic and you short the pin to GND, you read the pin as 0 rather than 1, because what  you read is the PIN logic state. I think it is  impossible to get the output setting in output register.

Hope it can help you

BR

XiangJun Rong

0 Kudos

50 Views
Senior Contributor I

Hi xiangjun.rong‌ !

I find out that GPIO controller is fully reset while it in PowerDown mode.

As results all pins start to be inputs. Even this is not mentioned directly in UM.

It means I should backup DIR and SET registers of each port and restore it after that.

I assume that DIR have valid info about direction and SET about pins what are set to 1.

Is this right assumption ?

Or should backup/restore more  registers and do more complex combination of those ?

Regards,

Eugene

0 Kudos

50 Views
NXP TechSupport
NXP TechSupport

Hi, Eugene,

You are right, in the Power-down mode and deep-Power_down mode, the GPIO output mode for the GPIO pin is reset and the GPIO pins become input mode, the GPIO direction register loses it's setting. Because the waking-up after deep-power-down mode follow up Reset procedure, the GPIO can reinitialize, so no problem. But for the power-down mode, because the GPIO output pins become input mode after waking-up from deep-Power_down mode, the GPIO OUTPUT pin can not restore automatically, in the case, I suppose that you have to reinitialize the GPIO direction register after the instruction of the POWER_EnterPowerDown() function.

Hope it can help you

BR

XiangJun Rong

50 Views
Senior Contributor I

Hi xiangjun.rong‌ !

Thank you for good answer !

I can see DIR loze state for sure, but SET is looks like in place. ( IOCON remains as well.)

+Port0 DIR - 0x0, PIN - 0x6000107C, SET - 0x0, CLR - 0x0
+Port1 DIR - 0xD0, PIN - 0x402D0, SET - 0x2104, CLR - 0x0   // 3 LEDS on EVK is configured as output
----
-Port0 DIR - 0x0, PIN - 0x6000107C, SET - 0x0, CLR - 0x0
-Port1 DIR - 0x0, PIN - 0x2D0, SET - 0x2104, CLR - 0x0

Do you think I can restore DIR only or SET must be returned back as well ?

Why this issue is not so clear from UM  ?

From there we can impression that GPIO belong to domain what is retained .

Regards,

Eugene

0 Kudos

50 Views
NXP TechSupport
NXP TechSupport

Hi, Eugene,

As you said that the UM of LPC55S6x has little information about the subject that what registers are influenced by the power-down mode, so I do not know if the GPIO set register are reset. So I suggest you reinitialize all the GPIO register after waking-up.

BR

Xiangjun rong

0 Kudos

50 Views
Senior Contributor I

Hi xiangjun.rong‌ !

But does it possible to request info from central office ?

I think GPIO lines are most important peripheral.

Looks like if MCU in Powerdown mode it is not possible to drive LEDs what require few mA at low state.

And it very important issue.

Regards,

Eugene

0 Kudos