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.

[SOLVED] Character scroll and array....??

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Activity points
9,442
Reference :
https://www.edaboard.com/threads/229376/#post977995
When I did :
unsigned char pat2[8] = {0xFF,0x03,0x03,0x3F,0x3F,0x03,0x03,0xFF,};//E

display(pat);
delay_ms(15000);
display(pat2);
delay_ms(15000);

Why didn't the pattern scrolled properly ? I saw I shadow between those patterns, do you guys have any ideas ?

The circuit :
circuit.jpg

I used 2N3906 for driving the Row

Thanks
 

So far I can get :

Where should I put the delay ? so the character is properly display first before it will be cleared.

Thanks guys
 

Shifting is done inside your display function , increase the delay there so that shifting is done in slower rate.

Alex
 

Shifting is done inside your display function , increase the delay there so that shifting is done in slower rate.

Alex

I don't have to put delay_ms(15000); between them ?

and increase the delay inside my display function ?

Thanks Alex...
 

You are currently using

Code:
void display(unsigned char pat[])

{
unsigned int cnt, col, row, num ;

row = 1;
//for (cnt = num*8 ; cnt < (num*8+8) ; cnt ++ ) //display pattern each character
for (cnt = 0 ; cnt < 8 ; cnt ++ ) //display pattern each character
{
P3 = ~pat[cnt];
P1 = ~row;

[B][COLOR="#FF0000"]delay_ms(10) ; // delay of 1 ms[/COLOR][/B]
row = row<<1;


}


row = 0x00;

}

and the red line is the delay you have between each step of the scroll, that is what you need to change.

The other delay
Code:
display(pat);
[B][COLOR="#FF0000"]delay_ms(15000);[/COLOR][/B]
display(pat2);
[B][COLOR="#FF0000"]delay_ms(15000);[/COLOR][/B]

is just the delay between showing the first character scroll and the second character scroll.

Alex
 

You are currently using

Code:
void display(unsigned char pat[])

{
unsigned int cnt, col, row, num ;

row = 1;
//for (cnt = num*8 ; cnt < (num*8+8) ; cnt ++ ) //display pattern each character
for (cnt = 0 ; cnt < 8 ; cnt ++ ) //display pattern each character
{
P3 = ~pat[cnt];
P1 = ~row;

[B][COLOR="#FF0000"]delay_ms(10) ; // delay of 1 ms[/COLOR][/B]
row = row<<1;


}


row = 0x00;

}

and the red line is the delay you have between each step of the scroll, that is what you need to change.

The other delay
Code:
display(pat);
[B][COLOR="#FF0000"]delay_ms(15000);[/COLOR][/B]
display(pat2);
[B][COLOR="#FF0000"]delay_ms(15000);[/COLOR][/B]

is just the delay between showing the first character scroll and the second character scroll.

Alex

Can I make like this :

display(pat2); //display H
display(pat_clear);
delay_ms(20000);
display(pat3); //display E
display(pat_clear);
delay_ms(20000);
 

That will only change the delay between different characters so it depends on what you want to do, experiment with different values.

Alex
 

That will only change the delay between different characters so it depends on what you want to do, experiment with different values.

Alex
Alex,
I want to display "H", perfectly displayed "delay", then display "E" and go back to H....actually "HELLO" or "HELLO ALEX" that's possible :)

Between H and E are too fast....

Any ideas ?
So far :

The code :
display(pat2); //display H
display(pat_clear);
delay_ms(50000);
display(pat3); //display E
 
Last edited:

have you increased the delay inside the function , for example use delay_ms(10) or 200 and see the result
 

have you increased the delay inside the function , for example use delay_ms(10) or 200 and see the result
I put delay_ms(100) ; " inside the loop, should, is it too fast, but if it's too slow, the scan for one character will be too slow...
Or I put outside the loop ? it's going to be the same with delay between function isn't it ?
 

You previously had 10 and it was too fast, if 100 is too slow try the values between like 15 or 20 or 30 etc.
The delay between the functions is not doing the same thing, each delay has a different purpose.
 

I put 100 and the result is in the 2nd video ? I will try to increase the delay...
 

A delay of 100ms (delay_ms(100);) should insert a delay of 100ms between each shift operation and since there are 8 in each character the process should take more than a second but in your video you are not even able to see it so your delay is not what t should be.
Is there any setting you forgot, maybe a crystal frequency.

Alex
 

Alex,

I put like this in the code :
display(pat2); //display H
display(pat_clear);
delay_ms(1000);
display(pat3); //display E

the delay function :
void delay_ms(unsigned int msec) //delay function
{
//;

unsigned int i,j;
for(i=0;i<msec;i++)
for(j=0;j<100;j++);

}

And my Clock is 11Mhz

Do you have any ideas ?

The result :
 
Last edited:

I am not familiar with the 8051 but I think that at 11mhz that delay function will take less than 1ms to execute. That second for loop won't do anything, remove the semicolon.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top