freetronics / DMD2

Beta release of a new Dot Matrix Display Arduino library
http://forum.freetronics.com/viewtopic.php?f=26&t=5893
GNU General Public License v3.0
80 stars 71 forks source link

ESP8266 Support #7

Closed h4rm0n1c closed 9 years ago

h4rm0n1c commented 9 years ago

SoftDMD is not included, yet, but otherwise this is feature complete. (I've used a preprocessor statement to disable SoftDMD on the ESP8266)

All demo sketches compile and execute as they were meant to, the only change needed being changing SoftDMD to SPIDMD.

The #define ESP8266_TIMER0_TICKS in DMD2_Timer.cpp sets the delay between running scan_running_dmds via timer0 interrupt in microseconds, the default I've set is 1000, seems to work well with 4mhz SPI clock, which is also a default.

Why timer0? Because the ESP8266 has no hardware PWM, so the ESP8266/Arduino project is using timer1 for software PWM, a.k.a analogWrite. The only other ESP8266 library that currently uses timer0 is for Servo control, the likelihood that someone will use servos with a DMD is low compared to wanting to be able to adjust DMD brightness.

How to connect: You'll probably want to use a level shifter, I used a TXS0108E that worked quite well. I imagine some 7400 and 4000 series chips that have been used in such a way before could also be substituted.

Pin on DMD GPIO # on ESP
a GPIO16
b GPIO12
sck GPIO0
clk GPIO14
r GPIO13
noe GPIO15

One more thing: The kinds of frequencies everything is required to run at to make this work probably doesn't lend itself too well to a solderless breadboard, my ESP8266 is on a soldered breadboard and it works pretty well, but sometimes it hiccups due to the capacitance between the tracks on the board, people are welcome to try, but I thought you should know the potential risks of using a solderless breadboard.

EDIT: Swapped GPIO15 from sck to noe, swapped GPIO0 from noe to sck, I apologise for the change, putting noe on gpio15 (which is held low for the ESP8266's boot mode) keeps the DMD from displaying garbage while the ESP8266 boots.

See https://github.com/esp8266/Arduino for more details.

projectgus commented 9 years ago

Thanks heaps for this, sorry for the ridiculously long time to reply - this got stuck down my TODO list.

It's now merged, I added some notes in the README about using w/ ESP8266 and also tagged a new 0.0.3 version so it should become available in the Board Manager shortly.

mohitsachan33 commented 7 years ago

Thank you very much but one problem is there when we want to display any string its possible but when we go for scrolling the string then after 10 to 12 sec its shows stack overflow. plz help me how to remove this error.

herrysugiharto commented 6 years ago

Hi, I tried your instruction but the text not displaying correctly. Could you tell me what's wrong? esp8266-p10-error

ghost commented 6 years ago

DMD2 is great working for ESP8266/nodeMCU. you just initialize/define PIN on ESP8266

define pin_A 16

define pin_B 12

define pin_sclk 0

define pin_clk 14

define pin_r 13

define pin_noe 15

define DISPLAYS_WIDE 1

define DISPLAYS_HIGH 1

SPIDMD dmd(DISPLAYS_WIDE, DISPLAYS_HIGH, pin_noe, pin_A, pin_B, pin_sclk); // DMD controls the entire display

because ESP8266 PIN's is default set on LOW

CTWF commented 6 years ago

@mohitsachan33 try to scroll text without space @h4rm0n1c new update dmd2?

masrodjie commented 6 years ago

Hi @helmisusanto thanks for the update. Did you use level shifter?

ghost commented 6 years ago

are you mean p10 with 2 rows?

you need using 2 esp8266 for row 1 and row 2.

PIN OUT first ESP full with first panel p10.

CTWF commented 6 years ago

how can i change the size panel inside loop?

MohamadAlsadi commented 5 years ago

hello my friends

I have 2 module p10 (64x16 screen) I need drive it with NODE MCU ESP32 not ESP8266

please help me

id1402 commented 1 year ago

How to connect: You'll probably want to use a level shifter, I used a TXS0108E that worked quite well. I imagine some 7400 and 4000 series chips that have been used in such a way before could also be substituted. Pin on DMD GPIO # on ESP a GPIO16 b GPIO12 sck GPIO0 clk GPIO14 r GPIO13 noe GPIO15

I have a question on connection DMD---ESP8266 (Here is my ESP8266: https://circuit-diagramz.com/wp-content/uploads/2018/11/ESP8266-12e-Pinout-12.jpg ). My DMD doesn't have Pins "sck", "clk" and "noe" as you mention above. Here is my DMD pinout: OE A N B N C N S N L N R N G N D

So what pins are "sck", "clk" and "noe"? And what about the 7 N-Pins? Should I connect the to GND? Please help.

id1402 commented 1 year ago

I figured out how to connect DMD---ESP8266.

DMD_pin_R --- GPIO13 (SPI MOSI) DMD_pin_S --- GPIO14 (SPI SCLK) DMD_pin_N --- GND

You can connect the following DMD-pins to GPIO-pins you like, but you must define them in your code as helmisusanto wrote on Feb 11, 2018. For Example: DMD_pin_OE --- GPIO15 DMD_pin_A --- GPIO16 DMD_pin_B --- GPIO12 DMD_pin_L --- GPIO5

According code:

#define DMD_pin_OE 15
#define DMD_pin_A 16
#define DMD_pin_B 12
#define DMD_pin_L 5
#define DISPLAYS_WIDE 1
#define DISPLAYS_HIGH 1
SPIDMD dmd(DISPLAYS_WIDE, DISPLAYS_HIGH, DMD_pin_OE, DMD_pin_A, DMD_pin_B, DMD_pin_L);

Good luck!

radoslawkozuch commented 1 year ago

Do I need a logic level shifter? As I checked, the DMD is able to receive a 3.3V signal (A, B, three SPI lines), but of course the OE has smaller value so the DMD is a bit dimmer, but I don't need a super bright display.

id1402 commented 1 year ago

Works well for me without level shifter. No level shifter mentioned here: https://cdn.shopify.com/s/files/1/0045/8932/files/DMD_Getting_Started.pdf https://cdn.shopify.com/s/files/1/0045/8932/files/DMDCON_DMDConnector.pdf

radoslawkozuch commented 1 year ago

Works well for me without level shifter. No level shifter mentioned here: https://cdn.shopify.com/s/files/1/0045/8932/files/DMD_Getting_Started.pdf https://cdn.shopify.com/s/files/1/0045/8932/files/DMDCON_DMDConnector.pdf

But in your links they use 5V Arduino. This thread is about 3.3V ESP

id1402 commented 1 year ago

Yes, OK, sorry. I begun with NodeMCU 1.0 without level shifter. Now I use Arduino because I have a more ambitious project, I need more GPIO-Pins than NodeMCU 1.0 has.

radoslawkozuch commented 1 year ago

Actually I am not using a NodeMCU, but an ESP32 S2 mini with 27 IO pins. It works with this library but some changes were needed.

RakaMulya commented 1 year ago

Actually I am not using a NodeMCU, but an ESP32 S2 mini with 27 IO pins. It works with this library but some changes were needed.

can you explain the detail ??

helmiattastify commented 1 year ago

I think everyone should move to another library

https://github.com/busel7/DMDESP

I try to use dmd2 for advanced code like adding mqtt, mdns, and making it more readable, but DMD2 always makes my nide mcu keeping hard restart

I tried to change to DMDESP everything works fine.

RakaMulya commented 1 year ago

I think everyone should move to another library

https://github.com/busel7/DMDESP

I try to use dmd2 for advanced code like adding mqtt, mdns, and making it more readable, but DMD2 always makes my nide mcu keeping hard restart

I tried to change to DMDESP everything works fine.

Hi Helmi, is it also work for ESP32 ?

helmiattastify commented 1 year ago

https://github.com/jenizar/esp32-p5-rgb-32x64-ntp-clock

vovella commented 1 year ago

I think everyone should move to another library

https://github.com/busel7/DMDESP

I try to use dmd2 for advanced code like adding mqtt, mdns, and making it more readable, but DMD2 always makes my nide mcu keeping hard restart

I tried to change to DMDESP everything works fine.

Note - If you have 3 rows, the second one will be reversed!