## Wednesday 13 June 2012

### BCD TO SEVEN SEGMENT DISPLAY EMBEDDED C

BCD TO SEVEN SEGMENT DISPLAY

THEORY:
A 7-segment display is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information.
The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top, middle, and bottom. The segments of a 7-segment display are referred to by the letters A to G, where the optional DP decimal point (an "eighth segment") is used for the display of non-integer numbers.

 BCD I/P SEGMENT O/P DISPLAY g f e d c b a 0   0   0   0 0 1 1 1 1 1 1 0 0   0   0   1 0 0 0 0 1 1 0 1 0   0   1   0 1 0 1 1 0 1 1 2 0   0   1   1 1 0 0 1 1 1 1 3 0   1   0   0 0 1 1 0 0 1 1 4 0   1   0   1 1 1 0 1 1 0 1 5 0   1   1   0 0 0 1 1 1 1 1 6 0   1   1   1 0 0 0 0 1 1 1 7 1   0   0   0 1 1 1 1 1 1 1 8 1   0   0   1 1 1 0 0 1 1 1 9

CIRCUIT SCHEMATIC & OUTPUT:

PERIPHERAL OUTPUT:
SOURCE CODE:

#include<regx51.h>
sfr out=0xA0; //P3
sfr inp=0x90; //P1
unsigned char temp;
unsigned char const lookup[10]=
{0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};

void main()
{
out=0x00;
inp=0xFF;
while(1)
{
temp=inp & 0x0F;
if(temp>=0x0A)
out=0x00;
else
out=~(lookup[temp]);
}
}

1. 2 digit temperature display with one decimal point using 7 segment.
If temp1> 20c, only LED 1 ON
If temp1> 25c, only LED 1 AND LED2 ON
If temp1> 30c, All LED ON

How to do this kind of question using uversion5(keil)?

Please help me by getting the coding using uversion(keil)...so that I can run the simulation in proteus sir.

2. 2 digit temperature display with one decimal point using 7 segment.
If temp1> 20c, only LED 1 ON
If temp1> 25c, only LED 1 AND LED2 ON
If temp1> 30c, All LED ON

How to do this kind of question using uversion5(keil) to run simulation in proteus(stm32f103c6)?

Please help me by getting the coding using uversion(keil)...so that I can run the simulation in proteus