5 Digit LED Display Module Data Sheet May 2002
5 Digit LED Display Module Data Sheet May 2002
2002
Table of contents:
Pinouts
Talking to the Module
Creating a Character
Character Map
Displaying a Character
Circuit Diagram
Basic Sample Software
Scrolling Text
character - Hex - ascii converter
Javelin Stamp Software
java class for driving the display
Pinouts
Pin Function
1 Strobe digit 2
2 Vdd (5Vdc)
3 Vss
4 N/C
5 Strobe digit 0
6 Strobe digit 4
7 Strobe digit 1
8 Clock
9 Strobe digit 3
10 Data
Creating a Character
To display a character on any digit, a 8 bit code is sent to that digit. One bit for each
segment.
1 BYTE
Segment . G F E D C B A
8 7 6 5 4 3 2 1
Bit
For example, to display "8." send 11111111 to the display (255 decimal, FF
hexadecimal).
Character Map
Character Binary Decimal Hex
0 00111111 63 3F
1 00000110 6 06
2 01011011 91 5B
3 01001111 79 4F
4 01100110 102 66
5 01101101 109 6D
6 01111101 125 7D
7 00000111 7 07
8 01111111 127 7F
9 01101111 111 6F
A 01110111 119 77
b 01111100 124 7C
C 00111001 57 39
c 01011000 88 58
d 01011110 94 5E
E 01111001 121 79
F 01110001 113 71
G 00111101 61 3D
H 01110110 118 76
h 01110100 116 74
I 00110000 48 30
J 00001110 14 0E
L 00111000 56 38
N 00110111 55 37
o 01011100 92 5C
P 01110011 115 73
R 00110001 49 31
t 01111000 120 78
U 00111110 62 3E
u 00011100 28 1C
Y 01101110 110 6E
Blank digit 00000000 0 00
Decimal
1000000 128 80
Point
Displaying a Character.
Once you have sent the byte to the module, you will need to strobe the digit/s you wish
the character to be displayed on.
For example, to display a character on digit 0, pulse pin 5 high then low. To display the
same character on digits 0 and 1, pulse both pins 5 and 7 high then low.
Circuit Diagram.
Software Samples.
The following samples are written in PBasic for the Parallax BS2.
Scrolling text:
A simple demonstration to show that almost anything is possible with the LENNARD
Display Module, including a fancy effect as animated displaying of characters.
'{$STAMP BS2}
'*****DECLARE VARIABLES*****
'DATA for the Display's Character Lookup Table, EEPROM address 0 to 7
data 56,121,55,55,119,49,94,0 'LENNARD
'CONSTANTS
clock CON 6 'P6 = clock to 4094's pin 3
datapack CON 5 'P5 = Data to 4094's pin 2
'VARIABLES
strobedigit var nib 'a four bit variable used to determine which digit to update
character var byte 'the data to send to the display
a var nib 'a for loop variable
b var nib 'a for loop variable
startletter var nib 'determines which character to start with
endletter var nib 'determines which character to finish with
spaces var nib 'used to make sure the correct digit is strobed
'*****MAIN PROGRAM*****
start:
Gosub blankdisplay
startletter = 0
endletter = 0
spaces=0
for b = 1 to 12
for a = startletter to endletter
read a, character
strobedigit = spaces + endletter - a
gosub loadregisters
next
'determine the speed of scrolling by the pause statement
pause 200
endletter = endletter + 1
'as we only have 5 digits, we need to check if we
'need to change the start letter...
if endletter > 4 then incrementstartletter
goto endofroutine
incrementstartletter:
if endletter > 7 then endlettermax
startletter=startletter + 1
goto endofroutine
endlettermax:
endletter = 7
spaces = spaces + 1
startletter=startletter + 1
endofroutine:
next
goto start
blankdisplay:
SHIFTOUT datapack, clock, msbfirst, [0] 'blank display
for a = 0 to 4
pulsout a,1 'Strobe each digit
next
return
loadregisters:
SHIFTOUT datapack, clock, msbfirst, [character] 'Send data to the display
PULSOUT strobedigit,1 'Strobe required digit to display the data
return
'{$STAMP BS2}
'The outputs from the 4094 registers correspond to the Digit segments as
follows:
'MSB -> .GFEDCBA <-LSB
'*****DECLARE VARIABLES*****
'DATA for the Display Character Lookup Table (EEPROM address 0 to 20)
data 63,6,91,79,102,109,125,7,127,111 '0-9
data
%01110111,%01111100,%00111001,%01011110,%01111001,%01110001
'A-F
data 63,%00111000,%00111000,%01111001,%01110110 'O,L,L,E,H
("HELLO")
'CONSTANTS
clock CON 6 'P6 = clock to 4094's pin 3
datapack CON 5 'P5 = Data to 4094's pin 2
'VARIABLES
strobedigit var nib 'a four bit variable used to determine which digit to update
'5 digits, 0 to 4
character var byte 'the data to send to the display
datafromPC var byte 'the data from the PC
a var byte 'just a FOR loop variable
nibble var nib 'used to store the lower or upper 4 bits of "datafromPC"
divider var byte
'*****MAIN PROGRAM*****
'Set up the display
Gosub blankdisplay
'display "HELLO"
for a = 16 to 20
'go to EEPROM address "a" and store the data at that address in "Character"
read a, character
'Send "character" to the display module, and display on the digit
'determined by "strobedigit"
strobedigit=a-16
gosub loadregisters
next
pause 3000
ReadSerialPort:
SERIN 16, 396, [datafromPC] 'Using builtin serial port, 2400baud, 8, N, 1
if not datafromPC = 27 then keepgoing 'If ESC pressed, send a message back
to the PC
SEROUT 16, 396, [" Microcontroller demo. Ben Lennard 3/2002"]
keepgoing:
if datafromPC = 27 then ReadSerialPort
GOSUB DisplayASCIIcode
GOTO ReadSerialPort
DisplayASCIIcode:
nibble = datafromPC 'transfer lower 4 bits of byte to nibble
'NOTE: As "nibble" is a nibble, and "datafromPC" is a byte,
'then only the lower half of "datafromPC" will be passed to "nibble"
read nibble, character 'lookup data in table to send to the display
'load that data in to Digit A
strobedigit=0
gosub loadregisters
'Figure out hundreds unit (doing 100's then 10's then 1's, rather
'than 1's, 10's, 100's saves 6 bytes of EEPROM! As this way you don't need to
repeat code)
nibble = datafromPC / 100 'eg: 214 / 100 = 2.14 (integer maths drops the .14)
strobedigit = 4
read nibble, character
gosub loadregisters 'eg: load 01011011 in to digit 4, which displays a 2.
blankdisplay:
SHIFTOUT datapack, clock, msbfirst, [0] 'blank display
for a = 0 to 4
pulsout a,1 'Strobe each digit
next
return
loadregisters:
SHIFTOUT datapack, clock, msbfirst, [character] 'Send data to the display
PULSOUT strobedigit,1 'Strobe required digit to display the data
return