How to Interface 14-Segment using 8051 Microcontroller

CIRCUIT DIAGRAM

DESCRIPTION

In this circuit we are using 14-segment to show characters.14-segments have 22 pins, with the help of these pins we can write characters on 14 segment. 8 pins A,B,C,D,E,F,K,M are connected to P2 port, 6 pins N,P,R,S,T,U are connected with P3 port & 8 pins are connected with P1 port.

PROJECT CODE

#include<reg51.h>

void delay()
{
TMOD=0x01;
TH0=0xF8;
TL0=0xCD;
TR0=1;
while(TF0==0);
TR0=0;
TF0=0;
}

void main()
{

P1=0x7F; //FOR FIRST CHARACTER
P2=0x9C;
P3=0x44;
delay();

P1=0xBF; //FOR SECOND CHARACTER
P2=0x9C;
P3=0x00;
delay();

P1=0xDF; //FOR THIRD CHARACTER
P2=0x00;
P3=0x00;
delay();

P1=0xEF; //FOR FORTH CHARACTER
P2=0xCC;
P3=0x64;
delay();

P1=0xF7; //FOR FIFTH CHARACTER
P2=0xFC;
P3=0x00;
delay();

P1=0xFB; //FOR SIXTH CHARACTER
P2=0x9C;
P3=0x00;
delay();

P1=0xFD; //FOR SEVENTH CHARACTER
P2=0x0C;
P3=0xA4;
delay();

P1=0xFE; //FOR EIGHTH CHARACTER
P2=0xB4;
P3=0x44;
delay();

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s