Interfacing dot matrix LED display to 8051 microcontroller.
LED dot matrix display.
PWM lamp dimmer.
An LED dot matrix display consists of a matrix of LED’s arranged in a rectangular configuration. The desired character or graphics can be displayed by switching ON /OFF a desired configuration of LED’s. Common display configurations available are 7×5, 8×8, 7×15, etc. LED dot matrix can be used in simple display applications where the resolution is not a big concern. The figure below shows the arrangement of LEDs in a typical 7×5 dot matrix display.
Circuit diagram.
ULN2003A driver IC.
The purpose of ULN2003A here is to drive the column lines of the display. ULN2003A is a high voltage (50V), high current (500mA per channel) darlington transistor array. Each IC has 7 channels with individual output clamp diodes. ULN2003A an active high device, which means a logic high must be applied to the input to make the corresponding output high. The input pins are designated as 1B, 2B, 3B, 4B, 5B, 6B, 7B while corresponding output pins are designated as 1C, 2C, 3C, 4C, 5C, 6C, 7C. The pin configuration and simplified internal logic of ULN2003A is shown in the figure below.
Program.
ORG 00H
MOV P3,#00000000B // initializes port 3 as output port
MOV P1,#00000000B // initializes port 1 as output port
MAIN: MOV P3,#01111110B
MOV P1,#11111110B
ACALL DELAY
MOV P3,#00010001B
MOV P1,#11111101B
ACALL DELAY
MOV P3,#00010001B
MOV P1,#11111011B
ACALL DELAY
MOV P3,#00010001B
MOV P1,#11110111B
ACALL DELAY
MOV P3,#01111110B
MOV P1,#11101111B
ACALL DELAY
SJMP MAIN // jumps back to the main loop
DELAY: MOV R6,#255D // 1ms delay subroutine
HERE: DJNZ R6,HERE
RET
END