I need help!
On SPI protocol in slave mode, after some time (5-10min) the byte that i received from master is corrupt, data on logic analyzer shows correctly.
After i try to send a byte to master, the spi interface becomes unresponsive, but the rest of code works.
I tested with 2 maple mini boards, one in master mode and the other in slave, they seems to work ok, but doesn’t work with the other cpu i described above.
I’m trying to split apart the mainboard cpu from a display with keypads. After using the logic analyzer i assumed that the comunnication protocol is SPI, i have a single data line (receive-transmit), clock line, chip select and a key request line that goes high when a key is pressed. Package size is one byte (8bits) and SPI mode/phase is 1,1 sor spi_mode_3
For writhing code i use leaflab ide, the green one…
On arduino uno, the program runs correctly
in my case the spi master (cpu) sends the clock, not the slave
… or i’m doing something wrong
MM is the Slave
Old_CPU is the Master? Is the old_cpu 3.3V SPI signaling?
Maple Mini (Master) – Display with keypad (Slave) SPI 1 – this one works perfectly
Old cpu is 5V and i use a logic convertor from 5v to 3.3v
I’m trying to place Maple Mini between Cpu and Display
What kind of it do you use?
i think is a sparkfun clone, or someting…
http://www.stm32duino.com/viewtopic.php … =10#p13036
I will post the code i use after i get back from work
How do you differentiate between spi.read and spi.transfer?
Actually, when receiving SPI data, some data will be anyway read out from the master, and if you don’t set it, random data may disturb your spi master.
Here we see pullups on both sides, but this is because it is a bi-directional level-shifter, such as I2C.
When used as uni-directional, only the receiver side requires a pullup.
The board you are using has 4 times the schematics I’ve provided, there is no need for those series resistors.
But, you can also use an GPIO attached to RES and trigger it from software.