8x32 LED matrix with 74HC154

Status
Not open for further replies.
change the code :
unsigned char display [1] = {1};
with this :
unsigned char display [1] = {0};
because we only have one character,. if we have 5 character the value is between 0 - 4.
 

change the code :
unsigned char display [1] = {1};
with this :
unsigned char display [1] = {0};
because we only have one character,. if we have 5 character the value is between 0 - 4.

Ok I'll update now
 

change the code :
unsigned char display [1] = {1};
with this :
unsigned char display [1] = {0};
because we only have one character,. if we have 5 character the value is between 0 - 4.

If I want to scroll the character from to the left ? Do you have idea ? shif [4] 0-3 ?
 

If I want to scroll the character from to the left ? Do you have idea ? shif [4] 0-3 ?

Of course i have :-D
Now you have understood how to make a static display, for develop it, that's your homework.
My clue, to make animation we have to show and change different pictures fast, like cartoon movie, consider fps.
Keep moving! Good luck.
 

Of course i have :-D
Now you have understood how to make a static display, for develop it, that's your homework.
My clue, to make animation we have to show and change different pictures fast, like cartoon movie, consider fps.
Keep moving! Good luck.

How to make it in order ? for example I want to display 0 and 2 on the left hand side only, because I get 0 2 0 2, but I define on font only 2 and 0....I want to display two characters but 4 are displayed ?
 

Great! You have done it. My advice, to develop high performance display, change 74HC154 with shift register (74164, 4094 or 74HC595), because the brightness of LED will be reduce if you add more columns. For your 8x32 display, each LED only works at 1/32 of full power. If you use shift register, although your display are 8x64,8x128, ... , your display still works at 1/8 of full power.
 

How can I make only two displayed or for example 0 1 2 3 ? add the font and automatically 4 digits will be displayed ? I don't have those shift register, I need to buy later..
 

do you have a link for 74HC595 circuit design?
 
Last edited:

to display two digits only 1 9 _ _ ( _ = blank ), fill variable with 1, 9, 10, 10
to display two digits only 3 _ 5 _ ( _ = blank ), fill variable with 3, 10, 5, 10
use 11 chars font.
 

to display two digits only 1 9 _ _ ( _ = blank ), fill variable with 1, 9, 10, 10
to display two digits only 3 _ 5 _ ( _ = blank ), fill variable with 3, 10, 5, 10
use 11 chars font.

like this :
Code:
code unsigned char font[88]=
   {
	//	  0	  1	   2    3	 4    5	   6	7	 8	  9	  blank
		0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00, 
		0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00,
		0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00,
		0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00,
		0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00,
		0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00,
		0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00,
		0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00
	};
 

Next time, fix this project first.

Yes.
For displaying 0 1 2 3 ?

Code:
code unsigned char font[80]=
   {
    //   0     1   2    3     4    5   6    7     8    9
        0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,
        0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,
        0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,
        0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,
        0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,
        0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,
        0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,
        0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E
    };

unsigned char display [10] = {0,1,2,3,10,10,10,10,10,10};


---------- Post added at 14:20 ---------- Previous post was at 14:14 ----------


Result in the display is 1 0 1 0......why is that ?
 

if you want to use 8x8 format, 11 char supported (0-9 and blank), you have to change your font array like this :
Code:
code unsigned char font[88]=
   {
    //   0     1   2    3     4    5   6    7     8    9    10
        0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00,
        0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00,
        0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00,
        0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00,
        0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00,
        0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00,
        0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00,
        0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00
    };

unsigned char display [4] = {0,1,2,3};
 
Last edited:


I used the loop :

Code:
for (x=0;x<4;x++) //4 characters
.
.
.
a=(y*4)+display[x];
.
.
.

and the result is strange character......??
 


And

