Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Writting to Buffer for LEd display...

Status
Not open for further replies.

koolguy

Active Member
Hi,

I need to some changes this code, to make this free from char count while writing to display..
i am using 13 char for writing in array, the problem in this code is that while if char is less than or more than 13 the method is not working so, i have to count character all times..
need your help for making free from counting...

Code:
display(" Test.....");

 display(char *str)   
{

int addr;                                                      
int z;
while(*str!=0){

 addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=0;z<5;z++){
        leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=6;z<11;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=12;z<17;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=18;z<23;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=24;z<29;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=30;z<35;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=36;z<41;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=42;z<47;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=48;z<53;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=54;z<59;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=60;z<65;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=65;z<70;z++){
leds[z] = Font2[addr+y];
y++;
}

addr = ((int)*str++ - 0x20); 
addr *= 5;
int y=0;
for(z=71;z<76;z++){
leds[z] = Font2[addr+y];
y++;
}
}


}
 
Hi again,

I am working 1x3 feet LED display 3mm Led is best for pixel than 5mm, any way the font used ~5x7 wil be smaller for it should i make one pixel by 4 Led or changing the font for bold letter visible from far 10 to 20 feet at least. o but the problem will be on scanning can we add another uC with it for fast scanning to avoid loss of led brightness.
but how to add another uC ??should the buffer be divided into two halves?
I will use row scanning not that row section scanning.
one thing more keyboard interface will be done .

need your suggestion for this projects..
 
I have always said... If you make several modules... ie.. pic16f676 and a 8x8 LED you can control them all on the SPI bus from one main processor...

You can then add them as you need to...

Just for scrolling it will be very costly to consumer using so many uC just scrolling can't we do another thing as i have seen in market they use single uC with other chip like shift register and drivers..
 
Just for scrolling it will be very costly to consumer using so many uC just scrolling can't we do another thing as i have seen in market they use single uC with other chip like shift register and drivers..

How? 16 X 64 doubling up the led's... 16 * 64 will only be 16 modules... 16 pic16f88 will only cost a little?
 
How? 16 X 64 doubling up the led's... 16 * 64 will only be 16 modules... 16 pic16f88 will only cost a little?

OK, we will do with 8x64 for this can't we do with <two uC's??
i need only scrolling no animation/graphics.
OK, can you tell me the procedure of dividing buffer in two half's left and right for 8x32 and 8x32?
 
OK, we will do with 8x64 for this can't we do with <two uC's??
i need only scrolling no animation/graphics.
OK, can you tell me the procedure of dividing buffer in two half's left and right for 8x32 and 8x32?

You could do that with the pic16f877a.... Just use two ports instead of one, and two screen buffers.

Or one screen buffer then split the output
 
You could do that with the pic16f877a.... Just use two ports instead of one, and two screen buffers.

Or one screen buffer then split the output

Hi again,

OK, what will be be procedure and i will do scanning with all column shorted and rows ..because there was problem while making PCB in row section..
 
If you take the code I wrote "as is" .. Just double the buffer ( change the plot pixel routine clipping values ) Then when the screen blitting takes place one can be offset by half the screen size..

1 more line of code to output to port D ( or whatever )
 
I will not prefer that row section scanning, what to do for making it row scanning as you provided that anim file i was running it in column but how to transfer it in to column
 
can't we use 2 uC for 8x32 and another 8x32 in series.

Yes!! You can do it any way you want.... You need to make it easy for yourself.... If it's too complicated you will be struggling again...
 
OK, but how to divide the buffer and the file you gave for anim in another thread for animation i want to convert it for column is there any method then doing manually..
 
Do yourself a favour..... Read the datasheet on the KS0107 LCD controller.. This is EXACLTLY how I configured the LED's You will see that the column scanning is how it's achieved.... Then notice that the screen is in two parts controlled by CS1 and CS2 Chip select 1 and 2.... You just write to the relevant side.
 
Just for scrolling it will be very costly to consumer using so many uC just scrolling can't we do another thing as i have seen in market they use single uC with other chip like shift register and drivers..

There are customized chips using that, which is the HT1632C, but these are SMD and you need to prepare a circuit board for this one.

Or, chain up the LED matrixes using the Max7219. It saves a lot of time too. :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top