fbpx

Interface Sevensegment With AVR

Description

A seven segment display is use to display digits from 0-9.Seven segment display widely used in digital clocks,weight machine, Ph meters etc.

The common configuration has an array of eight leds arranged to display these digits.Led is assigned a name from a to h and is identified by its name. Seven leds a to g are used to display the numerals while eighth led h is used to display the dot/decimal.

Direction Table

Hardware Required

  • 7Segment Display.
  • Atmega16 MicroController.

Circuit

Virtual Circuit

Code

 #include <avr/io.h>
 #include <util/delay.h>
 int main(void)
 {
 DDRC=0xff;
 while(1)
 {
 PORTC=0X3F;
 _delay_ms(500);
 PORTC=0X06;
 _delay_ms(500);
 PORTC=0X5B;
 _delay_ms(500);
 PORTC=0X4F;
 _delay_ms(500);
 PORTC=0X66;
 _delay_ms(500);
 PORTC=0X6D;
 _delay_ms(500);
 PORTC=0X7D;
 _delay_ms(500);
 PORTC=0X07;
 _delay_ms(500);
 PORTC=0X7F;
 _delay_ms(500);
 PORTC=0X67;
 _delay_ms(500);
 }
 } 

Leave a Reply

Your email address will not be published. Required fields are marked *