Large Digit Driver

Does anyone know, how to code a ESP32 for using the Large Digit Driver?

It works with an external 12 V supply and a signal shifting from 5V to 3.3V but it is impossible to run the Arduino code provided due to failures in the memory blocks. An answer would be very helpfull because a Net research does not bring any useable results.

failures in the memory blocks.

Sounds like you need to replace your ESP32?

:slight_smile: No, it is a problem of the code. Not a hardwareproblem. Something is fundamentaly different with the ESP compared to the arduino.

Something like that:

19:29:55.584 → Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.

19:29:55.677 → Core 1 register dump:

19:29:55.677 → PC : 0x400d0cdf PS : 0x00060530 A0 : 0x800d1539 A1 : 0x3ffb1f80

19:29:55.770 → A2 : 0x3ffbdbb4 A3 : 0x3ffbdbb5 A4 : 0x3ffbfe90 A5 : 0x3ffbdbb6

19:29:55.864 → A6 : 0x00000008 A7 : 0x00000001 A8 : 0x800d0cdf A9 : 0x3ffb1f60

19:29:55.956 → A10 : 0x00000040 A11 : 0x00000000 A12 : 0x0800001c A13 : 0x00000003

19:29:56.049 → A14 : 0x00000003 A15 : 0x00000000 SAR : 0x0000001a EXCCAUSE: 0x0000001c

19:29:56.141 → EXCVADDR: 0x800d1539 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff

19:29:56.235 →

19:29:56.235 → ELF file SHA256: 0000000000000000

19:29:56.281 →

19:29:56.281 → Backtrace: 0x400d0cdf:0x3ffb1f80 0x400d1536:0x3ffb1fb0 0x40086155:0x3ffb1fd0

19:29:56.373 →

19:29:56.373 → Rebooting…

Something is fundamentaly different with the ESP compared to the arduino.

Well, both are MCUs. Other than that, your call.

Post the code that fails, using code tags, and a wiring diagram of your programming setup. The error message above could be caused by any number of mistakes.

I found this article to be useful in getting started with ESP32: https://dronebotworkshop.com/esp32-cam-intro/

@jremington:

/*

Controlling large 7-segment displays

By: Nathan Seidle

SparkFun Electronics

Date: February 25th, 2015

License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).

The large 7 segment displays can be controlled easily with a TPIC6C594 IC. This code demonstrates how to control

one display.

Here’s how to hook up the Arduino pins to the Large Digit Driver

Arduino pin 6 → CLK (Green on the 6-pin cable)

5 → LAT (Blue)

7 → SER on the IN side (Yellow)

5V → 5V (Orange)

Power Arduino with 12V and connect to Vin → 12V (Red)

GND → GND (Black)

There are two connectors on the Large Digit Driver. ‘IN’ is the input side that should be connected to

your microcontroller (the Arduino). ‘OUT’ is the output side that should be connected to the ‘IN’ of addtional

digits.

Each display will use about 150mA with all segments and decimal point on.

*/

//GPIO declarations

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

byte segmentClock = 6;

byte segmentLatch = 5;

byte segmentData = 7;

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

void setup()

{

Serial.begin(9600);

Serial.println(“Large Digit Driver Example”);

pinMode(segmentClock, OUTPUT);

pinMode(segmentData, OUTPUT);

pinMode(segmentLatch, OUTPUT);

digitalWrite(segmentClock, LOW);

digitalWrite(segmentData, LOW);

digitalWrite(segmentLatch, LOW);

int x = 0;

while(1)

{

if(x == 9)

postNumber(x, true); //Show decimal

else

postNumber(x, false);

digitalWrite(segmentLatch, LOW);

digitalWrite(segmentLatch, HIGH); //Register moves storage register on the rising edge of RCK

delay(500);

x++;

x %= 10; //Reset x after 9

Serial.println(x); //For debugging

}

}

void loop()

{

//showNumber(42); //Test pattern

}

//Takes a number and displays 2 numbers. Displays absolute value (no negatives)

void showNumber(float value)

{

int number = abs(value); //Remove negative signs and any decimals

//Serial.print("number: ");

//Serial.println(number);

for (byte x = 0 ; x < 2 ; x++)

{

int remainder = number % 10;

postNumber(remainder, false);

number /= 10;

}

//Latch the current segment data

digitalWrite(segmentLatch, LOW);

digitalWrite(segmentLatch, HIGH); //Register moves storage register on the rising edge of RCK

}

//Given a number, or ‘-’, shifts it out to the display

void postNumber(byte number, boolean decimal)

{

// - A

// / / F/B

// - G

// / / E/C

// -. D/DP

#define a 1<<0

#define b 1<<6

#define c 1<<5

#define d 1<<4

#define e 1<<3

#define f 1<<1

#define g 1<<2

#define dp 1<<7

byte segments;

switch (number)

{

case 1: segments = b | c; break;

case 2: segments = a | b | d | e | g; break;

case 3: segments = a | b | c | d | g; break;

case 4: segments = f | g | b | c; break;

case 5: segments = a | f | g | c | d; break;

case 6: segments = a | f | g | e | c | d; break;

case 7: segments = a | b | c; break;

case 8: segments = a | b | c | d | e | f | g; break;

case 9: segments = a | b | c | d | f | g; break;

case 0: segments = a | b | c | d | e | f; break;

case ’ ': segments = 0; break;

case ‘c’: segments = g | e | d; break;

case ‘-’: segments = g; break;

}

if (decimal) segments |= dp;

//Clock these bits out to the drivers

for (byte x = 0 ; x < 8 ; x++)

{

digitalWrite(segmentClock, LOW);

digitalWrite(segmentData, segments & 1 << (7 - x));

digitalWrite(segmentClock, HIGH); //Data transfers to the register on the rising edge of SRCK

}

}

