About SPI for LPC552x

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

About SPI for LPC552x

跳至解决方案
610 次查看
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 项奖励
回复
1 解答
580 次查看
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 项奖励
回复
4 回复数
594 次查看
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 项奖励
回复
588 次查看
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 项奖励
回复
581 次查看
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 项奖励
回复
563 次查看
yuto
Contributor I
Hi, Harry

Thank you for your response.
I will check the sample as well.
0 项奖励
回复