Hi,
During usecases debug, I found the KW38 chip board can not communication with NCJ38A by SPI interface. Current the SPI config is using SPI0(0x4002C000u), master mode, clock freq is 500kHz, 8bits/frame, MSB first, blocking transfer data using polling. I check the sending data already in PUSHR, but the reading data is 0xFF. Can you help point it out which SPI parameter configuration is incorrect in KW38 chip board?
Hi Eduardo
I am use the KW38 + NCJ29D5D, and I use SPI to communication between them, but KW38 fail to write data to NCJ29D5D,
There exsist the best practice demo?
Did this issue already resolved yet? I got a same issue,I used the FRDM-KW38 and use the SPI demo and I can get the successful result between the 2 boards.but when I change the SPI1 to SPI0, and GPIO
CLOCK_EnableClock(kCLOCK_PortC);
/* PORTC16 (pin 45) is configured as SPI0_SCK */
PORT_SetPinMux(PORTC, 16U, kPORT_MuxAlt2);
/* PORTC17 (pin 46) is configured as SPI0_SOUT */
PORT_SetPinMux(PORTC, 17U, kPORT_MuxAlt2);
/* PORTC18 (pin 47) is configured as SPI0_SIN */
PORT_SetPinMux(PORTC, 18U, kPORT_MuxAlt2);
/* PORTC19 (pin 48) is configured as SPI0_PCS0 */
PORT_SetPinMux(PORTC, 19U, kPORT_MuxAlt2);
Then, Master can not communication with Board B, any demo for change SPI1 to SPI0, I cost too much time on it
I'm very sorry. I haven't solved it yet. I can not provide further assistance.
Thanks for your reply, I have resolved it, Just the slave device need 16bit and 1MHz clock, I changed the master's setting and it works well now
Hello @lfl
Hope you are doing well.
Just co confirm, are you using a custom board or is it a FRDM-KW38 development board?
By any chance, is your project based on any of the SPI driver example projects (included in driver_examples > dspi) from the KW38 SDK? If that is not the case, are you using any other demo application from the SDK as base for your development?
Could you please share your SPI pins initialization/configuration? Also, maybe it would be helpful if you could provide a capture of the data exchange using a logic analyzer/oscilloscope.
Regards,
Eduardo.
Hello Zamora,
Thanks for your reply.
Current use the FRDM-KW38 development board and run the demo SDK of ncj38a_KW38_**** example project.
The SPI pins configuration(pin/port/pin_addr/pin_idx) is default as follows:
SPI_SI /PORTC17 (number 46) /0x4004B000u /17U
SPI_SCK/PORTC16 (number 45) /0x4004B000u /16U
SPI_CS /PORTA19 (number 07) /0x40049000u /19U
SPI_SO /PORTC18 (number 47) /0x4004B000u /18U
The sending data and reading data is ok in the loopback mode in FRDM-KW38 development board. Whether the parameter of SPI0_CS(0 or 1), clock freq(500kHz or 24MHz), CPOL/CPHA(b00, b01, b10 or b11) is not right? Whether need any additional configurations?
Hi,
I sent you a private community message.
Regards,
Eduardo.
Hi Eduardo,
OK. Thanks for your reply again.