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.

seven segment display withmultiplexing

Status
Not open for further replies.

MKVRAJU

Junior Member level 2
Joined
Jun 14, 2013
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Activity points
160
hi
i am using PIC30F5011,

I want to display like 12 on SSDs,i have two SSD's with commaon anode and both common's are connected to Two NPN tranistor .some one suggested me use multiplexing,i am using PORTB0 to PORTB7 for SSD's..SSD pins are connected both SSD's are same.D5 and D1 are transistor pins .i try a code.can any one suggested me how to display different numbers like12.
<code>
unsigned int i=12,t;
while(1)
{
delay_5miliseconds{}
t=i%10;
SSD1(t);
LATDbits.LATD5=1;
LATDbits.LATD1=0;

delay_5milliseconds();
t=(i/10)%10;
SSD1(t);
LATDbits.LATD5=0;
LATDbits.LATD1=1;
}
void SSD1(unsigned int x)
{
switch(x)
{
case 0: LATB=0b10001000;
delay();

case 1: LATB=0b10111110;

break;
case 2: LATB=0b11000100;

break;
case 3: LATB=0b10010100;

break;
case 4: LATB=0b10110010;

break;
case 5: LATB=0b10010001;

break;
case 6: LATB=0b10000001;

break;
case 7: LATB=0b10111100;

break;
case 8: LATB=0b10000000;

break;
case 9: LATB=0b10010000;

break;
}

}
<code>
 
Last edited:

Joined
Dec 4, 2012
Messages
4,294
Helped
822
Reputation
1,654
Reaction score
793
Trophy points
1,393
Location
Bangalore, India
Activity points
0
I haven't checked you SSD mask values inside Switch statement.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
unsigned char i = 12;
 
while(1) 
{ 
    
    SSD1(i % 10);
    LATDbits.LATD5 = 1;
    LATDbits.LATD1 = 0;
 
    delay_5milliseconds();
    LATDbits.LATD5 = 0;
    LATDbits.LATD1 = 0;
    
    SSD1(i / 10);
    LATDbits.LATD5=0;
    LATDbits.LATD1=1;
    delay_5milliseconds();
 
    LATDbits.LATD5 = 0;
    LATDbits.LATD1 = 0;
 
}
 
void SSD1(unsigned int x)
{ 
    switch(x)
    {
        case 0: LATB = 0b10001000;
            break;
 
        case 1: LATB = 0b10111110;
            break;
 
        case 2: LATB = 0b11000100;
            break;
 
        case 3: LATB = 0b10010100;
            break;
 
        case 4: LATB = 0b10110010;
            break;
 
        case 5: LATB = 0b10010001;
            break;
 
        case 6: LATB = 0b10000001;
            break;
 
        case 7: LATB = 0b10111100;
            break;
 
        case 8: LATB = 0b10000000;
            break;
 
        case 9: LATB = 0b10010000;
            break;
 
    }
}

 

MKVRAJU

Junior Member level 2
Joined
Jun 14, 2013
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Activity points
160
hi jayanth

inside switch there is no problem,but i want display 12.can you tel you about code
 

MKVRAJU

Junior Member level 2
Joined
Jun 14, 2013
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Activity points
160
yes,buts is shows on both display 1
 

Joined
Dec 4, 2012
Messages
4,294
Helped
822
Reputation
1,654
Reaction score
793
Trophy points
1,393
Location
Bangalore, India
Activity points
0
https://electronicexperiments.blogspot.in/2010/10/lesson-nr11-7segment-in-multiplexed_17.html

https://embedded-lab.com/blog/?p=2086


98020d1383391001-2dssd.png
 

Attachments

  • XC8.rar
    79.7 KB · Views: 7
  • 2dssd.png
    2dssd.png
    32.2 KB · Views: 35

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top