Code:
 for (x=0;x<4;x++) //4 characters
			{
				for (y=0;y<8;y++ ) //each character contains 8 cols.

.
.
.
a=(y*11)+display[x];

Give me result 0 1 0 1 ??

Why is that ?
 

Sorry late to reply. I just come from the outside.
Try and watch this code :
Code:
void main() {
unsigned char a;
unsigned char x;
unsigned char y;
code unsigned char font[88]=
   {
    //   0     1   2    3     4    5   6    7     8    9    10
        0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00,
        0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00,
        0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00,
        0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00,
        0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00,
        0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00,
        0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00,
        0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00
    };

unsigned char display [4] = {0,1,2,3};

  do {
for (x=0;x<4;x++) //4 characters
{
for (y=0;y<8;y++ ) //each character contains 6 cols.
{
a=(x*8)+y;
if (a<16) //only for 16 condition (0-15)
{
P2=2; //CS1 and CS2 of 74HC154 chip 1 =0, CS1 and CS2 of 74HC154 chip 2 =1
P1=15-a;
a=(y*11)+display[x];
P3 = font[a];
delay_us(500); //or delay_us(500); try the best view
}
else
{
if (a<32)
{
P2=1; //CS1 and CS2 of 74HC154 chip 1 =1, CS1 and CS2 of 74HC154 chip 2 =0

P1=31-a;
a=(y*11)+display[x];
P3 = font[a];
delay_us(500); //or delay_us(500); try the best view
};
};
};
};


  } while(1);         // Endless loop
};
 


Ok I will try now and see what happened...

---------- Post added at 23:08 ---------- Previous post was at 23:01 ----------


It displays a strange characters, looks like it's overwritten.....????

---------- Post added at 23:10 ---------- Previous post was at 23:08 ----------

Code:
for (x=0;x<4;x++) //4 characters
			{
				for (y=0;y<8;y++ ) //each character contains 8 cols.
				{
					
					a=(x*8)+y; // 8 cols
					if (a<16) //only for 16 condition (0-15)
						{ 
						    E1=0;
							E2=1;
							P1=15-a;
							//a=(y*10)+display[x];
							a=(y*11)+display[x];
							P2 = ~font[a];
							delay_100(); //best refresh rate 50 Hz = 20 ms, so for each col = 20/18 ms
							//call delay function or make it by yourself
						}

						else
						{
							if (a<32)
							{
								E1=1; //CS1 and CS2 of 74HC154 chip 1
								E2=0; //CS1 and CS2 of 74HC154 chip 2
								P1=31-a;
								//a=(y*10)+display[x];
								a=(y*11)+display[x];
								P2 = ~font[a];
								delay_100(); //or delay_us(500); try the best view
							};


---------- Post added at 23:14 ---------- Previous post was at 23:10 ----------

Code:
[B]unsigned char display [4] = {0,0,0,0};[/B]

for (x=0;x<4;x++) //4 characters
		//for (x=0;x<3;x++) //3 characters
			{
				for (y=0;y<8;y++ ) //each character contains 8 cols.
				//for (y=0;y<6;y++ ) //each character contains 6 cols.
				{
					
					//a=(x*6)+y;
					a=(x*8)+y; // 8 cols
					if (a<16) //only for 16 condition (0-15)
						{ 
						    E1=0;
							E2=1;
							P1=15-a;
							//a=(y*10)+display[x];
							a=(y*11)+display[x];
							P2 = ~font[a];
							delay_100(); //best refresh rate 50 Hz = 20 ms, so for each col = 20/18 ms
							//call delay function or make it by yourself
						}

						else
						{
							if (a<32)
							{
								E1=1; //CS1 and CS2 of 74HC154 chip 1
								E2=0; //CS1 and CS2 of 74HC154 chip 2
								P1=15-a;
								//a=(y*10)+display[x];
								a=(y*11)+display[x];
								P2 = ~font[a];
								delay_100(); //or delay_us(500); try the best view

it is displayed correctly 0 0 0 0
 

I have tried the my posted program in proteus and it works. please upload your final schematic, so i can see where it missed.

I put pin 19 of both 74HC154 to the ground...you can try and let me know the response...
 
Last edited:

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…