Hi,
yes ,I run the program what you said ,and use oscilloscope to monitor the output, through the oscilloscope can see the SCK clock only activates once.
Ok, strange. I assume by "activates once" you mean it only transistions once low-high-low.
Just as a sanity check, perhaps try:
#include "mbed.h"
SPI spi(5, 6, 7); // mosi, miso, sclk
DigitalOut cs(8); // cs
int main() {
while(1) {
cs = 0;
spi.write(0x53); // 01010011
cs = 1;
wait_us(2);
}
}
This adds an example of what would naturally be the chip-select signal (active low), and also make sure the data has lots of transitions rather than being all 1's, and repeats it all.
This should also give you a clear frame to work with on the oscilloscope; use the high-low chip select as the trigger, and frame it so you see the cs returning high, and then you should be able to probe the mosi (data) and sclk (clock) signals with another channel and see what is going on.
Report back on what you find out (take a photo of the oscilloscope if you want!), and if that still doesn't work, i'll get mine out too to do some testing!
Cheers,
Simon
Hi Guys,
I am having some problem with SPI interface, somehow SCK clock only activates once, anybody has any idea what has happened? or anyone has been having the similar problem before?
Thanks a lot.
SHF