7-Segment Led Interfacing Using GPIOs
How many TV shows and movies have some mysterious device counting down to zero those displays are 7 segment displays.With the 7 segment displays you can display any number or some alphabets that your heart desires.
At first controlling a 7 segment display seems quite complex but it quickly becomes clear.
What follows is a quick guide to control a 7 segment display with a arduino board.
At first controlling a 7 segment display seems quite complex but it quickly becomes clear.
What follows is a quick guide to control a 7 segment display with a arduino board.
- First let me do it on proteus simulator.
- Arduino Code:
- void setup()
- {
- int i=0;
- for(i=0;i<8;i++)
- {
- pinMode(i,OUTPUT);
- }
- }
- void loop()
- {
- char x=0x00;
- PORTD = x;
- x++;
- delay(500);
- }
Common Configuration(Anod/Cathod)
This post is all about how to interface a seven segment display with microcontroller. In this particular example I will interface one seven segment display with PIC24. You may download Proteus Simulations and code from the links given at the bottom of this page.
- I am using MPLAB X IDE and C30 Compiler for 16bit microcontrollers. I supposed that you know how to blink an LED (if not then I suggest you to read this (link) first before continuing this post) and how to generate a delay without timers or with timers ((if not then I suggest you to read this (link1 and Link2) first before continuing this post).There are two types of seven segments available in the market1) Common anode.2) Common cathode.I will go through from both of them in order to make you understand that what differences will be caused in hardware and software.In hardware they are arrange in following type:
Common Anode Internal configuration. Truth table for Common Anode:Dp(MSB)GFEDCBA(LSB)Value in hex0110000000xC01111110010xF92101001000xA43101100000xB04100110010x995100100100x926100000100x827111110000xF88100000000x809100110000x98Common Cathode Internal configuration. For Reference:
No comments:
Post a Comment