Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with Seven Segment Display

Status
Not open for further replies.

itachi012587

Junior Member level 2
Joined
Jun 9, 2008
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,441
problem of 7 segment display

Hi,
Does anyone have an idea on how to display the analog conversion into seven segment?

Thank you.
 

7 segment display to analog signal

hi,
I think you can chose AT89C51 to process the analog signal then output seven segment to led.
goodluck!
 

which kind of analong conversion u want to display,if u want to do "analog to digital conversion",use adc, give its input to 7 sagment display driver then use 7 sagment
 

As a first step you need to do a analog to digital conversion, this can be accomplished by using external ADC or using a microcontroller with internal ADC.
As a second issue you need to know the requested resolution of the ADC, PIC microcontroller have 10 bit ADC which is easy to use, after that make sure that your input signal dynamic is fitted into the ADC input range (may be you've to do some attenuation or amplification).
After this step you've a digital word that is representative of the analog voltage/current applied to your DAC, last things is how to show it on a 7 segment led display.
There is many way to do this, one is to use the multiplexing approach, in this type of visualization you have a common bus for every display and separate line to activate each display, one a time. To avoid flickering into the display you need also to refresh every one 100 or 200 times every cycle.
By using a microcontroller is very simple to translate the converted word in a BCD format and then translate it into the corrisponding 7 segment code by a simple lookup table or, if you like C language, in a switch-case statement.

Here one example about the needed hardware (show for two display, expand it by adding more display and driving transistor to fit your need), as programming language use what you prefer, assembly, C or other one. For sure C usage is more easy than assembler and also more simple to debug.

https://www.mikroe.com/en/books/picbook/7_08chapter.htm

As a side note look at the display there is two type, common anode and common catode.

Hope this can help a little.

Bye
Powermos
 

Tekut eplained more clearly .. i hope u got it.....

first u convert analog input into digital if u go for pic its better u need not additional component...
PIC has inbuilt ADC with 10 bit resolution ( i think u not needed 12 bit in this stage.. if u need u can go for PIC 18f2423 ..

GIVE analog input to Port A pin and get Digital value u can .. display this value in Hex format in 7SEG display ..
if ur using 2 digiit or 3 digit its litle bit complex... it takes paralllel data for each digit( IF u dont hav enough pins)...
so u need to switch to Each digit hundreds of time for every instruction cycle time.

i am sending sample code for thi si hope it wil helpful to u ..


#include <pic.h>
#include "delay.h"
#include "delay.c"


unsigned char n,d,count=0;
unsigned char a,b,c;

void keypadscan();
void display();
void disp_dig(char );

void main()
{
d=123;

while(1)
{
n=d;
display();
//keypadscan();
}
}

void display() // DISPLAYING all DIGITS

{
TRISB=0; // Configured PORTB as OUTPUT
TRISD=0; // Configured PORTD as OUTPUT
if(count==0)
{
a=n%10; n=n/10; // a=3
b=n%10; n=n/10; // b=2
c=n%10; n=n/10; // c=1
count=1;
}
disp_dig(c);
PORTD=0x01; // SD1 ON
DelayUs(200); // 100-200 usecond.......... to avoid flickering

disp_dig(b);
PORTD=0x02; //SD2 ON
DelayUs(200);

disp_dig(a);
PORTD=0x04; //SD3 ON
DelayUs(200);

}

void disp_dig(char k)
{
switch(k)
{
case 0:{ PORTB=0X3F; break; }
case 1:{ PORTB=0X06; break; }
case 2:{ PORTB=0X5B; break; }
case 3:{ PORTB=0X4F; break; }
case 4:{ PORTB=0X66; break; }
case 5:{ PORTB=0X6D; break; }
case 6:{ PORTB=0X7D; break; }
case 7:{ PORTB=0X07; break; }
case 8:{ PORTB=0X7F; break; }
case 9:{ PORTB=0X6F; break; }
}

}
 

use look-up table to convert the number into 7-segment-friendly 8 bit numbers
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top