Pin Config tool not connecting the pins.

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

Pin Config tool not connecting the pins.

跳至解决方案
1,669 次查看
dodger741
Contributor II

I am new to mcuXpresso, and using an lpc55s69 demo board.  I am trying to configure the high speed spi and connect to some headers that are on the demo board.  I ran the config pins tool and updated the project.  It generates the following in BOARD_InitBootPins(void).  

/* clang-format off */
/*
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
BOARD_InitPins:
- options: {callFromInitBoot: 'true', coreID: cm33_core0, enableClock: 'true'}
- pin_list:
- {pin_num: '62', peripheral: FLEXCOMM8, signal: HS_SPI_MISO, pin_signal: PIO1_3/SCT0_OUT4/HS_SPI_MISO/USB0_PORTPWRN/PLU_OUT6}
- {pin_num: '60', peripheral: FLEXCOMM8, signal: HS_SPI_MOSI, pin_signal: PIO0_26/FC2_RXD_SDA_MOSI_DATA/CLKOUT/CT_INP14/SCT0_OUT5/USB0_IDVALUE/FC0_SCK/HS_SPI_MOSI/SECURE_GPIO0_26}
- {pin_num: '24', peripheral: GPIO, signal: 'PIO1, 8', pin_signal: PIO1_8/FC0_CTS_SDA_SSEL0/SD0_CLK/SCT0_OUT1/FC4_SSEL2/ADC0_4}
- {pin_num: '31', peripheral: CTIMER2, signal: 'MATCH, 0', pin_signal: PIO1_5/FC0_RXD_SDA_MOSI_DATA/SD0_D2/CTIMER2_MAT0/SCT_GPI0}
- {pin_num: '14', peripheral: SYSCON, signal: CLKOUT, pin_signal: PIO0_16/FC4_TXD_SCL_MISO_WS/CLKOUT/CT_INP4/SECURE_GPIO0_16/ADC0_8}
- {pin_num: '3', peripheral: GPIO, signal: 'PIO1, 24', pin_signal: PIO1_24/FC2_RXD_SDA_MOSI_DATA/SCT0_OUT1/SD1_D1/FC3_SSEL3/PLU_OUT6}
- {pin_num: '59', peripheral: FLEXCOMM8, signal: HS_SPI_SSEL1, pin_signal: PIO1_1/FC3_RXD_SDA_MOSI_DATA/CT_INP3/SCT_GPI5/HS_SPI_SSEL1/USB1_OVERCURRENTN/PLU_OUT4}
- {pin_num: '61', peripheral: FLEXCOMM8, signal: HS_SPI_SCK, pin_signal: PIO1_2/CTIMER0_MAT3/SCT_GPI6/HS_SPI_SCK/USB1_PORTPWRN/PLU_OUT5}
- {pin_num: '22', peripheral: GPIO, signal: 'PIO0, 15', pin_signal: PIO0_15/FC6_CTS_SDA_SSEL0/UTICK_CAP2/CT_INP16/SCT0_OUT2/SD0_WR_PRT/SECURE_GPIO0_15/ADC0_2}
- {pin_num: '27', peripheral: GPIO, signal: 'PIO0, 27', pin_signal: PIO0_27/FC2_TXD_SCL_MISO_WS/CTIMER3_MAT2/SCT0_OUT6/FC7_RXD_SDA_MOSI_DATA/PLU_OUT0/SECURE_GPIO0_27}
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
*/
/* clang-format on */


And as you can see it generates what I think are the correct instructions.  When I run the project and look at the SPI assigned pins on the board, they all appear to be high impedance inputs.  This was working at one point but now it isn't.  Seems like a simple problem to resolve but I have spent hours on this with no results.  Can someone tell me what is wrong??

0 项奖励
回复
1 解答
1,564 次查看
dodger741
Contributor II

Adding the function call BOARD_InitPins() is redundant because it is called from BOARD_InitBootPins().  I used the suggested example code as a model for the code I am using.  The API for writing to the spi is contained in another section of the project.  I have verified their are no signal outputs and the pins remain as default inputs.  One way to easily test this is to connect a scope to any of the SPI output pins and touch it with your finger.  If its still a default input pin it will oscillate slowly.  I have tried a second demo board with no improvement. I added a snippet of the SPI write API I am using at the bottom of the attached demo... .c file for easy verification.  Is the order of the initialization important??  I tried deleting all the other code in systemInit() leaving just the BOARD_InitBoot... files with no effect on my problem.  

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,565 次查看
dodger741
Contributor II

