AnsweredAssumed Answered

SPI Master Slave Query

Question asked by sudhir prabhu on Mar 11, 2013

Hi All,

 

I am using K60 Kinetis MCU in SPI Slave mode, i will be interfacing this with Microprocessor unit which acts as SPI master.

I have initialized SS1:SPI Slave_LDD using Processor Expert CPHA=1, CPHA=0 CS = ACTIVE LOW.


Attached Processor Expert file for SPI configuration reference

 

Slave Side

After calling the SS1_Init(NULL);

Data which i will be sending to SPI Master is sent to TXFIFO using following instruction followed by GPIO interrupt to Master

SPI2_PUSHR_SLAVE = 0x0A;

From the debugg mode i was able to see SPI2_TXFR0 buffer filled with value 0x0A

 

/*Interrupt Generation to Master CPU */

GPIO2_SetFieldValue(Led1Data, INTR, 0X1);

GPIO2_SetFieldValue(Led1Data, INTR, 0X0);


Master Side

SPI Master on receiving INTR initiates SPI read by sending dummy clock & de-asserting CS line depending on number of bytes i have to read. But i do not see any activity on MISO line and remains LOW. SPI master is configured to same CPHA & CPOL as that of slave

How do i read the data using my SPI Master from SLAVE's TX buffer? Does SPI master has to make any write before slave sends any data?


Thanks,

Sudhir

Original Attachment has been moved to: ProcessorExpert.pe.zip

Outcomes