Using the Serial 7-Segment Display

Pages
Contributors: jimblom
Favorited Favorite 14

Troubleshooting

Default Firmware v3.1

If you are having issues uploading the most recent default firmware to the smaller (10mm) serial enabled 7-segment display via the Arduino IDE, try using the older version of the firmware in the GitHub v3.1 branch. This is the same firmware that is used in our production department.

Factory Reset

Having issues with the serial UART example, SPI, and/or I2C example code? You could try a factory reset with the microcontroller on the 7-segment serial display by:

If you believe that the smaller (10mm) 7-segment serial display has corrupt firmware, you could also reinstall the Arduino bootloader. You could use an AVR programmer to reflash the ATmega328P on the serial enabled 7-segment display.

If you are using the latest default firmware from the master branch, make sure that you have the correct “DISPLAY_TYPE” defined in the Serial_7_Segment_Display_Firmware.ino code. This is on line 39 of the GitHub master branch. Just change OPENSEGMENT to any of the other hardware layouts. Otherwise, the display with show "0000" as explained in the Arduino Forum: Arduino Uno - 7 Segment Shield Problem .

Microcontroller Sending Commands Too Fast to Serial 7-Segment Display

If you have issues using the serial enabled 7-segment display where the LEDs flicker and display random numbers, it could be the way that you wrote your code. There was one case that tech support encountered where this happened after using a sequence of commands to clearing the screen, setting the mode, setting the brightness, and adjusting the cursor.

Testing with a 5V RedBoard, the major issues that seemed to be fixed was removing the clearDisplay() function and adding a delay between setting the brightness and your cursor position. The flickering may be due to clearing the screen and writing back on the screen in your main function. By avoiding the clear screen function every time my main function looped back, the serial enabled 7-segment displayed the counter better. By adding a 1ms delay, the serial enabled 7-segment stopped displaying random numbers and flickering. It's possible that the serial enabled 7-segment display does not have enough time to set the brightness for the entire display. Adding the delay probably helped in completing the function before moving onto the next command.

language:c
.
.
.
void loop(){
//1) Reset Command (0x76) in a one byte write (one CS cycle)
//clearDisplaySPI(); //try not to use so much, will cause flickering when constantly clearing and displaying

//2) Mode Command (0x82) followed by Data Mode (0x00) in a two byte write (one CS cycle)
digitalWrite(ssPin, LOW);
SPI.transfer(0x82);//command character for mode
SPI.transfer(0x00);//data mode
digitalWrite(ssPin, HIGH);

//3) Brightness Command (0x7A) followed by Value (0xC0) in a two byte write (one CS cycle)
/*make sure to have the modular setBrightnessSPI()function defined
from the example code => https://learn.sparkfun.com/tutorials/using-the-serial-7-segment-display/example-2-spi */
setBrightnessSPI(0xC0);//brightness 0xC0 = 0d192
delay(1);//add delay to finish this function before moving on

//4) Cursor Position Command (0x79) followed by Value (0x00) in a two byte write (one CS cycle)
digitalWrite(ssPin, LOW);
SPI.transfer(0x79);//command character cursor position
SPI.transfer(0x00);//cursor position on the left most position
digitalWrite(ssPin, HIGH);

//rest of SPI example code with Arduino
.
.
.

Arduino Compile Issues w/ "0"

If you are trying to send a special command and a data byte of 0, the compiler won't like:

language:c
Serial.write(0x0);

It will output an error similar to this:

language:c
... error: call of overloaded 'write(int)' is ambiguous
C:\Program Files (x86)\Arduino\libraries\SoftwareSerial/SoftwareSerial.h:123: note: candidates are: virtual size_t SoftwareSerial::write(uint8_t)
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:49: note:                 size_t Print::write(const char*)

The value 0x00 is not specifically defined so it could be a char(NULL), int, or a byte. The compiler doesn't understand what you are referring to. To work around this, try saving the byte into a defined variable and using it with the Serial.write() function similar to this:

language:c
byte zero = 0;
.
.
.
Serial.write(zero);

Default I2C Address on Other Microcontrollers

The Arduino I2C library uses 7-bit addressing [ https://www.arduino.cc/en/reference/wire ]. The library ignores the last bit because there is a function for reading or writing. Other development boards outside of the Arduino ecosystem may require different addressing techniques. This was stated briefly in the I2C example code:

language:c
Please Note: 0x71 is the 7-bit I2C address.

If you are using a different language other than Arduino, you will probably need to add the Read/Write bit to the end of the address. This means the default read address for the OpenSegment is 0b.1110.0011 or 0xE3 and the write address is 0b.1110.0010 or 0xE2. For more information check out our tutorial on I2C .