How to use PIO0_13 and 18 for GPIO

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

How to use PIO0_13 and 18 for GPIO

跳至解决方案
791 次查看
brant
Contributor I

Hi,

I am using both the 48 pin and 64 pin version of the LPC1549 in a design and trying to setup PIO0_13 and PIO0_18 for GPIO to control other hardware.  Looking into Board_Init() in LPCOpen I noticed that it is trying to control those two pins and make use of them for UART0 based debug.  So I disabled that code and instead just init the GPIO subsystem instead with  Chip_GPIO_Init(LPC_GPIO);

My main issue is getting PIO0_13 and PIO0_18 unstuck, even when avoiding the Board_Init() code.  I need to use these pins for external hardware.  They seem to be stuck high no matter what I've tried so far. 

I am easily able to change the pin start of other pins such as PIO0_1, PIO0_2, PIO0_7 for example so I don't suspect anything related to the code doing the state change, just something is missing in the configuration allowing those pins to be software controlled like the others.

What am I missing?

Thanks

标签 (1)
1 解答
623 次查看
brant
Contributor I

I was able to make PIO0_13 and PIO0_18 work just fine as GPIO lines.  The answer lies in the UM10736 manual in chapter 8 regarding the SWM. 

The answer lies in the PINASSIGN0 register by putting that register in reset I was able to get those lines to function as GPIOs

//snip

LPC_SWM->PINASSIGN[0] = 0xFFFFFFFF; //reset UART0, to reconfigure pin 13 and 18.

I'm leaving this here for future travelers.  Read chapter 8, know thy chip!

在原帖中查看解决方案

2 回复数
624 次查看
brant
Contributor I

I was able to make PIO0_13 and PIO0_18 work just fine as GPIO lines.  The answer lies in the UM10736 manual in chapter 8 regarding the SWM. 

The answer lies in the PINASSIGN0 register by putting that register in reset I was able to get those lines to function as GPIOs

//snip

LPC_SWM->PINASSIGN[0] = 0xFFFFFFFF; //reset UART0, to reconfigure pin 13 and 18.

I'm leaving this here for future travelers.  Read chapter 8, know thy chip!

623 次查看
soledad
NXP Employee
NXP Employee

Thank you for your input. 

Regards

Sol 

0 项奖励