SPI communication, clocking data from a Slave device

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SPI communication, clocking data from a Slave device

1,300件の閲覧回数
DannyP
Contributor I

Hi,

 

I have been working on the SPI bus on the MC9S08. The writing to the slave works, whereas I am having a few problems with the reading part.

I see the command I send to the slave to go to read mode correctly sets the MISO line low and it is waiting for the SPI clock to spit out some data.

My question therefore is quite simple: Is it correct that to generate the SPI clock for every byte on I want to receive, I have to write a dummy byte into the SPID register and send it? I can't seem to find another way to generate the SPI clock.

 

Thanks in advance for any hints

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,009件の閲覧回数
bigmac
Specialist III

Hello, and welcome to the forum.

 

Refer to one of the posts within this recent thread for a basic SPI master communications code example.  It provides a single function that is capable of both send and receive SPI operations.

 

Regards,

Mac

 

0 件の賞賛
返信

1,009件の閲覧回数
rocco
Senior Contributor II

Hi Danny,

 

Welcome to the forum.


. . . Is it correct that to generate the SPI clock for every byte on I want to receive, I have to write a dummy byte into the SPID register and send it?

Yes.

0 件の賞賛
返信