• Please review our updated Terms and Rules here

At89S52 (8051) seven segment multiplexing

Pt68k5

Experienced Member
Joined
Feb 18, 2010
Messages
58
Hello I have a board that is missing its micro-controller, I am trying to recreate it from scratch
It has 24 seven segment displays and 64 leds to show status
each row has a data latch and has 4 driver transistors to turn on and off the displays
It would receive a serial data stream and then decode it and sent it to the displays
Attached is some code I have tried and can only get the first seven segment to count
 

Attachments

  • seg7.zip
    980 bytes · Views: 5
You don't appear to be adjusting your row and column lines to select a different digit. You appear to be outputting the data for all of the digits, but this data will go to the same display that has been statically selected by the row and column lines.

Dave
 
Hello I have this that was working for counting on four 7 segment displays now I am trying to get it working for 8 7 seven segment displays
it has this error and I have not been able to fix it.
8ACROSS_NEW2.C(182): error C141: syntax error near 'else'

Any help would be great
 

Attachments

  • 8Across_new2.zip
    786 bytes · Views: 3
The compiler is spotting you have missed an else if(turn==n) out...

Look at the structure:

else if(turn==3)
{
}
{
}
else if(turn==@)

I also observe that the setting of the variable turn within the if conditional is also inconsistent, so there are some logical errors that will prevent this code from working correctly after you get it through the compiler.

You would also be better off restructuring the ladder of if statements with a switch(turn) statement and then use a case clause to select each option.

An even better construct would be a for loop and a preset structure array for the configuration data. This would reduce your code to a few lines. With the lines of code you get rid of, you can replace them with lines of descriptive comments...

Dave
 
Back
Top