+ Post New Thread
Results 1 to 7 of 7

14th June 2019, 21:00 #1
 Join Date
 Apr 2018
 Posts
 45
 Helped
 0 / 0
 Points
 443
 Level
 4
Best Solution to use DOT POINT by REVERSING 3rd. one Digit of 4digit seven segment
I want to make a RTC clock with 4digit 7seg disp which will display " HH:MM " in multiplex tech.
I have 4 nos digit and each are of CA type. As the each singledigit has one DP and which is located on right side of the digit.
As of " HH. " (Hten, Hone , .Single Dot) is Ok and I have no problems, But to get one more Dot on upper portion to form remaining " :MM ", I nedd to invert Mten.
Sample COUNTER code is here, and tested the digit(SEGMENTS AND CA are connected to ULN Driver IC).
Code:#include
//***Define the signal pins of all four displays***// #define s1 RC0 #define s2 RC1 #define s3 RC2 #define s4 RC3 //***End of definition**//// void main() { unsigned int a,b,c,d,e,f,g,h; //just variables int i = 0; //the 4digit value that is to be displayed int flag =0; //for creating delay unsigned int seg[]={0X3F, //Hex value to display the number 0 0X06, //Hex value to display the number 1 0X5B, //Hex value to display the number 2 0X4F, //Hex value to display the number 3 0X66, //Hex value to display the number 4 0X6D, //Hex value to display the number 5 0X7D, //Hex value to display the number 6 0X07, //Hex value to display the number 7 0X7F, //Hex value to display the number 8 0X6F //Hex value to display the number 9 }; //End of Array for displaying numbers from 0 to 9/// FOR CC// FOR CA WITH ULN //*****I/O Configuration****// TRISC=0X00; TRISD=0x00; PORTC=0X00; //***End of I/O configuration**/// #define _XTAL_FREQ 20000000 while(1) { //***Splitting "i" into four digits***// a=i%10;//4th digit is saved here b=i/10; c=b%10;//3rd digit is saved here d=b/10; e=d%10; //2nd digit is saved here f=d/10; g=f%10; //1st digit is saved here h=f/10; //***End of splitting***// PORTD=seg[g];s1=1; //Turn ON 'Hten' __delay_ms(5);s1=0; //Turn OFF PORTD=seg[e];s2=1; //Turn ON 'Hone' __delay_ms(5);s2=0; //Turn OFF PORTD=seg[c];s3=1; //Turn ON 'Mten' >> This digit want to inverse to get the DP upper left side>> __delay_ms(5);s3=0; //Turn OFF PORTD=seg[a];s4=1; //Turn ON 'Mone' __delay_ms(5);s4=0; //Turn OFF if(flag>=10) { i++;flag=0; } flag++; } }
should i declare ONE MORE ARRAY with appropriate elements(namely, revese_seg[]) like above //seg[] and load it to PORTD only for this digit..
Code:PORTD=reverse_seg[c];s3=1; //Turn ON 'Mten'
Or can be done something else from Hardware side by changing wire connection of segments for this digit other that software site ?
Tnx

Advertisement

14th June 2019, 21:56 #2
 Join Date
 Jul 2010
 Location
 Sweden
 Posts
 913
 Helped
 360 / 360
 Points
 6,977
 Level
 19

14th June 2019, 21:57 #3
 Join Date
 Jan 2019
 Posts
 238
 Helped
 47 / 47
 Points
 1,150
 Level
 7
Re: Best Solution to use DOT POINT by REVERSING 3rd. one Digit of 4digit seven segme
since the colon is always on, or blinks the seconds, why not use a pair of LEDs
mounted between the hour and minutes?
then you don't have to rotate minute 10, invent new connections for 0 through 9,
and the minutes will be as straightforward as the hours

Advertisement

14th June 2019, 23:30 #4
 Join Date
 Apr 2018
 Posts
 45
 Helped
 0 / 0
 Points
 443
 Level
 4
Re: Best Solution to use DOT POINT by REVERSING 3rd. one Digit of 4digit seven segme
tnx.
Adding one more array in code is the correct way? or wire rearrange is correct??
Yes, you can rearrange the connections to the reversed Mten so it behaves like the other digits.
Code:Mten Pin:>> Dataline pin for all three digit(HH: Mone) A>> should it on: DD: D B>> FF: F C>> EE: E D>> AA: A E>> CC: C F>> BB:B G>> GG: G
tnx

Yesterday, 04:49 #5
 Join Date
 Jan 2019
 Posts
 238
 Helped
 47 / 47
 Points
 1,150
 Level
 7
Re: Best Solution to use DOT POINT by REVERSING 3rd. one Digit of 4digit seven segme
for a standard 7 segment display, top to bottom
horizontal A, G, D
left side F, E
right side B, C
decimal point lower right
for a standard 7 segment display, rotated 180 degrees, top to bottom
horizontal D G A
left side C, B
right side E, F
decimal point upper left
0 ABCDEF ABCDEF same
1 BC EF
2 ABGED ABGED same
3 ADGBC ADGEF
4 GCBF GFEC
5 AGDBC AGDEF same
6 DGEF AGBC
7 ABC DEF
8 ABCDEFG ABCDEFG same
9 AGFBC DGCEF
if you rewire so that B and E are swapped, C and F are swapped, and A and D are swapped,
the numbers come out correct.
0, 2, 5 and 8 are correct regardless
the swap compensates for the rotation
the decimal point is still the decimal point
program for M 10 is same as all the other numbers (H 10, H1, & M1)

Advertisement

Yesterday, 06:38 #6
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 44,651
 Helped
 13586 / 13586
 Points
 256,089
 Level
 100
Re: Best Solution to use DOT POINT by REVERSING 3rd. one Digit of 4digit seven segme
Why not simply rewire the segments instead of writing software?

Today, 02:42 #7
 Join Date
 Jan 2019
 Posts
 238
 Helped
 47 / 47
 Points
 1,150
 Level
 7
Re: Best Solution to use DOT POINT by REVERSING 3rd. one Digit of 4digit seven segme
I didn't check the power/ground connections.
So when you rotate M10, you'll have to take care of that.
It looks like a little rewiring will solve the problem
+ Post New Thread
Please login