Since we can source a maximum of 20mA per pin for PORT P1 and total
maximum current from PORT P1 is 80mA, hence we can use PORT P1
to drive Matrix LED directly. Below circuit shows one Common Cathode
5 x 7 Matrix LEDs is connected to Port P1 with 120 Ohms current limiting
resistors. The Columns are activated by Q1, Q2, Q3, Q4 and Q5 respectively
by logic high at P3.0, P3.1, P3.2, P3.3, P3.4 which switch on gnd to the
respective common cathode pins.
1) For SPJ 8051 C, the following code,
mat2051_c
2) For KEIL 8051 C, the following code,
matc_89.c
demonstrate how to drive a 5 x 7- Matrix LED.
The program first display one 5 x 7 pattern on the LEDs
and then redisplay this pattern over and over again.
|