LED display circuit based on PIC12C508

Publisher:EuphoricVoyageLatest update time:2011-09-26 Source: 21icKeywords:PIC12C508  LED Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
LED display is widely used for its advantages such as easy use and low price. Its display interface can be divided into two types according to the driving mode: static display and dynamic display. Although static display has high brightness and no flicker, it has disadvantages such as high power consumption, many I/O ports, and high cost. Dynamic display is mostly used when I/O ports are tight. At present, there are many dedicated dynamic display interface chips available on the market. However, the prices of these chips are generally high and not suitable for use in cheap systems. Some dedicated chips (such as MC14489) use hardware decoding, and the amount of information displayed is limited, which is difficult to meet various requirements, affecting its application. Here we introduce a low-cost and good LED dynamic display circuit, which saves a lot of I/O lines through software decoding and serial display. It can not only display numbers, but also most English letters.

1 Hardware Description and Working Principle
The main hardware includes: PIC12C508 microcontroller, 2 74HC595 shift registers, 8 LED digital tubes, and 8 current limiting resistors of about 220 Ω.
1.1 Introduction to PIC12C508
PIC12C508 is a CMOS microcontroller developed by MICROCHIP with low price, low power consumption, high performance, 8 bits, and full static. It adopts RISC structure and has a wide range of applications, especially for portable electronic products.
The pin diagram of PIC12C508 (see Figure 1) is as follows:
GP0: bidirectional input/output port/serial programming data port;
GP1: bidirectional input/output port/serial programming clock port;
GP2: bidirectional I/O port;
GP3: input port;
GP4: bidirectional I/O port;
GP5: bidirectional I/O port.
1.2 Introduction to 74HC595
74HC595 has 8-bit shift registers, 1 memory and three-state output function. The shift register is serial input and 8-bit parallel (or serial) output. The shift register and memory are respectively input and shifted by clock and data at the rising edge of SR-CLK: Q0→Q1→Q2→…→Q7, and enter the storage register at the rising edge of RCLK. When E is low, the data of the storage register is output to the bus. The functions of the 74HC595 pin diagram (see Figure 2) are as follows:

Q0~Q7: parallel data output terminal;
Q7': cascade output terminal;
SRCLK: shift register clock pulse input terminal;
RCLK: storage register clock pulse input terminal;
SER: serial data input terminal;
E: output valid (low level);
SRCLR: master reset (low level).

1.3 Hardware circuit design
In the circuit, two 74HC595s, one as segment code driver A and the other as bit code driver B, are connected in cascade. The GP0, GP1 and GP2 ports of the single-chip microcomputer PIC12C508 are analog data output ports and clock output ports. The serial data input port (SER) and shift register clock port (SRCLK) of segment code driver A are connected to the GP0 and GP1 ports of 12C508 respectively, and the storage register clock port (RCLK) is connected to GP2. The SER and SRCLK ports of bit code driver B are connected to the cascade output port (Q7') of segment code driver A and the GP1 port of 12C508 respectively, and the RCLK port is connected to GP2. At the same time, the E terminals of the two 74HC595s are grounded (see Figure 3).

During the display process, the segment code value of the character to be displayed is determined by the decoding table, and its bit code value is determined to be FEH (1111 1110) according to the display position of the character in the LED (assuming it is the lowest bit). First, the bit code value is sent to the segment code driver A under the action of the SR-CLK pulse; then the character segment code value is taken and also sent to the segment code driver A. At this time, the bit code value has been sent to the bit code driver B through the cascade terminal Q7'. Then, let GP2 output a rising edge, so that the value in the shift register is output to the storage register, and then output from the 8 parallel output terminals. After a delay of 2 ms, the character can be displayed at the predetermined position. If it is required that the bit code becomes FDH (1111 1101) when displaying the lower two bits, then the segment code value of the second character is decoded and the above process is repeated. In this way, the display program is called cyclically in the main program, and the segment code and bit code are sent alternately, so that the LED can achieve the ideal display effect.

2 Program flow and writing
The main program flow chart is shown in Figure 4. The following program realizes the display of numbers 0 to 7:

3 Conclusion
This paper introduces a new type of LED display circuit, which adopts serial mode, greatly saves the I/O port of single-chip computer, and the chip used is small in size and low in price. The software decoding method increases the amount of displayed information and simplifies the hardware circuit. Therefore, this module is particularly suitable for low-cost portable systems.

Keywords:PIC12C508  LED Reference address:LED display circuit based on PIC12C508

Previous article:Application of Brightness Intelligent LED Control Card System in Tunnels
Next article:Analysis of OLED drive power solution

Recommended ReadingLatest update time:2024-11-16 18:05

LED application problems and solutions
In current practical applications, the problems of high-power LEDs are mainly manifested in the following aspects: 1. Insufficient knowledge of LED working conditions and power supply technology has resulted in numerous power supply failures. 2. The concept of the practical application of LED street lamps
[Power Management]
Explain the design techniques of high-power LED lighting
  General LED lighting has a current limiting resistor in the driving circuit, and the power consumed by the resistor has nothing to do with the LED light emission. In order to improve efficiency, a switching power supply with constant current output should be used, and a power MOSFET should be used at the output stag
[Power Management]
Explain the design techniques of high-power LED lighting
Design of full-color LED display system based on STM32
  LED display is a modern flat display screen composed of LED dot matrix modules or pixel units. It has the advantages of high luminous efficiency, long service life, wide viewing angle, rich colors and strong adaptability to indoor and outdoor environments. In the late 1980s, it developed rapidly around the world and
[Microcontroller]
Design of full-color LED display system based on STM32
LED connection arrangement directly affects the backlight performance
LED backlight technology LCD TVs are technically divided into two main types: side-entry and direct-down. Although the two technologies have their own advantages, considering the cost and other aspects, the side-guide LED backlight module is becoming a mainstream trend. The design of the side-light LED backlight mod
[Power Management]
AVR128 program - independent button control LED flashing
#include #include macros.h #define uchar unsigned char #define uint   unsigned int   void Delayms(uint MS); void main(void) { DDRA = 0XFF;             PORT = 0XFF;   DDRC=0XFF;                     PORTC=0XFF;   DDRF|=0X0E; PORTF|=0X0E; PORTF&=0xF8;    DDRD = 0x00; PORTD = 0XFF;    
[Microcontroller]
STC89C52 microcontroller learning (1)----Lighting up the LED
1. Implement LED running lights through arrays  #include reg52.h   int m; unsigned char code leds = {0x7f, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xfd, 0xfe};   void delay(unsigned int i) { unsigned int j; unsigned char k;   for(j=i; j 0; j--) for(k=125; k 0 ;k--); }   int main() { while(1) { for(m = 0; m 8; m
[Microcontroller]
Comprehensive answers to common questions about LED display selection and application
What are the factors that consider the screen area that the user's site can allow? (1) The relationship between effective sight distance and actual site size; (2) Pixel size and resolution; (3) unit-based area estimation; (4) Screen mechanical installation and maintenance operation space;
[Power Management]
Selection of LED substrate materials
For the production of LED chips , the selection of substrate materials is the primary consideration. The appropriate substrate should be selected according to the requirements of the equipment and LED devices. Currently, there are generally three materials available on the market that can be used
[Power Management]
Selection of LED substrate materials
Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号