• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Wemos D1 mini hardware SPI not working

Status
Not open for further replies.

Pommie

Well-Known Member
Most Helpful Member
I recently got hold of a 32x8 LED display that uses 4 MAX7219 chips to control it (US$5 of ebay). I connected this to an Arduino nano and wrote some scrolling message code. This used the hardware SPI on the Nano. I then switched to a Wemos board and wired up the SPI to the standard Wemos SPI pins - nothing. I checked the CS and this was working as expected (done in software so not surprising). I checked the MOSI and CLK pin and they don't have any signal whatsoever. As an experiment I wrote some simple bitbang routines and it all works as expected.

Anyone know how the Wemos hardware SPI differs from other Arduino boards? I read somewhere that the ESP8266 has two hardware SPI modules and wonder if somehow I'm using the wrong one. I could stay with the software solution but would prefer hardware. The bitbanging is lightening quick with a 80MHz processor anyway.

The default pins are,
MOSI D7
CLK D5
CS D8

Thanks

Mike.
Edit, maybe this should be in the Arduino forum.
 
Last edited:

Nigel Goodwin

Super Moderator
Most Helpful Member
I've got a Wemos Mini happily feeding a row of MAX7219's, I simply downloaded the ready made file.

These are the pin connections:

// LED Matrix Pin -> ESP8266 Pin
// Vcc -> 3v (3V on NodeMCU 3V3 on WEMOS)
// Gnd -> Gnd (G on NodeMCU)
// DIN -> D7 (Same Pin for WEMOS)
// CS -> D4 (Same Pin for WEMOS)
// CLK -> D5 (Same Pin for WEMOS)

So same, apart from the CS pin - which can be any pin.
 

Pommie

Well-Known Member
Most Helpful Member
Nigel, do you have a link to the code that you downloaded?

I'm certain it is my code as bitbanging proves my hardware and connections are correct - just no idea why my code is wrong.

The problem with Arduinos is that everything seems to be hidden in some never to be found library. If I search for the spi file I get loads of files and absolutely no idea which one is actually being included.

Mike.
 

be80be

Well-Known Member
Maybe this will help It under your esp install hard to find I use a portable install that puts my file where I no where there at
If you install as portable it don't put the crap all over the hard drive plus them hiding files LOL
And you can set it up for ESP then have one for sam arm stuff and then the plain avr .

I started doing it that way cause I have stuff working then spend week finding what happen
when add boards breaks stuff.
 

Attachments

Last edited:

Pommie

Well-Known Member
Most Helpful Member
Thanks for that Burt.

Worked out what the problem was. For some reason, I was setting pin 13 to output on the Nano. On the ESP it needs to be set as SPECIAL to use the spi.

I new it would be something silly.

Mike.
Edit, pin 13 is the LED on the Nano.
 
Last edited:

dr pepper

Well-Known Member
Most Helpful Member
I had a real hard time with a d1 r1 now obsolete with the same thing, found out the pin numbers are confusing, the number of the pin on board is not the i/o number.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top