Hi Friends,

In last tutorial we discussed about Multiplexing Seven Segment Displays. So you must be very much familiar with the theory. Now let us write the code and design a small project that will make you expert in using these displays in your own projects. We will make a system that can display any number between
0-9999 using four of these displays. We will design a function Print() that we can use on latter projects to easily write integers onto displays. Once we have successfully tested this function we can add to to any project without any problem. This concept of code reuse will make bigger project both easy to
make and far less painful. In this sample project we will test our function by using it in a loop to print all numbers from 0-9999.

	for(i=0;i<10000;i++)
	{
		Print(i);
		Wait();
	}

Things Required

S. No. Item Image
1

28 PIN AVR Dev Board

Contains the core AVR circuit including 5v regulator, reset, ISP.

AVR Development Board
2

Seven Segment Display Module

Four common anode displays multiplexed with driver transistors and current limiting resistors.

Seven Segment Board
3

Single Pin Female to Female Burg Wires

Used to interconnect the two boards

 

Burg Wires
4

USB AVR Programmer

To upload the program to the development board.

USB AVR Programmer

These are all the things required to get started with seven segment displays. The development board and the programmer can be used with many other projects to! While the seven segment board is handy for all projects requiring numeric displays.

Making !

Connect the seven segment board with the development board using the cables as per the table below.

  Seven Segment Board 28 PIN AVR Dev Board
  A PD0
  B PD1
  C PD2
  D PD3
  E PD4
  F PD5
  G PD6
  DO (DOT) PD7
  C1 PB3
  C2 PB2
  C3 PB1
  C4 PB0
  GND GND

 

seven segment board and 28pin avr dev board

Fig. Seven Segment Display Setup

The Circuit Diagram.

seven segment multiplexed display schematic

Fig – Multiplexed Seven Segment Displays.

The Code


/*

Description: Program to demonstrate the use of Seven

Segment Displays In Multiplexed Mode.
________________________________________________________

Author: Avinash Gupta
Date: 11 Oct 08
Updated:
Web: www.eXtremeElectronics.co.in


*/

#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay_basic.h>

%0