cmarrin
Posts: 23
Joined: Sat Sep 15, 2018 7:19 pm

Trouble with SPI

Tue Oct 30, 2018 3:22 pm

I'm trying to get SPI0 working. I've looked at several examples, most notably dwelsh's SPI02 example. I can compile and run his example, connect my RPi Zero to a Wemos D1 mini running the SPISlaveTest sample and they will talk to each other. But the driver I wrote (based mostly on the example in the Circle repo) nothing works. When starting to send the CS register has a value of 0xb0 and it never changes. That value seems odd. It's the value I'm writing to CS to start (TA on, clear both FIFOs). But the documentation says that bits 4 and 5 should always read as 0.

I tried doing the exact sequence of initialization as the spi02 example. I even copied the single byte write from that example into my code, but it doesn't work.

Any ideas where I might be going wrong?

cmarrin
Posts: 23
Joined: Sat Sep 15, 2018 7:19 pm

Re: Trouble with SPI

Tue Oct 30, 2018 3:27 pm

Ugh. That was quick. Please disregard this question. The fact that CS was giving back an "impossible" result got me thinking and sure enough, I had the wrong base address for the SPI registers.

Sorry for the noise

Return to “Bare metal, Assembly language”