The BelleVue 7-Segment LED Display Introduction The BelleVue display module is a six digit display module. It uses 7-segment LED modules and is able to display digits and some alphabetic characters. The display is controlled by a serial interface that is designed to be as simple as possible to use. Decimal points can be sent in a string of characters and will be displayed correctly. The display automatically scrolls left when it receives more than six characters. There are simple commands for flashing characters, for displaying custom characters and for addressing multiple displays. This manual describes how to connect the display and use its features.

Connecting the Display Power Supply Requirements The display requires a voltage between 3.3 and 5.0 volts. The voltage must be regulated. With all the segments lit the current will be a maximum of 25 mA so the power supply must be able to supply at least this much. Electrical Characteristics The display expects a serial input at 9600 baud with 8 data bits, 1 start bit, 1 stop bit and no parity. No flow control is required. An on-bit must be at least 2.0 volts and an off-bit must be no more than 0.5 volts. The serial output of the Arduino, most microcontrollers and RS232 to TTL converters will meet this requirement. Connections There are four sets of connections on the back of the display board. In most cases only the serial input will be used. Serial Input: Provides the serial signal from a controller. Serial Output: Is used to forward commands to a second display module. Power: Provides access to the Gnd and Vcc connections. Programming: Can be used for upgrading the firmware in the display. (This feature is for advanced users and not normally used)

Figure 1. Connections to the Module BelleVue 7-segment LED Display Page 1 of 9

www.Wharfe-Education.com

Controller Options Arduino The display can be controlled by connecting the serial input of the display to the serial output of an Arduino. The Gnd pin of the serial input is connected to the Gnd of the Arduino. The Vcc pin of the display is connected to the 5 volt pin of the Arduino. The RxD pin of the display is connected to TX pin of the Arduino. The display is powered by the Arduino.

Figure 2. Connecting the Display to an Arduino RS232 The display can be controlled via the RS232 port of a PC. An RS232 to TTL level shifter must be used to convert the RS232 signals to the TTL level required by the display. Appendix 1 of this manual shows a simple level shifter circuit. As the RS232 port does not provide power the display must be powered by a separate power supply. Once connected, a terminal program such as HyperTerminal may be used to control the display. Anything that is typed in the HyperTerminal window will be sent to the display. The Return or Enter key will send a carriage return character.

Figure 3. Connecting to an RS232 Port USB to Serial The display may be controlled using a USB to serial converter. If the converter provides an RS232 port then an RS232 to TTL level shifter will be required. If the converter provides a TTL level signal then simply connect the Tx pin of the converter to the RxD pin of the display. A converter that provides a TTL output will often provide power as well. BelleVue 7-segment LED Display Page 2 of 9

www.Wharfe-Education.com

Multiple Displays To control more than one display with a single controller simply connect the first display to the controller. Connect the serial output (TxD) of the first display to the serial input (RxD) of the second display. For each additional display connect its serial input to the output of the display that is before it in the chain. In this way any number of displays may be connected together. The Gnd pins of all the displays must all be connected. The power (Vcc) pins of each display may be connected together provided that the power supply can supply 25 mA for each display. Otherwise they may be powered by separate power supplies. See the section on Functions for details of how to address individual displays that are connected in a chain.

Figure 4. Connecting Multiple Displays

Initialising Arduino To initialise the serial port of the Arduino add the serial.begin command to the setup section:void setup() { Serial.begin(9600); } Hyperterminal The examples in this manual use HyperTerminal because it is included in the Windows operating system and therefore readily available. To configure HyperTerminal pick the COM port that the display is connected to then configure it to 9600 baud as shown.

Figure 5. Initialising HyperTerminal BelleVue 7-segment LED Display Page 3 of 9

www.Wharfe-Education.com

Functions Power up When first powered up the display module will show its firmware version enclosed in brackets. For example: “[0-01]”. Clear Display The display is cleared by sending two carriage return characters one after the other. A single carriage return will reset the display ready to place a character on the left-most digit. The next carriage return will cause the display to blank. Examples:Arduino: Use the serial print line function twice without any parameters. This sends a carriage return each time and blanks the display. Serial.println(); Serial.println(); HyperTerminal: Press the Enter key twice; the display will blank. Character Set The BelleVue display will make an attempt at most characters in the ASCII set. Some alphabetic characters are difficult to display well on a 7-segment display but the BelleVue will always try to show something. Most letters will be converted to upper or lower case depending on which works best. For example both ‘A’ and ‘a’ will be shown as an upper-case ‘A’ while both ‘B’ and ‘b’ will be shown as a lower-case ‘b’. A few letters such as the letter c can be displayed in either case and will be shown in whatever case they are sent. Some symbols will be displayed but a few have special functions: ‘%’ causes a degree sign to be displayed.  ‘!’ causes one or more characters to flash (see section on flashing).  ‘@’ causes the characters that follow it to be sent on to another connected display (see section on multiple displays).  ‘#’ causes the next character to be received as a custom character s(ee section on custom characters).  ‘&’ is reserved and should not be used.  Decimal points are handled specially (see section on decimal points). Decimal Points The display handles decimal points in a simple and intuitive way. Generally, when a decimal point character is received the display switches on the decimal point of the character that came before it. This means that a number containing a decimal point can simply be sent as a string and will be displayed correctly. If the first character after the display has been cleared is a decimal point then the leftmost character of the display will be a blank digit with just the decimal point displayed. If the two decimal points are received one straight after the other then the second decimal point will be displayed as a blank digit with just the decimal point displayed.

