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
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
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.