Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Dot Matrix Project - again .... 8X32 with AT89S52

Status
Not open for further replies.

agent5

Newbie level 5
Newbie level 5
Joined
Jul 27, 2011
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,380
Hi guys,

Need some help over here. I search through some entries but not much mentioning about C and how the display and shifting works. (I am very bad at C T.T)

This is my schematics:

Schematics.png
* common cathode block
* I orient it in such a way that the cathode column now become row for scanning

Questions:
1) Any problems with the schematics? The shift register is connecting to anode column / current sinker to cathode row.

2) Would the scanning works? I tried to simulate in Proteus but the current sinker dont operate as expected - eg. a high in 1B is not giving a low in 1C but in fact all the C are always low.

3) I found this pattern table and I dont understand how can I access to one of the character since all the characters are in a same array.
unsigned char code table1[]={
0x80,0x80,0x80,0x80,0x80,0x80, // SPACE
0x80,0x80,0x5F,0x80,0x80,0x80, // !
0x04,0x02,0x05,0x02,0x01,0x80, // "
0x14,0x7F,0x14,0x7F,0x14,0x80, // #
0x26,0x49,0x7F,0x49,0x32,0x80,// $
0x22,0x10,0x08,0x04,0x22,0x80,// %
0x80,0x36,0x49,0x36,0x28,0x80,// &
0x04,0x02,0x01,0x80,0x80,0x80,// '
0x08,0x14,0x22,0x41,0x80,0x80,// (
0x80,0x41,0x22,0x14,0x08,0x80,// )
0x2A,0x1C,0x08,0x1C,0x2A,0x80,// *
0x08,0x08,0x3E,0x08,0x08,0x80,// +
0x80,0x58,0x38,0x80,0x80,0x80,// ,
0x08,0x08,0x08,0x08,0x08,0x80,// -
0x40,0x80,0x80,0x80,0x80,0x80,// .
0x20,0x10,0x08,0x04,0x02,0x80}; // ;

4) How the display actually comes about (no scrolling first). Eg. if I were to display ABC, does that mean that when I scanning the first row I need to send a string of 32-bits of data consist of the first row of ABC then go to the next row OR scan row 1 - 8 for A, then repeat the same B and C but in a very fast manner. :shock:

Please help. Thanks ~
 

Last edited:

    V

    Points: 2
    Helpful Answer Positive Rating
Hi agent5;

Although it's for PIC but written in C (mikroC), and Proteus simulation is also attached so I hope it can help you:
post #671 https://www.edaboard.com/threads/11364/#post1125963

Hi Zuisti,

Thanks for replying and the time you spent on this. Really appreciate it. The simulation really helps alot!
I am so grateful that being far in the east side of the globe and still I received your help !

I can see that the hardware is similar but I found a minor difference, not sure how would it affect the program.
-> From your schematics, I see the serial input is connected to the right-most 595 (i did to the left-most, well, i thought is normal to do that)
is there any special meaning on this?

Sad to say that I am already not good in C, so kinda confused to look at mikroC but can you explain brieftly how the patterns stores in uC being access and display on the block?
Cause I understand how to display a single static character but not a scrolling sentence ~

One more thing, how you control the store / clock / data to work in the correct manner? eg. clock need to give high every 1 bit is in while store is every full row of bits - in the 8X8 case is 80 bits.
Lastly, I still cant figure out why the ULN2803 (current sinker, operate similar to 74ls138), refuse to operate during simulation

Thanks again for helping !
 
Last edited:

...the serial input is connected to the right-most 595 (i did to the left-most, well, i thought is normal to do that)
is there any special meaning on this?

No, nothing ... but it was evident to me, since any new character comes in from right (scroll).

... I understand how to display a single static character but not a scrolling sentence
See the "shift_in_a_column" routine. It uses the pattbuf array ...

clock need to give high every 1 bit is in while store is every full row of bits - in the 8X8 case is 80 bits
Exactly, clock-pulse to every bits, finally one store-pulse after the whole row, in this case after 7x8 = 56 bits.

Lastly, I still cant figure out why the ULN2803 (current sinker, operate similar to 74ls138), refuse to operate during simulation
This can only be answered in the light of the full circuit.
- ULN2803 is a current sinker only, it does NOT operate similar to 74ls138 demultiplexer.
- and ... I think it is not enough in the reallty (2 Amper!!). Please read carefully all three posts what I gave.

In Proteus does not need any driver, making the simulation faster.
 
  • Like
Reactions: agent5

    agent5

    Points: 2
    Helpful Answer Positive Rating
This can only be answered in the light of the full circuit.
- ULN2803 is a current sinker only, it does NOT operate similar to 74ls138 demultiplexer.
- and ... I think it is not enough in the reallty (2 Amper!!). Please read carefully all three posts what I gave.

In Proteus does not need any driver, making the simulation faster.

Ops, my bad. Yeah there are not the same, was talking bout sinking current part.

I tried to look for capability of 74HC238 (newer version of ls138) on sinking current. Each LED going to have 15mA, so worst case for me is 15mA * 32 = 480mA.
Is 74HC238 able to handle that?

I dont quite understand this part of the code in 877acode8X8.c
Code:
char nextchar(void) {
     char ch;
     static unsigned msg_idx = 0; // 16bit var, a very long msg is also possible

     for (;;) {
         if (ch = message[msg_idx++])
            break;    // not 0 (end sign)
         msg_idx = 0; // else back to begin
     }
     return ch;
}

to me the for loop will go on forever (if it didnt get ch = message[msg_idx++), cause if it didnt msg_idx will always go back to 0
and if ch is not 0, then the break will nvr be executed. Am I saying it right?


* still going through those code you provided, great help !

Thanks zuisti for your time :)
 
Last edited:

Having error, cant figure out why T.T

Everything was fine but suddenly ~

Code:
void get_char ()
{
unsigned int count;
unsigned int x = 0;
unsigned int s_idx = 0;
unsigned int t_idx;
	
	while(msg[x] != '\0') // continue to collect each char from msg[] till the last element		
	{
		t_idx = msg[x];       // obtain ASCII of each char
		t_idx -= 32;           // obtain offset by minus 32
		x ++ ;	           // increment of x for next element
		
		count = 0;		// counter for obtaining element from look up table, 8 sets of hex
			  
		do{
		save_data[s_idx] = table[t_idx];  // obtain the hex from look up table according to the offset
		        s_idx ++ ;
			t_idx ++ ;		
		}while(++count != 8);
	
	}
}

Errors:

Build target 'Target 1'
compiling simulation.c...
..\simulation\simulation.c(306): error C141: syntax error near 'void'
..\simulation\simulation.c(307): error C141: syntax error near '{'
..\simulation\simulation.c(313): error C141: syntax error near 'while'
..\simulation\simulation.c(313): error C221: non-constant case/dim expression
..\simulation\simulation.c(313): error C141: syntax error near '!=', expected ')'
..\simulation\simulation.c(315): error C231: 't_idx': redefinition
..\simulation\simulation.c(316): error C129: missing ';' before '-='
Target not created

Please help ~
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top