Sonsivri

Electronics => General Electronics => Topic started by: saber on January 09, 2006, 12:04:30 12:04



Title: How to multiplex 4 Anode Com Seven Segement with one port of 8051 in assembly ?
Post by: saber on January 09, 2006, 12:04:30 12:04
Hi to all
I build following circuit in the Proteus VSM
(http://tinypic.com/jzv9ea.png)
I want use this circuit for multiplexing 4 Anode Com Seven Segement
with one port of AT89C51 microcontroller in assembly language
That showing  the " 2006 " number in the seven segement
I write the program in the assembly language but it not working properly
and I not see the " 2006 " number in the seven segements fixedly
and the seven segements are on and off alternately

I upload the my project's files ( .ASM - .HEX - .DSN ) in following address
http://rapidshare.de/files/10706839/AT89C51_Multiplex_Displays.zip.html
You can download it and see my project

Anybody can write this program in the assembly language ?
Please help me
Thanks a lot :)


Title: Re: How to multiplex 4 Anode Com Seven Segement with one port of 8051 in assembl
Post by: xatax on April 16, 2007, 02:30:54 14:30
File not found. Please re-upload !!!

Best regards.


Title: Re: How to multiplex 4 Anode Com Seven Segement with one port of 8051 in assembly ?
Post by: zuisti on April 17, 2007, 04:18:34 16:18
Please to consider the multiplexed displaying works in the "human eyes" only, beacuse it displays one digit at a time. Press "pause" at times in the Proteus simulation...
zuisti


Title: Re: How to multiplex 4 Anode Com Seven Segement with one port of 8051 in assembly ?
Post by: Dom on April 17, 2007, 04:35:53 16:35
Yes, as zuisti said, you must take the 4 seven segment panel especially used for the multiplexed display like in the example of Proteus (read the help of the four digit component).


Title: Re: How to multiplex 4 Anode Com Seven Segement with one port of 8051 in assembly ?
Post by: sukumar on June 26, 2007, 01:48:27 13:48
Use the following code, The diagram should be modified as per the following code.
ie:PORT2 is DATA port (all the 8 bits) P0=control bits
Code:
#include<reg51.h> 

void send_seg(int,int,int,int);
unsigned char n=1;
unsigned char thou=2,hun=0,ten=0,single=6;
unsigned char a[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
void DelayMs(unsigned char);

void main()
{

P0=P2=0;
while(1)
{
send_seg(thou,hun,ten,single);
}
}

void send_seg(int thou,int hun,int ten,int single)
{
if(n==1)
{
P0=0x08;
P2=a[single];
n=2;
DelayMs(5);
}
else if(n==2)
{
P0=0x04;
P2=a[ten];
n=3;
DelayMs(5);
}
else if(n==3)
{
P0=0x02;
P2=a[hun];
n=0;
DelayMs(5);
}
else
{
P0=0x01;    
P2=a[thou];
n=1;
DelayMs(5);
}
}

void DelayMs(unsigned char Ms)
{
int i;
for(i=0;i<Ms*48;i++);
}[/code