About SPI for LPC552x

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

About SPI for LPC552x

Jump to solution
618 Views
yuto
Contributor I

I am using LPC552x series.
I am planning to use GPIO as SPI and connect to Flash ROM.
I want to connect two devices to the Flash ROM. Therefore, I want to make the SPI of the LPC552x as high impedance when it is not communicating so that the IO signals do not collide on the board.
Is it possible to set the output signal IO to high impedance when SPI communication is not used?

0 Kudos
Reply
1 Solution
588 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @yuto 

I think you can refer to the lpc55s28 gpio_led_output demo.

Harry_Zhang_0-1745480331037.png

When you want to disable SPI temporarily.

Reconfigure SPI pins.

gpio_pin_config_t spi_config = {
        kGPIO_DigitalInput,
        0,
    };
GPIO_PinInit(GPIO, APP_BOARD_TEST_LED_PORT, APP_BOARD_TEST_LED_PIN, &spi_config);

BR

Harry

View solution in original post

0 Kudos
Reply
4 Replies
602 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @yuto 

Yes, it is possible to configure the LPC552x GPIO pins (used for SPI) as high impedance (Hi-Z) when not actively communicating.

When SPI communication is not active, reconfigure the SPI pins as GPIO inputs. GPIO inputs are naturally high impedance.

BR

Harry

0 Kudos
Reply
596 Views
yuto
Contributor I
Hi, Harry

Thank you for your response.
Glad to hear that it can be GPIO when SPI is not active.
Can you give me a specific example (program code) to dynamically change the SPI and GPIO settings in a program?
0 Kudos
Reply
589 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @yuto 

I think you can refer to the lpc55s28 gpio_led_output demo.

Harry_Zhang_0-1745480331037.png

When you want to disable SPI temporarily.

Reconfigure SPI pins.

gpio_pin_config_t spi_config = {
        kGPIO_DigitalInput,
        0,
    };
GPIO_PinInit(GPIO, APP_BOARD_TEST_LED_PORT, APP_BOARD_TEST_LED_PIN, &spi_config);

BR

Harry

0 Kudos
Reply
571 Views
yuto
Contributor I
Hi, Harry

Thank you for your response.
I will check the sample as well.
0 Kudos
Reply