0% found this document useful (0 votes)
11 views4 pages

EXP13 Multi Display

Earnest money security deposit

Uploaded by

anamayank111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

EXP13 Multi Display

Earnest money security deposit

Uploaded by

anamayank111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CIRCUIT DIAGRAM

Exp No.13 Date: D D - M M - Y Y

Multiplexed Seven segment display interface


AIM:
To interface 3 seven segment displays in multiplexed fashion with AVR
microcontroller anddisplay continuous count from 000 to 999.
THEORY:
PORTD is configured as an input port and PORTC.0 is configured as an output port. Switch is connected to
PORTD Pin0 and LED connected to PORTC Pin 0.

Theory:
With minimum number of o/p pins, multiple & segment displays can be connected, either
using a display driver or with Multiplexing. This technique is based on the principle of
Persistence of Vision of eyes. If the frames change at a rate of 25 ( or more) frames per
second, human eye can’t detect that visual change. Each display appears turned on
continuously.

PORTA is configured as output port. 3 common cathode 7 segment displays are


connected to PORTA in a multiplexed fashion. PORTA Pins 0 to 7 are connected to
D1to D8 segment pins of 7 segment display which correspond to segments a to g and
dot in 7 segment display. PORTD is also configured as output port .Pin 2 of Port D is
connected to common cathode point of 1st 7 segment display, Pin 1 to 2nd and Pin 0 to
3rd respectively through switching transistors. This is done to control the displays
individually. The 7 segment displays are switched on and off sequentially with a delay
of 1 ms and due to human persistence of vision they appear as stable.

Algorithm:

1. Set PORTA as output by initializing DDRA register with 0xFF


2. Set PORTD as output by initializing DDRD register with 0xFF
3. 8 bit hex codes to display digits 0 to 9 in 7 segment display are stored in an array.
The program loops through the array continuously and outputs the code to PORTA.
4. Hundred’s, ten’s and One’s places are displayed using nested for loops. Outer for
loop corresponds to first 7 segment display (100’s place). The next inner for loop
corresponds to second 7 segment display (10’s place) and the next inner for loop
corresponds to third 7 segment display (1’s place).
5. In the inner most for loop we first enable only the first 7 segment display by driving
PORTD Pin 2 high and output the hex code corresponding to 100’s place value from
the array to PORTA and call 10 ms delay.
6. Then sequentially we enable only the second 7 segment display by driving PORTD
Pin 1 high and output the hex code corresponding to 10’s place value from the
array to PORTA and call 10 ms delay.
7. And then sequentially we enable only the third 7 segment display by driving
PORTD Pin 0 high and output the hex code corresponding to 1’s place value from
the array to PORTA and call 10 ms delay.
CODE

#define F_CPU 1000000UL //1 MHz clock #include <avr/io.h>


#include <util/delay.h>
#include <avr/io.h> /* Include AVR std. library file */

char seg_7[10] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};


unsigned char hun,ten,one,dig;
int main(void)
{
DDRA = 0xFF; // setting PORTA as output
DDRD= 0xFF; // setting PORTD as output
PORTD = 0x00; // initially disable all 3 seven segment displays
PORTA = 0x00;
while (1) // indefinite loop
{
for(hun = 0; hun<10; hun++) //for loop for 100's place
{
for(ten = 0;ten<10;ten++) //for loop for 10's place
{
for(one=0; one<10; one++) //for loop for 1's place
{
for (dig =0; dig<10;dig++)
{
PORTD = 0x04; // enable 1st 7 segment display
PORTA = seg_7[hun]; // output hex code for 100's place value
_delay_ms(10); // 10 msec delay

PORTD = 0x02; // enable 2nd 7 segment display


PORTA = seg_7[ten]; //
_delay_ms(10); // 10 msec delay

PORTD = 0x01; // enable 3rd 7 segment display


PORTA = seg_7[one]; //
_delay_ms(10); // 10 msec delay
}
}
}
}
}
return 0;
}
Result:

3 seven segment displays in multiplexed fashion have been interfaced with AVR
microcontrollerand displayed continuous count from 000 to 999.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy