Hello everyone, I'm trying to make a simple communication from raspberry pi3 to arduino pro micro using SPI.
I realized a golang program to send over SPI the word "ciao" and a script to read it and print onto serial for arduino.
I tried with both arduino UNO and arduino Pro Micro:
with arduino UNO all works as it should and i receive the message
with arduino Pro Micro nothing happens.
The circuit diagram for arduino Pro Micro is attached.
Also the Raspberry pi3 is not 5v tolerant and the Uno puts out 5v signals. You are probably cooking the Ras pi protection diodes.
Do you have the 3.3v or 5v version of the Pro Micro?
mikb55:
Also the Raspberry pi3 is not 5v tolerant and the Uno puts out 5v signals. You are probably cooking the Ras pi protection diodes.
Do you have the 3.3v or 5v version of the Pro Micro?
I am not sending anything to the raspberry, SCLK is generated by raspberry, MOSI should be from raspberry and i plan to remove the MISO wire, should it be ok this way?
markd833:
You seem to be missing a wire. SPI requires MOSI, MISO, SCK, SS and a common ground.
Is SS necessary even with just one slave? I didn't see it googling arouund for similar projects, but of course I'm happy to hear that! Where should it be wired?
However the reason why arduino UNO works instead remains a mistery...
But first of all, thank you for the answers! (I answered in the wrong order LOL)
The SS signal frames the serial data and resets the shift register in the receiving device.
From the 328P datasheet (19.3.1):
The SS pin is useful for packet/byte synchronization to keep the slave bit counter synchronous with the master
clock generator. When the SS pin is driven high, the SPI slave will immediately reset the send and receive logic,
and drop any partially received data in the Shift Register.
Yeah, but meanwhile I read this SS pin on Arduino Pro Micro board - Microcontrollers - Arduino Forum
It seems that SS pin is not wired to the header on Pro Micro, so it can't be a slave.
For this reason I'll try to set it up as the master and raspberry pi will be the slave, basically I think that it shouldn't be any big difference doing this way.
Anyway, now I think I must add resistors to each of the wires from arduino to raspberry pi 3, making some kind of voltage divider, is it right?