LPC824 PIO0_4 floating input and WAKEPAD_DISABLE register

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC824 PIO0_4 floating input and WAKEPAD_DISABLE register

769 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by joepbrown on Mon Apr 27 11:11:39 MST 2015
I'm trying to use PIO0_4 as a GPIO to detect if the pin is high or low. I have an external 1M pulldown resistor and want to use the pin as a floating input. I've tried many things but can't seem to disable the internal pullup on PIO0_4 so the pin is stuck high.  Furthermore PIO0_4 looks like, by default, it is configured as the WAKEUP pin but the documentation seems inconsistent.

Here's a few things I've tried to make the pin a floating input:

[list]
  [*]Setting the pin as an input (which I thought was the default IO state for most pins) with
Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT,0,IOCON_PIO4);

  [*]Disabling the pullup with
Chip_IOCON_PinSetMode(LPC_IOCON,IOCON_PIO4,PIN_MODE_INACTIVE);

  [*]Explicitly disabling the WAKEUP pad with
Chip_PMU_SetPowerDownControl(LPC_PMU,PMU_DPDCTRL_WAKEPAD);

[/list]

None of this allows the pin to float and it is still pulled high.

When I read Table 63 (DPDCTRL register description) in the manual it says:


Quote:
WAKEUP pin disable. Setting this bit disables the wake-up pin, so it can be
used for other purposes.

Remark: Never set this bit if you intend to use a pin to wake up the part from
Deep power-down mode. You can only disable the wake-up pin if the
self-wake-up timer is enabled and configured.

Remark: Setting this bit is not necessary if Deep power-down mode is not
used.

0 Enabled. The wake-up function is enabled on pin PIO0_4.
1 Disabled. Setting this bit disables the wake-up function on pin PIO0_4.

Reset value: 0



But when I'm connected to the device the reset value is 1(disabled) not 0. So I'm not really sure if the WAKEUP is enabled or disabled by default, or what I need to do to disable it, or if I even need to disable it.

Does anyone know how to make PIO0_4 a floating input?

标签 (1)
0 项奖励
回复
1 回复

564 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by joepbrown on Mon Apr 27 13:23:47 MST 2015
After a couple hours of debugging I've finally realized the IOCON clock needs to be enabled to change pin modes. I got the pin to float with the following:

    Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
    Chip_IOCON_PinSetMode(LPC_IOCON,IOCON_PIO4,PIN_MODE_INACTIVE);


There should really be a Chip_IOCON_Init() and Chip_IOCON_Deinit() function in LPCOpen.
0 项奖励
回复