Adding the function call BOARD_InitPins() is redundant because it is called from BOARD_InitBootPins().  I used the suggested example code as a model for the code I am using.  The API for writing to the spi is contained in another section of the project.  I have verified their are no signal outputs and the pins remain as default inputs.  One way to easily test this is to connect a scope to any of the SPI output pins and touch it with your finger.  If its still a default input pin it will oscillate slowly.  I have tried a second demo board with no improvement. I added a snippet of the SPI write API I am using at the bottom of the attached demo... .c file for easy verification.  Is the order of the initialization important??  I tried deleting all the other code in systemInit() leaving just the BOARD_InitBoot... files with no effect on my problem.  

0 项奖励
回复
1,546 次查看
dodger741
Contributor II
Turns out I had a connection issue on the board. Thanks for your help and suggestions.
0 项奖励
回复
1,572 次查看
dodger741
Contributor II

Now I see that calling  BOARD_InitPins() from my application is redundant because it is called from  BOARD_InitBootPins which was already included in my application.  I initially had used your recommended example as a model for my code.   The API to transfer data is in another part of the code but  I have verified there are no outputs from the spi pins.  An easy way to confirm if the pin configuration is updated is to connect a scope to any of the spi outputs and touch it with your finger.  If the default configuration is still an input pin the scope waveform will oscillate because of the high impedance.  Also the SSEL pin (chip select) remains low and in a high impedance state. I added a snippet of the API to the attached .c file for testing.  Also note that I have tried a second demo board with no resolution of this problem.

0 项奖励
回复
1,622 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I have checked the LPC55S69_Project_LCD_Demo.c, but I do not see the code to initialize the high speed SPI pins configuration in the file.

Pls refer to the following code for the hs-spi pin configuration.

Hope it is helpful

BR

XiangJun Rong

 

void BOARD_InitPins(void)
{
/* Enables the clock for the I/O controller.: Enable Clock. */
CLOCK_EnableClock(kCLOCK_Iocon);

const uint32_t port0_pin26_config = (/* Pin is configured as HS_SPI_MOSI */
IOCON_PIO_FUNC9 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT0 PIN26 (coords: 60) is configured as HS_SPI_MOSI */
IOCON_PinMuxSet(IOCON, 0U, 26U, port0_pin26_config);

const uint32_t port0_pin29_config = (/* Pin is configured as FC0_RXD_SDA_MOSI_DATA */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT0 PIN29 (coords: 92) is configured as FC0_RXD_SDA_MOSI_DATA */
IOCON_PinMuxSet(IOCON, 0U, 29U, port0_pin29_config);

const uint32_t port0_pin30_config = (/* Pin is configured as FC0_TXD_SCL_MISO_WS */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT0 PIN30 (coords: 94) is configured as FC0_TXD_SCL_MISO_WS */
IOCON_PinMuxSet(IOCON, 0U, 30U, port0_pin30_config);

const uint32_t port1_pin1_config = (/* Pin is configured as HS_SPI_SSEL1 */
IOCON_PIO_FUNC5 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN1 (coords: 59) is configured as HS_SPI_SSEL1 */
IOCON_PinMuxSet(IOCON, 1U, 1U, port1_pin1_config);

const uint32_t port1_pin2_config = (/* Pin is configured as HS_SPI_SCK */
IOCON_PIO_FUNC6 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN2 (coords: 61) is configured as HS_SPI_SCK */
IOCON_PinMuxSet(IOCON, 1U, 2U, port1_pin2_config);

const uint32_t port1_pin3_config = (/* Pin is configured as HS_SPI_MISO */
IOCON_PIO_FUNC6 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN3 (coords: 62) is configured as HS_SPI_MISO */
IOCON_PinMuxSet(IOCON, 1U, 3U, port1_pin3_config);
}

0 项奖励
回复
1,610 次查看
dodger741
Contributor II

Thanks for the quick response... If this is what you meant, I added a call to BOARD_InitPins(); (line 137 of attached revised code) and also attached a copy of my pin_mux.c which has similar code to yours but still no effect.  

0 项奖励
回复
1,589 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I have checked your code LCD_Demo.c, but you do not call the api function to transfer any data, in detail, you do not write SPI->FIFOWR register, so it is impossible to see any waveform from SCK or MOSI in master mode.

Pls load the spi example and have a try. You can delete the DMA code and use only interrupt mode by changing the example

Hope it can help you

BR

XiangJun Rong

 

xiangjun_rong_0-1694509931210.png

 

0 项奖励
回复