0% found this document useful (0 votes)
66 views

5 Digit LED Display Module Data Sheet May 2002

This document provides information about driving a 5-digit LED display module. It includes the pinouts, how to display characters by sending a byte and strobe signal, a character map with the binary codes for each character, a circuit diagram, and sample software code for scrolling text and displaying the ASCII code of serial input.

Uploaded by

AlcenHelmiyo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

5 Digit LED Display Module Data Sheet May 2002

This document provides information about driving a 5-digit LED display module. It includes the pinouts, how to display characters by sending a byte and strobe signal, a character map with the binary codes for each character, a circuit diagram, and sample software code for scrolling text and displaying the ASCII code of serial input.

Uploaded by

AlcenHelmiyo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

LENNARD 5 Digit LED Display Module data sheet May

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

Talking to the Module


To display a character, you need to send a byte to the module, then strobe the digit you
want that character displayed on.

Creating a Character

To display a character on any digit, a 8 bit code is sent to that digit. One bit for each
segment.

The format of the byte is as follows:

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).

To display "8" send 01111111 to the display (127 decimal, 7F hexadecimal).

The byte is sent to the module MSB first.

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}

'April 2002. Ben Lennard.


'Quick demo which scrolls "LENNARD" across my 5
'digit display

'The display would be like this:


'____L
'___LE
'__LEN
'_LENN
'LENNA
'ENNAR
'NNARD
'NARD_
'ARD__
'RD___
'D____
'_____
'Thats 12 steps in total
'Therfore, we will need a For loop for starters, that counts from 1 to 12
'and another For loop within that loop, along with conditional statements
'to determine what we need to display on each digit...

'*****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

CHARACTER - HEX ASCII converter

Use a terminal emulator such as Hyperterminal or Clarisworks data transfer to


communicate with the Stamp Microcontroller. Set to 2400, 8, N, 1.

'{$STAMP BS2}

'March 2002. Ben Lennard.


'Program to demonstrate how to interface to the LENNARD5 Digit
'LED display module. Plus, how to communicate with a PC, and display the
'Hexadecimal ASCII code of any keys pressed on the keyboard.

'The outputs from the 4094 registers correspond to the Digit segments as
follows:
'MSB -> .GFEDCBA <-LSB

'To write to a digit, do the following:


'1. Send data.
'2. Strobe the digit/s you want to display the data

'What this program does:


'Receives data from the PC everytime a key is pressed, and displays the
'Decimal and Hexadecimal value of that Key's ASCII code.
'Data received from the PC will be 8 bits, so we need to translate that 8 bits
'in to two sets of nibbles. Then, we use those nibbles to look up the actual
byte
'we need to send to the 4094's to display the correct data.
'Example: If we send "Z" via the serial port, we will receive the following
byte: 01011010
'Which is "5A" in Hexaedecimal.
'To display that value on the "LENNARD Display module": Split the byte in
to two nibbles.
'The lower nibble, 1010 (Hexadecimal = "A", Decimal "10")
'will make the program look up position 10 in the table, and then sends that
data
'in the table to the display, digit A.
'The upper nibble, 0101 (Hexadecimal and Decimal = "5") will make the
program look up
'position 5 in the table, and then sends that data in the table to the display,
digit B.

'*****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

'blank display again


Gosub blankdisplay

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

nibble = datafromPC >> 4 'transfer upper 4 bits of byte to nibble


read nibble, character 'lookup data in table to send to the display
'load that data in to Digit B
strobedigit = 1
gosub loadregisters

DisplayDECIMALcode: '(this code added 25/3/2002)


'This is a little more difficult than working out
'the HEX code (simply spliting the byte in to two nibbles)
'as we can have up to 3 digits. So, we need to split the
'decimal version of the character in to 3 parts to display...
'The following code takes advantage of the fact that the Stamp
'and similar Microcontrollers only do Integer maths without
'an external floating point coprocessor attached.

'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.

'Figure out tens unit


divider = nibble * 100 'eg: 2 * 100 = 200
divider = datafromPC - divider 'eg: 214 - 200 = 14
nibble = divider / 10 'eg: 14 / 10 = 1.4 (integer maths drops the .4), so nibble
=1
strobedigit = 3
read nibble, character
gosub loadregisters 'eg: load 00000110 in to digit 3, which displays a 1.

'Figure out ones unit


divider = datafromPC / 10 'eg: 214 / 10 = 21.4 (integer maths drops the .4)
divider = divider * 10 'eg: 21 * 10 = 210
nibble = datafromPC - divider 'eg: 214 - 210 = 4
strobedigit = 2
read nibble, character 'eg: read EEPROM address 4 (which has 01100110
stored in it)
'store value in EEPROM address 4 in character
'(turn on decimal point to seperate Dec from Hex on the display, eg: 188.BC)
character = character + %10000000
gosub loadregisters 'eg: load 01100110 in to digit 2, which displays a 4.
return

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

You might also like