BelleVue 7-segment LED Display Page 4 of 9

www.Wharfe-Education.com

Examples:Arduino: Define a constant: const float pi = 3.141592; Print it to five decimal places using the print line function: Serial.println(pi,5); HyperTerminal: Type “1.23456”; the decimal point is correctly displayed to the right of the number 1. Type “1…234”; two blank digits are automatically inserted so that the three decimal points can be displayed. Scrolling There is no special command to cause the display to scroll. If more than six characters are received then leftmost digit is dropped and all the other digits scroll to the left. The display will then continue to scroll one place for each new character received until a carriage return is received. If just a single carriage return is received then new characters begin from the left-hand side of the display and overwrite the characters that are already displayed. If two carriage returns are received then the display is blanked and new characters begin from the left. Examples:Arduino: Use the serial print function (not print line) to send single characters. Use the delay function to pause for a quarter of a second between characters. The message will scroll and, because the Arduino keeps running the loop, the message scrolls continuously: void loop() { Serial.print("H"); // print one character delay(250); // wait for a quarter second Serial.print("E"); delay(250); Serial.print("L"); delay(250); Serial.print("L"); delay(250); Serial.print("O"); delay(250); Serial.print(" "); // Print a space delay(250); } HyperTerminal: Type “SCROLLING ALONG”; the digits scroll left as you type so that in the end only “ ALONG” is displayed. Flashing The exclamation mark (“!”) is a special command character that is used to make the display or part of the display flash. After an exclamation mark is received the next character to be received will flash when it is displayed. If an exclamation mark is received immediately before a carriage return then the all the characters displayed will flash.

BelleVue 7-segment LED Display Page 5 of 9

www.Wharfe-Education.com

When the display scrolls any character that is flashing will continue to flash as it scrolls to the left. If new characters overwrite characters that are flashing the new characters will be steady (not flashing). Examples:Arduino: Use the print line function to send a string with a carriage return at the end. If the last character in the string is an exclamation mark the whole line will flash: Serial.println("FLASH!"); // print flashing line To make just selected characters flash place an exclamation mark in front of those characters: Serial.println("1!234!56"); // Flash just 2 and 4 HyperTerminal: Type “FLASH!” then press Enter; whole display flashes. Type “0!12!34!56”; the odd digits flash but the even ones are steady. Note that as you type the 6 the display scrolls but the flashing digits continue to flash as they move left. Addressing Multiple Displays The @ symbol is a special command to cause characters to be sent on through the serial output connector to another display connected in a chain. This makes for a very simple method for addressing multiple devices. After receiving the @ symbol all following characters up to and including the next carriage return are simply passed on to the next display in the chain. If two @ symbols are received then the first display in the chain will send following characters to the second display. This includes the second @ symbol which will then cause the second display in the chain to send any following characters on to the third display and so on. To send characters to any given display within a chain simply count the number of displays that come before it and send that many @ symbols. Note that, the last device in the chain does not necessarily have to be a BelleVue display. The displays simply forward whatever characters come after the @ symbols. If a different sort of device is at the end of the chain then simply send whatever commands it expects preceded by as many at symbols as there are BelleVue displays in the chain. Examples:Arduino: With two or more displays connected in a chain place the @ symbol at the beginning of a line to send it to the second display: Serial.println("@SECOND"); // Print to 2nd display Place two @ symbols at the beginning of the line to send it to the third display: Serial.println("@@THIRD"); // Print to 3rd display HyperTerminal: Type “@second”; the word “second” appears on the second display in the chain. Type “@@third”; the word “third” appears on the third BelleVue 7-segment LED Display Page 6 of 9

www.Wharfe-Education.com

display in the chain. Type “@” followed by Enter to clear the second display, type “@@” followed by Enter to clear the third display and so on. Type “1@2@3”; the 1 appears on the first display, the 2 appears on the second display and the 3 appears on the third. Custom Characters The hash symbol (“#”) causes one character to be entered in binary mode. In this mode the individual segments of a character can be set bit by bit. After the hash symbol the following eight characters set the segments of the current digit. An ASCII “1” sets the segment to be on and an ASCII “0” sets it to be off. The first character after the hash directs segment 7 and the last directs segment 0. The segments are numbered according to the diagram below. The hash and the eight characters following it can be inserted anywhere within a string of ordinary characters.

Figure 6. Segment Numbering Examples:Arduino: Send “#01101100” to display two upright parallel bars: Serial.print( “#01101100”); Send the hash and the eight following characters in the middle of a string if that’s where the custom character should be display. Serial.print( “AB#01101100CD”); Hyperterminal: Type “#01101100” to display two upright parallel bars. Type: “#10010010” to display three horizontal bars.

BelleVue 7-segment LED Display Page 7 of 9

www.Wharfe-Education.com

Appendix 1 Simple Level Shifter The circuit shown here is a simple level shifter that will convert the RS232 level signal from the serial port of a PC to the lower voltage required by the BelleVue display. The circuit only shifts the TxD output of the RS232 port. There is no connection to the RxD input, because it is not required for display module.

BelleVue 7-segment LED Display Page 8 of 9

www.Wharfe-Education.com

Appendix 2 Arduino Demo Program This is a demo program that uses all the functions described in this manual. This code has been tested on an Arduino Duemilanove with the ATmega328 microcontroller. char c = 'A'; int i = 0; const float pi = 3.141592; void setup() { Serial.begin(9600); } void loop() { // Clear Display Serial.println(); Serial.println(); // Wait for 1 second delay(1000); // Scroll through character set for( c = 'A'; c