no GPIO functionality for PIO0_11 to PIO0_14

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

no GPIO functionality for PIO0_11 to PIO0_14

1,257 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LpcWare159 on Wed Jan 07 05:51:30 MST 2015
Hi all.

I'm using the LPC11U68 Xpresso v2 board to read the pin state of PIO0_14. It always reads zero while the pin is pulled high externally and measures +3.3V. If I do the same with PIO0_9, it works fine and the MCU detects the level change. PIO0_11 to PIO0_14 are configured to use their dedicated function 1, according datasheet. It seems the GPIOs are working op port0 except for PIO0_11 to PIO0_14. Is there anything else to setup specifically for these pins other than this code?

<code>
int main(void)
{
    Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 9, IOCON_MODE_INACT | IOCON_FUNC0);
    Chip_GPIO_WriteDirBit(LPC_GPIO, 0, 9, false);
    Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 14, IOCON_MODE_INACT | IOCON_FUNC1);
    Chip_GPIO_WriteDirBit(LPC_GPIO, 0, 14, false);
    while(1)
    {
        if(Chip_GPIO_ReadPortBit(LPC_GPIO, 0, 14))
        {
            Board_LED_Set(1, true);
        }
        else
        {
            Board_LED_Set(1, false);
        }

        if(Chip_GPIO_ReadPortBit(LPC_GPIO, 0, 9))
        {
            Board_LED_Set(2, true);
        }
        else
        {
            Board_LED_Set(2, false);
        }

    }
}
</code>
标签 (1)
0 项奖励
回复
4 回复数

1,194 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LpcWare159 on Thu Jan 08 05:44:35 MST 2015
The force has been with me. This pin has analog functionality as well, it needs IOCON_DIGMODE_EN.

Thanks!
0 项奖励
回复

1,194 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Jan 07 23:48:56 MST 2015
Did you try to use Digital mode and internal pull-up already?
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 14, IOCON_MODE_INACT  | IOCON_FUNC1 |  IOCON_DIGMODE_EN   );
0 项奖励
回复

1,194 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LpcWare159 on Wed Jan 07 23:23:33 MST 2015
IOCON P0-14 0x40044038 = 0x1
IOCON P0-9 0x40044024 = 0x0
DIR[0] 0xA0002000 = 0x80
PIN[0] 0xA0002100 = 0xFF04F7

Pulling PIO0_14 high -> PIN[0] 0xA0002100 = 0xFF04F7
Pulling PIO0_9 high -> PIN[0] 0xA0002100 = 0xFF06F7
0 项奖励
回复

1,194 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Jan 07 20:58:29 MST 2015
What's the debugger telling you about IOCON setting and pin direction / status?
0 项奖励
回复