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.

how to blink a digit in multiplexed 7 segment display?

Status
Not open for further replies.

Sajjadkhan

Full Member level 5
Joined
Sep 25, 2010
Messages
307
Helped
17
Reputation
34
Reaction score
16
Trophy points
1,298
Location
Rawalpindi,Pakistan
Activity points
4,199
I have 8 segment displays, left four of them would be representing voltage and right four would be displaying current. i have made a prototype board to check it. there are two values i.e. current and voltage but all displays are multiplexed togeather. now i want to interface a rotary encoder and when i push a button then a digit starts to blink and by turning the encoder you can set it as in power supplies. for now my concern is how to blink a selected digit?

One way to do it by using timer, but i am not sure, i want to know the optimal technique for doing it. thanks.

I am handling two digits at the same time as it would be more efficient.

Code:
sbit SEGA at RC7_BIT;
sbit SEGB at RC6_BIT;
sbit SEGC at RC5_BIT;
sbit SEGD at RC4_BIT;
sbit SEGE at RD3_BIT;
sbit SEGF at RD4_BIT;
sbit SEGG at RD5_BIT;
sbit DP at RD2_BIT;
sbit D1 at RB5_BIT;
sbit D2 at RB4_BIT;
sbit D3 at RB3_BIT;
sbit D4 at RB2_BIT;
sbit D5 at RB1_BIT;
sbit D6 at RB0_BIT;
sbit D7 at RD7_BIT;
sbit D8 at RD6_BIT;

void zero();
void one();
void two();
void three();
void four();
void five();
void six();
void seven();
void eight();
void nine();

void Dig1();
void Dig2();
void Dig3();
void Dig4();



void main() {

TRISB = 0;
TRISC = 0;
TRISD = 0;

while(1)
{
one();
Dig4();
Dig1();
Dig2();
Dig3();
}

}


void zero()
{
SEGA = SEGB = SEGC = SEGD = SEGE = SEGF = 1;
SEGG = 0;
}
void one()
{
SEGA = SEGD = SEGE = SEGF = SEGG =0;
SEGB = SEGC = 1;
}
void two()
{
SEGA = SEGB = SEGD = SEGE = SEGG =1;
SEGC = SEGF = 0;
}
void three()
{
SEGA = SEGB = SEGC = SEGD = SEGG = 1;
SEGE = SEGF =0;
}
void four()
{
SEGB = SEGC = SEGF = SEGG = 1;
SEGA = SEGD = SEGE = 0;
}
void five()
{
SEGA = SEGC = SEGD = SEGF = SEGG = 1;
SEGB = SEGE = 0;
}
void six()
{
SEGA = SEGC = SEGD = SEGE = SEGF = SEGG = 1;
SEGB = 0;
}
void seven()
{
SEGA = SEGB = SEGC = 1;
SEGD = SEGE = SEGF = SEGG = 0;

}
void eight()
{
SEGA = SEGB = SEGC = SEGD = SEGE = SEGF = SEGG =1;
}
void nine()
{
SEGA = SEGB = SEGC = SEGD = SEGF = SEGG = 1;
SEGE = 0;
}

void Dig4()
{
 D1 = D5 = 1;
 D2 = D6 = 0;
 D3 = D7 = 0;
 D4 = D8 = 0;
}
void Dig3()
{
 D1 = D5 = 0;
 D2 = D6 = 1;
 D3 = D7 = 0;
 D4 = D8 = 0;
}
void Dig2()
{
 D1 = D5 = 0;
 D2 = D6 = 0;
 D3 = D7 = 1;
 D4 = D8 = 0;
}
void Dig1()
{
 D1 = D5 = 0;
 D2 = D6 = 0;
 D3 = D7 = 0;
 D4 = D8 = 1;
}

 

no extra circuitry is required just send 0xff to OFF the digit and the then send the data to be displayed to that specific 7 segment display and repeat it for the times you want to blink the digit. it is an easiest way as i have implemented it with my 7 segments displays to blink the digits. BTW what microcontroller are you using?
 

There is no need to use up another timer for blinking. Just count the number of times the refreshing cycle is called and after a certain number blank the display when the refreshing sequence reaches this number instead of drawing it. After another number of cycles reset the counter so that the number will be refreshed again.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top