Hi,
I took two DEMO9S08GB60 boards and connected the MOSI/MISO/SS/SPSCLK and gnd wires together and started to play with your code.
I got the idea that you had mixed some of the signal names together, as I had to rewrite part of it.
However, I soon could send data from one MCU to another, and it worked just fine.
Well not all the time. Once the reception went wrong, it stayed wrong.
So I tried to use the /SS signal to tell the slave when a new byte of data was on its way.
But it turned out to be difficult in getting the /SS line to wiggle.
It seems that it wont go high until the line has been idle for at least one character transmission time.
So I changed that by pulling the I/O lines "by hand".
It seems to be working now.
The data transmitted was a string = "ABCD".
In your code you transmitted the received data from the SPI to the SCI.
As the SPI is generally far more faster than the SCI, that could also be one of the reasons why you got your problems.
I am including two photos. The top trace is the MOSI signal. The second is the /SS signal and the third the SPSCLK signal. The first photo shows what happens with the selector AUTOSLAVE set to TRUE.
In this case the SPI is taking care of the transmission. I had to add a delay between the characters in order to ever see the /SS signal go high.
On the second picture, I toggle the /SS signal by hand.
The pulses on the /SS are much shorter now.
To check what was received, you can stop the receiver and check the "error" counter.
It turned out to be 0 the last times I tried it.
The code was written in CodeWarrrior 6.1.
Hope this helps!
Regards,
Ake
Message Edited by t.dowe on 2009-10-27 12:54 PM