Change SWD pins to GPIO at runtime in LPC800

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change SWD pins to GPIO at runtime in LPC800

1,235 Views
hakankaracay
Contributor I

Hello

I want to use 20 TSSOP pin new LPC802 series and my pin requirements are not enough.

only way to use 20 pin package is to change SWD pin to GPIO at runtime,

I found below explanation at user manuel of LPC800 but I wonder if there is an ready example code for this

7.3.3 Changing the pin function assignment Pin function assignments can be changed “on-the-fly” from one peripheral to another while the part is running. To disconnect a peripheral from the pins and change the pin function assignment, follow these steps: 1. Enable the clock to the switch matrix. 2. Find the pin assign register for the current pin function. For example, register PINASSIGN0 for pin function U0_RXD. 3. Set the corresponding bits in the PINASSIGN register to their default value 0xFF. 4. Clear all pending interrupts for the disconnected peripheral and ensure that the peripheral is in a defined state. 5. In the pin assign register for the new pin function, program the pin number. 6. Disable the clock to the switch matrix

0 Kudos
Reply
1 Reply

887 Views
soledad
NXP Employee
NXP Employee

Hi,

Could you please confirm the device you are using?

Please check the below example:
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); // enable the clock to the switch matrix
Chip_SWM_DisableFixedPin(SWM_FIXED_SWCLK);//Disable SWDCLK pin in PIO0_3  PINENABLE0 register.
Chip_SWM_DisableFixedPin(SWM_FIXED_SWDIO);//Disable SWDIO pin in PIO0_2   PINENABLE0 register
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);//Disable the clock to the switch matrix


Have a great day,
Sol

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

0 Kudos
Reply