




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





One universal requirement for most of the digital devices is an image numeric display. A seven segment display, which is also known as seven segment indicator is an electronic device that are used to display decimal values. These devices are used in digital meters, digital clocks, watches, house hold appliances and other electric parts for displaying numerical information. These are implemented in many circuit applications to perform a desired task. This application note will describe how to design a circuit to display the any of the ten decimal digits from 0 โ 9 using a PIC microcontrollers and drivers [1].
Dual digit 7 segment Display, 18f4520 PIC Microcontroller, BCD to 7 โ segment driver, switch
The purpose of this document is for the reader to get familiar on how to operate dual digit 7 segment display using a microcontroller with the help of driver. This document will help to identify the pins of parts and design will be discussed along with some factors that should be taken into account.
An 18f4520 PIC microcontroller is used to display decimal values on the 7 segment display. Using the data pins on the PIC we can send the information to driver data pins to display the decimal values as an output.
Before I explain the design process, I want to discuss about the parts that I will be using and their pin structure.
For more information regarding to voltage and current measurements follow the data sheet [2] http://www.lumex.com/pdf/LDD-C814RI.pdf
b) 18f4520 PIC Microcontroller.
The data sheet and some basic information and sample programs can be found at the following website. This website will provide detailed information on the pin structures and also tells us how to use MPLAB software to program the PIC [3]. http://www.egr.msu.edu/classes/ece480/goodman/ForMiniprojects/Lab3.pdf
c) BCD to 7 segment latch/decoder/driver The driver used in this example is HEF4543B. These driver acts as a mediator between the PIC and the display. It takes binary information from the PIC and helps to output a decimal number on the display. In other words, it converts the binary value to decimal value. Following picture shows detailed information about the pins.
Pin 1 - LD โ Latch disable Input โ Connected to VDD Pin 2 โ Pin 5 โ Data pins โ These pins will be connected to PIC to get binary information Pin 6 โ PH โ Phase input โ For this example we can ground this pin. Pin 7 โ BI โ Blanking Input - For this example we can ground this pin. Pin 8 โ VSS โ GND Pin 9 โ Pin 15 โ Output data pins Each of these pins will be connected to 7 segment display accordingly. Pin 16 โ VDD
For more information regarding to voltage and current measurements follow the data sheet [4]. http://www.chipcatalog.com/Datasheet/C1A7DE08130802F8600978D0DD17279B.htm
Use port D pins to transmit the data to drivers. We need 4 pins from port D to display one digit. In this particular example, we are displaying 2 digits, so we will be using 8 pins of port D. The PIC sends the data in a 4 bit binary form to the decoder to display the desired number in a decimal form on a 7 segment display. In order to display the decimal number on the 7 segment display, all the independent outputs are connected to the decoder appropriately. Use the 300 ohm resistors between driver and display to have a bright display. For clear understanding of wiring, look at the picture provided below. We
This program will display the numbers upto 17 on the multi digit 7 segment display using a switch. Every time you press a switch the number will increment by 1. #include <p18cxxx.h> #include <timers.h> #pragma config WDT=OFF #pragma config OSC = INTIO long int count; int value,ones,tenths,teen_count,loop,address; void main() { TRISA = 0x00; TRISB = 0xF0; TRISC = 0x01; TRISD = 0x00; TRISE = 0xF; ones = 0; tenths = 0; teen_count = 0; address = 0x0C; PORTDbits.RD0 = 0; PORTDbits.RD2 = 0; PORTA = 0x0C; PORTB = 0x01; PORTC = 0x00; PORTD = 0x00; while(1) { value = ( (ones*16) + tenths ); PORTD = value; //---------------------------Whole Inches---------------- if(PORTBbits.RB5 == 0) { //---INCREMENT VALUE BLOCK------------- ones++; teen_count++; for(count=1;count<4000;count++); if(ones == 10) { ones = 0;
PORTBbits.RB3 = 1; } if(teen_count == 18) { ones = 0; teen_count = 0; PORTA = 0x06; PORTD = ( (ones16) + tenths ); PORTBbits.RB3 = 0; } //---END INCREMENT VALUE------------- //---------------Tenths Inches----------------------- if(PORTCbits.RC0 == 0) { //---INCREMENT VALUE BLOCK------------- tenths++; for(count=1;count<4000;count++); if(tenths == 10) { tenths = 0; PORTA = 0x06; } //---END INCREMENT VALUE------------- PORTD = ( (ones16) + tenths ); } }
Rather than using 4 data pins on the PIC for each driver. We could use a demux to send the data to all the drivers. This could take 6 pins on the PIC, 4 pins to transmit the binary data to driver to display the number and two pins to select the driver. This only disadvantage of this, programming part gets little bit complex compared to the other.
7 segment displays can be used in most of the electronic instruments, residential appliances and other electric parts for displaying numerical information. This application note describes how to use a PIC and a driver to display a desired numbers on the 7 segment display