Hello,
I'm using a LPCXpresso55s28 board and this is the first time I use an NXP board.
I'm using this board to communicate with an ADC converter via SPI protocol. The communication is working well and I can read/write registers of this external ADC.
In order to communicate, I'm using FLEXCOMM7 accessible from the P17 connector.
However, one of the functionalities of this board requires to identify if the MISO pin changes status and another functionality requires a change in the MOSI pins status.
I noticed I can't route an SPI pin together with a PIO pin, so I think that I can't manually handle GPIO_PinWrite() and GPIO_PinRead() on MOSI and MISO pins.
Is it correct? Is there a workaround to solve this?
Thank you.
解決済! 解決策の投稿を見る。
Hi,
I think it is okay to use FC7 as SPI master to communicate with external ADC.
This is the FC7 pin assignment:
PIO0_20 FC7_MOSI
PIO0_21 FC7_SCK
PIO0_19 FC7_MISO
PIO1_20 FC7_SSEL1
All of them are connected to P17.
Regarding the logic reading of the SPI signal pin, I suppose that you can read the GPIO input register directly even if the pin are assigned as SPI instead of GPIO pins.
Hope it can help you
BR
Xiangjun Rong
Firstly, I want to thank you for your answer.
I'd like to clarify that FLEXCOMM7 is as follows:
And it's accessible from the connector P17 too.
I configured these pins by using the Pins configurator of MCUXpresso IDE.
My doubt regards the possibility to read/write the status of MISO/MOSI respectively, in order to exploit some of the extra features of my external ADC, as well as the SPI communication.
EDIT: I'm using an AD7124-8 AD converter.
Hi,
I think it is okay to use FC7 as SPI master to communicate with external ADC.
This is the FC7 pin assignment:
PIO0_20 FC7_MOSI
PIO0_21 FC7_SCK
PIO0_19 FC7_MISO
PIO1_20 FC7_SSEL1
All of them are connected to P17.
Regarding the logic reading of the SPI signal pin, I suppose that you can read the GPIO input register directly even if the pin are assigned as SPI instead of GPIO pins.
Hope it can help you
BR
Xiangjun Rong
I made some tests using FC7.
So I can confirm what you said.
I used GPIO_PinRead() because it seems to read the GPIO input register, so I used this high level function.
HI,
Based on LPC5528-EVK board, you want to use the FLEXCOMM7 as SPI module.
This is the pin assignment:
PIO1_2 FC7_SCK
PIO1_3 FC7_MISO
PIO0_26 FC7_MOSI
PIO1_1 FC7_SSEL1
In the pin_mux.c in SDK project, I suppose you can add the api function so that you can configure the pin as FC7 SPI pin.
For the PIO1_1, when the func is 5, the pin will function as HS_SPI_SSEL1
So you can use the code to assign the FUNC as 5
#define IOCON_PIO_FUNC5 5
CLOCK_EnableClock(kCLOCK_Iocon);
const uint32_t port1_pin1_config = (/* Pin is configured as HS_SPI_SSEL1 */
IOCON_PIO_FUNC5 |
/* 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);
IOCON_PinMuxSet(IOCON, 1U, 1U, port1_pin1_config);
Pls follow up the above line to configure the other pins such as PIO1_2, PIO1_3 and PIO0_26
BTW, you can not use GPIO_PinWrite()/GPIO_PinRead(), they are used to write or read a pin logic only when you have configure the pin as GPIO function.
Hope it can help you
BR
XiangJun Rong