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
Visit site
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:

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;
 
    }
}

 

hi jayanth

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

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…