SPI not works on LPC43S67

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

SPI not works on LPC43S67

954 Views
chuyuanchiang
Contributor I

I am using the LC43S67, and try to run the example code periph_ssp on mcuxpresso ide,

after I burn the binary to the target board, I can set the SPI mode and translate method over ttyACM (VCOM), 

that works, but there is not signals from SPI clock or MOSI (from J4 in target board).

Do I lost any configure for that?

Thanks,

ChuYuan

Labels (1)
Tags (1)
0 Kudos
7 Replies

717 Views
chuyuanchiang
Contributor I

yes, that is my original question, I used spi from J4, Do I lost any configure for that?

but it sees you are lost the target.

all right, by the way, it works now.

0 Kudos

717 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChuYuan,

   I didn't lost the target, just didn't connect the SPI slave, because your original question is MOSI don't have data, then I just test MOSI wave, it has data out.

  If you are using the same board as I, and if you have interest, you also can try J1 interface.

  J4 on my side is the USB port. I think your problem maybe caused by the hardware.

 Anyway, you already make SPI0 works.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

717 Views
chuyuanchiang
Contributor I

Hi Kerry,

I found the reason, the pin define code is dis-match between lpcopen sample code and lpcxpresso 43S67 board.

this issue is resolved after I get the reference manual from our agents. 

Thanks,

ChuYuan

0 Kudos

717 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChuYuan,

   The lpcopen code is defined like this:

void Board_SSP_Init(LPC_SSP_T *pSSP)
{
    if (pSSP == LPC_SSP1) {
        Chip_SCU_PinMuxSet(0x1, 5, (SCU_PINIO_FAST | SCU_MODE_FUNC5));  /* P1.5 => SSEL1 */
        Chip_SCU_PinMuxSet(0xF, 4, (SCU_PINIO_FAST | SCU_MODE_FUNC0));  /* PF.4 => SCK1 */

        Chip_SCU_PinMuxSet(0x1, 4, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC5)); /* P1.4 => MOSI1 */
        Chip_SCU_PinMuxSet(0x1, 3, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC5)); /* P1.3 => MISO1 */
        
        Chip_SCU_PinMuxSet(0x3, 1, (SCU_MODE_INACT | SCU_MODE_FUNC4));  /* P1.5 => SSEL1 */
        Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 8);
        Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 8, (bool) true);
    }
    else {
        return;
    }
}

So, you need to connect the according pins in the board.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

717 Views
chuyuanchiang
Contributor I

no, that not works,

I just use this and it works on J4 in my target board

else if (pSSP == LPC_SSP0) {
Chip_SCU_PinMuxSet(0x1, 0, (SCU_PINIO_FAST | SCU_MODE_FUNC5)); /* P1.5 => SSEL1 */
Chip_SCU_PinMuxSet(0x3, 0, (SCU_PINIO_FAST | SCU_MODE_FUNC4)); /* PF.4 => SCK1 */

Chip_SCU_PinMuxSet(0x1, 2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC5)); /* P1.4 => MOSI1 */
Chip_SCU_PinMuxSet(0x1, 1, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC5)); /* P1.3 => MISO1 */

Chip_SCU_PinMuxSet(0x3, 1, (SCU_MODE_INACT | SCU_MODE_FUNC4)); /* P1.5 => SSEL1 */
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 8);
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 8, (bool) true);
}

0 Kudos

717 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChuYuan Chiang,

   I have test the lpcopen ssp code directly on my LPCXpresso43S67 board, it works OK.

1. Board

  LPCXpresso43s67, REVB

2.lpcopen code

 https://www.nxp.com/downloads/en/software/lpcopen_3_01_keil_iar_nxp_lpcxpresso_4337.zip 

3. SSP1 pin

pastedImage_2.png

pastedImage_3.png

4. Test Result:

pastedImage_4.png

pastedImage_5.png

I didn't connect the SPI slave, so just MOSI have the data out.

The MOSI works ok on my side.

You modified the code, and you are using the SSP0 now, the lpcopen code are using the SSP1.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

717 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChuYuan,

   Please tell me what the board you are using, the full name of your board, and the full name of the code which you are using.

   Please check the code, what the detail SPI pin in the code, just make sure, the problem is not caused by the wrong spi testing.

  As I know, our lpcopen code for SPI works OK, I have test it before.

  If you still can't make it work, please give me the detail information.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos