SPI 8-bit register master and 16-bit register slave

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

SPI 8-bit register master and 16-bit register slave

1,858 Views
vignesh_vb_7
Contributor IV

I want to interface KEA-128 with KIT07XS6517EVB  (MC07XS6517) -SPI SLAVE.Since The KEA-128 registers has 8-bit 8 bit registers for SPI and MC07XS6517 are having 16 bit registers for SPI i am facing problems.Can anyone share me the base code for this?  

0 Kudos
2 Replies

1,128 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Vignesh,

As you have said that the SPI of KEA can only use 8 bits width to transfer data as a master, but the MC07XS6517 can only use 16 bits to transfer data as slave. But I think you can have SPI of KEA to transmit two bytes while the CSB pin of MC07XS6517 is low.

I think you can use one GPIO pin of KEA128 rather than /SS pin of SPI  to connect the CSB so that you can  select the MC07XS6517. As you know, when /SS pin can function as "automatic SS output", I do NOT suggest you use the mode, because the "automatic SS output" can only select one byte automatically rather than multiple byte.

You can clear the CPOL and set the CPHA bit based on the required timing of MC07XS6517. Before you write/receive data, you can clear a GPIO which will select the MC07XS6517, then write data to the data register, I suggest you use interrupt or polling mode to write or receive data. If you use interrupt mode, you can read data in the ISR of SPI receiver, the reading will clear the SPRF bit in SPI_S register. Then you can  write the second data to SPI_D register, in the ISR of SPI receiver, read the second data,  set the GPIO, has a delay. It is okay.

Hope it can help you

BR

Xiangjun Rong

0 Kudos

1,128 Views
vignesh_vb_7
Contributor IV

Hi xiangjun.rong ,

I got your idea.Can you help me by providing me a sample code ?

0 Kudos