Page 1 of 1

DMD library, RTC and Ethernet with Arduino Uno?

Posted: Tue Jun 23, 2020 7:21 am
by dogank
Hello:!: :!: :!: ,

I am using DMD library and also ds1307. It works with I2C protocol. I am going to use ethernet to communicate with dmd p10 panels. As i read, people says different things. It works or not works.

I am not using DMD2 library. I am using DMD library. Can i use ethernet module + dmd panel + rtc? with arduino uno. I will use ENC28J60 Ethernet - LAN module (its image: I am worried about conflict of dmd and ethernet because both of them use spi and arduino uno has only one spi. I can not be able to change dmd pins to Analog pins because A4 and A5 pins are connected to I2C that i use.


Re: DMD library, RTC and Ethernet with Arduino Uno?

Posted: Tue Jun 23, 2020 9:34 am
by Brissieboy
The DS1307 just uses I2C, the DMD library uses timerone and SPI, and they will play nicely together. The ENC28160 appears to use SPI as well but you will not be able to share the SPI buss as the DMD does not use a chipselect though the ENC28160 does. There may be options available to you for another SPI on the Uno such as this one.
No experience with the ENC28160 so there may be other conflicts as well.

Re: DMD library, RTC and Ethernet with Arduino Uno?

Posted: Fri Jun 26, 2020 8:19 am
by dogank
I can't see anything on the dmd panel when i add ethercard code. Without ethernet i can type something on dmd p10 panels. Where is my mistake? At the ether.begin function i write 10 for spi chip select even thought i can't see any text on panels.

Code: Select all

#include <EEPROM.h>
#include <Wire.h>
#include "RTClib.h"
#include <SPI.h>       
#include <DMD.h>    
#include <TimerOne.h>  
#include <EtherCard.h>
#include <IPAddress.h>
#include "SystemFont5x7.h"
#include "Font_6x14.h" //-> This font only contains numbers from 0-9

#define DISPLAYS_ACROSS 2 //-> Number of P10 panels used, side to side.

//#define SPI_SS 10

int kAdres1=11;
String bb;
#define STATIC 1  // set to 1 to disable DHCP (adjust myip/gwip values below)

// Ethernet interface IP address
static byte myip[] = { 192,168,1,175 };
// Gateway IP address
static byte gwip[] = { 192,168,1,1 };
static byte mask[] = { 255,255,255,0 };
static byte dnss[] = {  192,168,1,1 };

// Ethernet MAC address - must be unique on your network
static byte mymac[] = { 0x70,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[500]; // TCP/IP send and receive buffer
// Callback that prints received packets to the serial port
void udpSerialPrint(uint16_t dest_port, uint8_t src_ip[IP_LEN], uint16_t src_port, const char *data, uint16_t len){
  IPAddress src(src_ip[0],src_ip[1],src_ip[2],src_ip[3]);

  Serial.print("dest_port: ");
  Serial.print("src_port: ");

  Serial.print("src_ip: ");
  Serial.println("data: ");

  char textToSend[] = "AABBCCDDEEFFGGHH";
  ether.sendUdp(textToSend, sizeof(textToSend), src_port, src_ip, dest_port );

RTC_DS1307 rtc; //-> RTC Declaration

char msg1[]="HELLO";
char data[] = "HELLO HELLO";
void ScanDMD() { 
void setup() {

  ether.begin(sizeof Ethernet::buffer, mymac, 10);
  // Change 'SS' to your Slave Select pin if you aren't using the default pin
  if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
    Serial.println(F("Failed to access Ethernet controller"));
  ether.staticSetup(myip, gwip, dnss, mask);
  if (!ether.dhcpSetup())
    Serial.println(F("DHCP failed"));

  ether.printIp("IP:  ", ether.myip);
  ether.printIp("GW:  ", ether.gwip);
  ether.printIp("DNS: ", ether.dnsip);

  Register udpSerialPrint() to port 1337
//  ether.udpServerListenOnPort(&udpSerialPrint, 3000);

void loop() {
  dmd.drawChar(1,1,data[2] ,1,GRAPHICS_NORMAL); // bura bak