7 years ago.

SPI1 has no SCK signal. ST Nucleo F103RB. Hoping it is not a dodgy processor.

Hi all I have been playing with an Arduino Ethernet shield,http://arduino.cc/en/Guide/ArduinoEthernetShield, with a W5100 chip. I imported an example web page server program, http://mbed.org/teams/IPN-ESIME-ZACATENCO/code/Embedded_web_wiznet/, and changed the pins for the SPI and the CS and reset, SPI spi( PA_7,PA_6, PA_5);. Unfortunately it did not work so I took a look at the signals on the SPI pins. I could see that there was data streaming out of the MOSI1 but nothing coming back on the MISO1, also I could see that there was no signal at all on the SCK1, explaining why the shield was not responding. I did these experiments.

1. I removed the shield and ran the code. I could see exactly the same SPI behaviour, this indicated that the shield was not shorting/draining the SCK1. 2. I changed the main program and redirected the pins to the SPI2, SPI spi(PB_15,PB_14, PB_13);. Looking a these pins the SCK2 worked as expected. 3. I wrote a tiny program to reassign the SCK1 pin as a normal pio out and alternate its state high and low. This worked as expected. This suggests the SPI driver (assuming on the STM) is not working. 4. Also I set up the SPI driver independently for SPI1 and just ran a write in a loop sending out random data. I could see the data on MOSI1 but nothing on SCK1. So this indicates there is not a problem with the WizInterface.

So I have two possible conclusions, either the STM chips SPI1 driver hardware is broken or the SPI driver for this chip is not setting it up correctly for this STM chip. Is there anybody who knows a soft resolution to this problem before I send the Nucleo back please? Mark

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F103RBT6 microcontroller.

I have solved the SCK1 problem. The original code I imported had this at the top of it DigitalOut led(LED1); I assume it was a remnant of a blinky program. Unfortunately the LED on this board is shared with the SCK1(PA12) so the SPI could not grab it for its purposes. I removed the line from the code, compiled and the SCK1 jump into life. I now have what looks like a synchronous MOSI1 and CLK1, but the shield is still not responding... any ideas?

posted by Mark Norman 03 Dec 2014

Ah ha should have read this.. Notes

Ethernet Shield from Seeed Studio is based on WIZ820io.

Note that this shield doesn't use the standard SPI pins, but relies on non-standard 6-pin SPI header located at the shield bottom. To make it work you will have to bridge those pins as shown on the image (the green SPI pins).

Signal Pin 1 Pin 2 MOSI D11 SPI4 MISO D12 SPI1 SCK D13 SPI3

Comms going on now, still not broadcasting the correct ip address out, but thats another issue. Mark

posted by Mark Norman 03 Dec 2014
Be the first to answer this question.