w80x_arduino icon indicating copy to clipboard operation
w80x_arduino copied to clipboard

SPI issues

Open RudolphRiedel opened this issue 1 year ago • 5 comments

I am just playing with a W806 board and SPI. I intend to look deeper but this is what I found now.

I have this little sketch: #include <Arduino.h> #include <SPI.h>

#define EVE_CS PB10 #define EVE_PDN PB11

void setup() { pinMode(EVE_CS, OUTPUT); digitalWrite(EVE_CS, HIGH); pinMode(EVE_PDN, OUTPUT); digitalWrite(EVE_PDN, LOW);

SPI.begin(); /* sets up the SPI to run in Mode 0 and 1 MHz */ SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0)); }

void loop() { delay(2);

digitalWrite(EVE_CS, LOW); SPI.transfer(0x55); SPI.transfer(0xaa); SPI.transfer(0x55); digitalWrite(EVE_CS, HIGH);

digitalWrite(EVE_CS, LOW); uint32_t buffer = 0x55aa55aa; SPI.transfer(&buffer, 3); digitalWrite(EVE_CS, HIGH); }

And this is what I get in the logic analyzer: grafik

So well, on a quick glance everything is working, there are a couple of issues though.

  • the frequency of that SPI is not 8 MHz, it is 1MHz.
  • the pause between the single byte transfers is over 7µs
  • MOSI behaves a bit odd, like the default seems to be low but sometimes it goes high

grafik grafik grafik

I'll have a look to see what can be done about this.

RudolphRiedel avatar Aug 06 '23 14:08 RudolphRiedel