Interfacing 7 segment display with pic16f877 microcontroller
This post will describe that how easily we can do Interfacing 7 segment display with pic16f877 microcontroller. 7 segment display is a basically array of 7 leds with some proper arrangement. From this fig it can be seen that 7 leds arranged with an array starting from a, b, c, d, e, f, g, and h. So from every LED we get one pin and another Pin for providing active high voltage to every pin. Now whatever LEDs we have to glow we have to send active low on corresponding LED pin.
Now let take an example to clear all, suppose we have to display 5 at 7segment display then what should be our bit pattern? For display5 we have to glow a, f, g, c and d LEDs and off rest. As I discuss earlier, whatever LEDs we have to glow we have to send active low on corresponding LED pin because all others pin of LED got active high signal. So in our case we have to send bit pattern like
Now in my project to make you easily understandable the process, Interfacing 7 segment display with pic16f877 microcontroller, I made a counter which will count 0-5 and repeat. For that I used port B of microcontroller pic16f877 as an out port send different bit pattern for different digit to display at 7 segment display. So to display 0-5 we have to create exact bit pattern for every digit which are given bellow .
For 0 = 01000000.
For 1 = 01111001.
For 2 = 00100100.
For 3 = 00110000.
For 4 = 00011001.
For 5 = 00010010.
Here I give you the Proteus simulation circuit and see how I connect the 7 segment display pin with port B of microcontroller pic16f877.
In bellow you will find complete embedded C code on PIC Micro C Pro. From this code you will understand how i send particular bit pattern for individual digit.
For more detail: Interfacing 7 segment display with pic16f877 microcontroller
For All Your PCB Need, One-stop PCB Solution Services Appear:
EasyEDA: free PCB design tool, 200,000+ engineers are using
PCBs: 10pcs 2-layer 10x10cm only $8.21, on-time global shipping
Components: save 50% on cost, save on freight if shipped with ordered PCBs
Current Project / Post can also be found using:
- LED display circuit with PIC16F84A
- project about leds using pic16f877a
- code for 7 segment led in pic microcontroller
- interfacing 7-segment display with pic 16f877