K64 SPI0 Sout not Working

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

K64 SPI0 Sout not Working

553 Views
niranjanbc
Contributor IV

I have K64  SPI0 configured has Slave using Below PINs of Port A

PTA 14 - Slave Select

PTA 15 - SPI0 SCK

PTA 16 - SPI0 SOUT

PTA 17 - SPI0 SIN

 

using MQX OS

i am running the below code for SPI Transfer, I am able to receive(SIN) the data from Master.

But I dont see any data sent out of the SOUT. i have attached the Processor Expert screenshot for I/O's used and configured

 

/************************************************************************************/

 

void Task1_task(os_task_param_t task_init_data)

{

  /* Write your local variable definition here */

  uint8_t counter;

  for(counter =0;counter<200;counter++)

   txbuff[counter] = counter;

#ifdef PEX_USE_RTOS

  while (1) {

#endif

    /* Write your code here ... */

 

   // OSA_TimeDelay(10);                 /* Example code (for task release) */

   if(DSPI_DRV_SlaveTransferBlocking(dspiCom1_IDX,txbuff,rxbuff,200, OSA_WAIT_FOREVER)  ==          kStatus_DSPI_Success)

   {

    counter++;

   }

   

   

#ifdef PEX_USE_RTOS  

  }

#endif   

}

 

/*************************************************************************************************************************/

Labels (1)
0 Kudos
1 Reply

373 Views
isaacavila
NXP Employee
NXP Employee

Hello,

I suppose you are using another MCU as master, aren't you? Also, are you using a custom board?

I've made a simple test on TWR-K64F120M board (cannot use FRDM-K64F because PTA16 and PTA17 are used for Ethernet's PHY) and I configured TWR-K64F120M as SLAVE, I used same SPI pins that your configuration and another MCU as master. I could receive data on Master.

I can suggest to disconnect your SOUT and SIN pins from master and connect them each other (SCK and SLAVE select pins will be connected to master), this way, you must receive the data that you are trying to send to master. If after running this test you find that data is being sent/received correctly on slave, then probably there is an error on your connection to Master MCU.

Hope this helps!

Regards,

Isaac

0 Kudos