LPC824 SWDIO pin causing issue when set to GPIO Output High

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

LPC824 SWDIO pin causing issue when set to GPIO Output High

3,737 次查看
sibinthomas
Contributor I

Hello Everyone,

I am using lpc824 (lpc824M201JDH20J) controller on my custom board and I am trying to set the PO_2 (SWDIO) as GPIO output and P0_3 (SWCLK) as GPIO input pins. My board is powered with 2.8V supply with 47K pullup on the RESET. I have disabled the default function of SWDIO and SWCLK using the switch matrix. I have three leds connected to output pins (P0_1, P0_8 and P0_9). On startup, just after configuring these pins and making P0_2 High, in my while loop i am reading the status of the input pin (P0_3) and toggling the leds.

The problem is when I make PO_2 high and if i reset the controller 2 or 3 times my other pins are not getting configured properly. Like LEDs (P0_8 and P0_9) not going high and low and my input P0_3 is always reading low. but LED P0_1 is working. This issue happens only when i configure P0_2 as output and high and do reset few times. The code is working as expected if my P0_2 is output and low. I am attaching my code where if PO_2 is made high this problem occurs and if P0_2 is low everything works. Is there any problem with the P0_2 (SWDIO) making output and high? Why on several reset the pins are not getting configured properly? Any suggestion would be helpful.

Thanks.

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

3,308 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Sibin Thomas,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Workaround:
After disabling the default SWD functions of the P0_2 and P0_3, you should remember pull-down the P0_4 to the low state prior to resetting the MCU, after that, release the P0_4.
Please give a try.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

3,309 次查看
sibinthomas
Contributor I

Thanks for your reply.
I was unable to sort out the issue even after doing the changes you insisted. I would also like to inform that there are no external Pull up/Pull down resistors on any of the RST,ISP,SWDIO,SWCLK pins.
Is using the SWDIO & SWCLK as an GPIO function causing this problem?

0 项奖励
回复

3,308 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Sibin Thomas

1) Is using the SWDIO & SWCLK as a GPIO function causing this problem?
-- Yes, there's a bug in the chip and the corresponding workaround is shared before.
Note: In the workaround, reset the MCU via the reset pin.
My colleague and I have both validated the workaround with LPCXpresso LPC824 board.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

3,308 次查看
sibinthomas
Contributor I

Hi jeremyzhou,

Thank you for your support.

I am trying the workaround you suggested, just after the disabling SWD functions I am enabling the internal pull-down using the IOCON function.

Then I am configuring SWD pins as GPIOs (P0_3 input and P0_2 output high). After this in my while loop I am toggling my three leds (P0_8, P0_9, P0_1). Still my problem happens after few resets. Am I missing something or should I connect an external pull-down on P0_4 ?

Is this bug and workaround has been documented anywhere. If it is available can you please provide the link, because I couldn't find this issue in Errata sheet of lpc82x.

Thanks.

0 项奖励
回复

3,308 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Sibin Thomas,

The errata hasn't included the bug now, however, this bug had already been confirmed by IP design team.
To avoid triggering this 'bug', the P0_4 need to be pulled down on reset, just as same as pull down the ISP pin to force the MCU to enter the ISP mode.
I was wondering if you can record a video of the testing process, maybe I can find what step you miss.

Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

3,308 次查看
sibinthomas
Contributor I

Hi jeremyzhou,

Thanks for the Quick Reply.

Do you mean to pull down the P0_4 externally, Or only the internal Pull down can Solve this issue?

Thanks,
Sibin Thomas

0 项奖励
回复

3,308 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Sibin Thomas,

Thanks for your reply.
1) Do you mean to pull down the P0_4 externally?
-- Yes, it needs to pull down the P0_4 externally.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复