Wiring is fine. If not wired, just the USB connected, same error mode. Thanks for help!

If not wired, just the USB connected, same error mode.

Try uploading the LED blink code to see if the ESP32 is working correctly.

Yes, it is. I tried several different types of ESP all showed the same error code.

So problem solved. I changed the pins from 6 5 7 to 16 17 and 18 and it worked…

I soldered my large digit driver boards to my 6.5" 7 segment displays yesterday. Today I notice the suggestion that I should have applied tape to the back side of the driver boards before I soldered them on.

I’m curious as to what I should do now? Should I use them without the tape or attempt to remove the driver boards, install the tape and then attempt to resolder them to the segment displays? Is there any other way to prevent the potential contact short of removing the board and applying tape? This seems like a poor design where the customer needs to use tape.

Try sliding a sheet of paper behind the board, that should be enough. The paper / tape is just precautionary in case the solder mask gets damaged in the installation process. You don’t want 12 volts accidentally coming in contact with the 5 volt side of the board.

As far as bad design, it’s the chinese display that’s poorly designed and not the driver board. None of the traces on the display are insulated.

That it’s tape isn’t important; it’s the insulation or separation. Depending on how the soldering went, the slip of paper mentioned might slide in (and stay!). The boards may flex open a bit with some gentle manipulation. If they’re already too snug, you could cut a piece of thin plastic (or perhaps cardboard/cardstock) and see if the extra rigidity lets you wedge it through. Looking around my desk, the transparent clamshell dealies from my berries (blue & straw) look like ideal donors for some thin flat sheet.

Yes, I understand. I’m wondering if I would remove the solder from the tack points if this would allow me access to slip in some type of separator. Maybe I was over critical of the design but I was disappointed that there was no documentation in the package that suggested that this might be an issue.

tedbear:
Yes, I understand. I’m wondering if I would remove the solder from the tack points if this would allow me access to slip in some type of separator. Maybe I was over critical of the design but I was disappointed that there was no documentation in the package that suggested that this might be an issue.

I don’t think Sparkfun includes documentation with any of their products. They do provide online documentation. I imagine it helps keep costs lower.

https://learn.sparkfun.com/tutorials/la … okup-guide

You are likely correct. Guess it was my mistake. This is my first order from them. To bad I did all four. I should have just done one and then did the single digit test. I would then have been made aware of the potential problem and used tape for the other three.

I attempted to wick the solder from the tack points on the top of the board so I could try to slip in some type of separator. I wasn’t able to wick the solder away so I decided to test for continuity with a meter. I found continuity where I would have expected. I tested for continuity from the 12V trace to the other pins and didn’t find any so I loaded the single digit test sketch. I got action but the segments changed very fast so I increased the delay in the sketch to 3500. I then noticed that the majority of the digits seemed correct. There was a problem with “5” which was to due a typo on my part. I corrected that and tested again. Everything looked fine and I saw the digits 0-8 appear properly. After the digit for “8”, all segments went off but the decimal point came on. The sketch then showed “0” and restarted. I then noticed an if x==9 statement that was causing the decimal point to appear rather than the segments for a “9”. I removed that code and all the digits appeared correctly. I tested each single digit display and confirmed that each works properly.

I then attached a second digit and uploaded the two digit display. It worked as expected counting from 00-99 and started over. I then added a third display digit. I tried using the two digit sketch again. I was at first confused until I realized that the 2 digit sketch when used with 3 displays does not “push” the one’s digit over to the new digit on the right. The left most two digits do show the numbers 00-99 as before. The new display on the right shows a random number.

I added a fourth display with a similar results. Again the sketch does not push the digit through the first displays to the correct display. I may be able to modify the sketch for four digit numbers but this would seem to be a very common scenario and so I would be interested in a four digit library or sketch. I realize the educational value of fighting through the sketch but have other intentions for this display yet to be solved.

As long as they are working you’re probably fine.

You should be able to slide a bit of thin paper between the two boards just to be safe. Prying up a tiny bit should allow enough clearance if you don’t already have enough.

Ok, will try that. I found I was able to modify the 2 digit sketch to work with 4 large 7 segment displays. The sketch “dissects” the number and sends the digits one by one to the first or leftmost display. It can then be “pushed” to the next display etc. I noticed the 2 digit sketch had a “for” loop that went from 0 to 1. I changed the loop so it goes from 0 to 3. This has the desired effect of pushing the Least Significant digit through the first display, through the second display , through the third display to the fourth display which is the correct display for that portion of the number. The next digit is pushed one less place to the right, the next digit one less place again. Finally the most significant digit of the 4 digit number enters the left most digit and is displayed there. I found another statement that defined the reset or roll over point. It is the statement with the %= in it for the mod of the incremented number. Changing that value changes the roll over point. I am able to control both the number of digits and rollover point reliably and am about ready to move towards my ultimate goal of using the 4 digit display as a remote display. My plan is to use an ESP32 with ESP NOW as a Primary and this ESP32 with ESP NOW as a Secondary. Data from the first ESP32 will be shown on its own small display but also be transmitted wirelessly to the second ESP 32 to the large displays. My ultimate use is for farm use where I will have the first ESP32 show a running total of gallons of water I have pumped by using a flow meter. As the flow meter turns, it creates pulses which can trigger an interrupt. The ISR increments a raw counter in the first ESP 32, It divides the raw count by a calibration number that converts the raw count into gallons. This value is displayed on a small display and eventually transmitted to the second ESP 32 which will control the large displays. This would be very similar to large scoreboard for a sporting event where the scorekeeper changes the score on his device but the results are shown on a large display to the crowd.