cancel
Showing results for 
Search instead for 
Did you mean: 

SPC560B50L1_SPI_Configuration

baskar
Associate II
Posted on July 19, 2016 at 08:54

We are using SPI0 in our application and its connected to two device chip  as follows:

1. CS0 - PA15

2. CS1 - PB12

Please tell give the steps to configure the SPI using spc5 studio with 2 chip selection for data transmit and receive.

9 REPLIES 9
procolo
Senior
Posted on July 19, 2016 at 11:14

Hi,

As a starter point, you can import the DSPI test application for Bolero B using the wizard.

It configure and uses pins for DSPI0 using variuos configurations.

If any other further question, do not hesitate to contact us.

Regards,

Procolo

baskar
Associate II
Posted on July 19, 2016 at 12:56

Thank you very much ,i got sample code  and need one more help to configure two chip selection pin with continuous mode.

1. CS0 - PA15

2. CS1 - PB12

procolo
Senior
Posted on July 19, 2016 at 13:06

Hi,

you should create two configurations.

in both you should select the mode Hardware(continuos), while you should select respectively PCS0 and PCS1 in the PCS line field.

Remember to correclty configure the pin in PINMAP wizard.

Regards,

Procolo

baskar
Associate II
Posted on July 20, 2016 at 09:11

Thank you very much for your support,

The chip selection is working,but i found one problem in the spi MOSI transmission.

We are sending 0x00,0x00  using spi_lld_exchange function for reading.but in the MOSI line we are getting like 0x01,0x01.

zambrano.luigi
Senior III
Posted on July 20, 2016 at 15:24

Hi,

we have verified with our test application SPC560BCxx_RLA DSPI Test Application, that you can select from the Application Wizard (magic wand icon), that the MOSI is to 0x0 when you transfer the byte 0x0 by using the spi_lld_exchange function. If you have a different behavior, the issue could be in the SPI PIN configuration. Could you share you SPI PIN configuration (content of the I/O settings tab in the Board Component)?

Regards,

Luigi

baskar
Associate II
Posted on July 21, 2016 at 11:03

This is the pin configuration of spi

static const spc_siu_init_t spc_siu_init[] = {

  {PCR(PORT_A, PIN_LED0),   PAL_LOW,    PAL_MODE_OUTPUT_PUSHPULL},

  {PCR(PORT_A, PIN_SIN),    PAL_LOW,    PAL_MODE_INPUT},

  {PCR(PORT_A, PIN_SOUT),   PAL_LOW,    PAL_MODE_OUTPUT_ALTERNATE(1)},

  {PCR(PORT_A, PIN_SCK),    PAL_LOW,    PAL_MODE_OUTPUT_ALTERNATE(1)},

  {PCR(PORT_A, PIN_CSACC),  PAL_LOW,    PAL_MODE_OUTPUT_ALTERNATE(1)},

  {PCR(PORT_B, PIN_UART0TX), PAL_LOW,    PAL_MODE_OUTPUT_ALTERNATE(1)},

  {PCR(PORT_B, PIN_UART0RX), PAL_LOW,    PAL_MODE_INPUT},

  {PCR(PORT_B, PIN_CSFLASH), PAL_LOW,    PAL_MODE_OUTPUT_ALTERNATE(3)},

  {PCR(PORT_C, PIN_INT2),   PAL_LOW,    PAL_MODE_INPUT},

  {PCR(PORT_C, PIN_INT1),   PAL_LOW,    PAL_MODE_INPUT},

  {-1, 0, 0}

};

zambrano.luigi
Senior III
Posted on July 21, 2016 at 13:50

Hi,

please, could you also provide me the value of the macros PIN_SIN, PIN_SOUT, PIN_SCK and PIN_CSACC? Moreover, could you provide me the version of SPC5Studio that you are using? 

Best Regards,

Luigi 

baskar
Associate II
Posted on July 22, 2016 at 11:05

Thank very much spi is working.

I corrected the hardware continuous mode and it is working 

zambrano.luigi
Senior III
Posted on July 22, 2016 at 12:23

good news! 

Please, feel free to contact us for any kind of support. 

Regards,

Luigi