 |
 |
| View previous topic :: View next topic |
| Author |
Message |
Isaac aiyanyo Guest
|
| Re: HOW TO SCROLL 8X8 LED |
Posted: Wed Nov 06, 2002 12:09 pm |
|
|
i am planing to drive 16 columns for now using 2 74hc595
shift regs.
i am also using darlington drivers on both cols and rows.
i have a 5v @ 5amp power supply so i don't think that would be much of a problem.
once i then understand the working driving 16 columns i can then apply that knowelege for greater things
Hear from you soon
Isaac
___________________________
This message was ported from CCS's old forum
Original Post ID: 8607 |
|
 |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
| Re: HOW TO SCROLL 8X8 LED |
Posted: Wed Nov 06, 2002 3:12 pm |
|
|
Since you are only driving a max of 8 LEDs at a time, 5 amps is more than enough. Just keep in mind that when you drive more columns, each column is on for a shorter period of time which will cause them to be dimmer.
Regards,
Mark
:=i am planing to drive 16 columns for now using 2 74hc595
:=shift regs.
:=i am also using darlington drivers on both cols and rows.
:=i have a 5v @ 5amp power supply so i don't think that would be much of a problem.
:=once i then understand the working driving 16 columns i can then apply that knowelege for greater things
:=
:=Hear from you soon
:=Isaac
___________________________
This message was ported from CCS's old forum
Original Post ID: 8625 |
|
 |
aiyanyo Guest
|
| Re: HOW TO SCROLL 8X8 LED |
Posted: Thu Nov 07, 2002 11:58 am |
|
|
i would bear that in mind
i should finish building the prototype by tommorrow
i would definately let u know how i am doing
Isaac
___________________________
This message was ported from CCS's old forum
Original Post ID: 8660 |
|
 |
ernest
Joined: 11 Feb 2004 Posts: 51
|
| Help - How to use RS232 to display characters on dot-matrix |
Posted: Tue Nov 02, 2004 6:20 am |
|
|
Hello, I'm trying to build a 5x7 dot-matrix display using PIC16F877A. So far, I've been able to display scrolling characters on the dot matrix. But it would be much better if user can change the message to be displayed by simply using the RS232.
I've written a program below but it failed to display the message. Please comment on any mistakes done in the program. Is there a better way of writing the program? All advice are much appreciated.
#if defined(__PCM__)
#include <16F877A.H>
#fuses HS,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_A4, rcv=PIN_A5) //use portA instead
#IFNDEF EXP_OUT_ENABLE
#define EXP_OUT_ENABLE PIN_C2
#define EXP_OUT_CLOCK PIN_C1
#define EXP_OUT_DO PIN_C0
#define NUMBER_OF_74595 3 //trying out with 3 ICs
#ENDIF
#include <74595_V02.C>
#byte port_a=5
#byte port_b=6
#byte port_c=7
#byte port_d=8
// TO DISPLAY 5X7 DOT MATRIX CHARACTER
//char const msg[80]={0,0, 127,8,8,8,127, 0,56,84,84,84,24, 0,65,127,64, 0,65,127,64, 0,56,68,68,68,56, 0,88,56,0, 127,8,4,4,120, 0,56,68,68,68,56, 0,60,64,48,64,60, 0,0,32,84,84,84,56, 0,124,8,4,4,8, 0,56,84,84,84,24, 0,0,60,64,64,32,124, 0,2,1,81,9,6};
// ==> ABLE TO DISPLAY: "Hello,how are u?"
// the '0' was placed in front of every char. to give spacing of 1column
char msg[40];
char s1[16];
void get_line1() { // to acquire 16 char.
s1[0]=getc();
printf("\ts1==> %C",s1[0]);
s1[1]=getc();
printf("%C",s1[1]);
s1[2]=getc();
printf("%C",s1[2]);
s1[3]=getc();
printf("%C",s1[3]);
s1[4]=getc();
printf("%C",s1[4]);
s1[5]=getc();
printf("%C",s1[5]);
s1[6]=getc();
printf("%C",s1[6]);
s1[7]=getc();
printf("%C",s1[7]);
s1[8]=getc();
printf("%C",s1[8]);
s1[9]=getc();
printf("%C",s1[9]);
s1[10]=getc();
printf("%C",s1[10]);
s1[11]=getc();
printf("%C",s1[11]);
s1[12]=getc();
printf("%C",s1[12]);
s1[13]=getc();
printf("%C",s1[13]);
s1[14]=getc();
printf("%C",s1[14]);
s1[15]=getc();
printf("%C",s1[15]);
}
char const ascii_char3[6][3] = {
{ 0,11,7 } // ' [0]
{ 0,88,56 } // , [1]
{ 0,96,96 } // . [2]
{ 0,54,54 } // : [3]
{ 0,91,59 } // ; [4]
{ 0,7,11 } // ` [5]
};
char const ascii_char4[11][4] = {
{ 0, 7, 0, 7 } // " [0]
{ 0,28,34,65 } // ( [1]
{ 0,65,34,28 } // ) [2]
{ 0,66,127,64 } // 1 [3]
{ 0,65.127,65 } // I (Capital i)
{ 0,127,65,65 } // [ [5]
{ 0,65,65,127 } // ] [6]
{ 0,68,125,64 } // i [7]
{ 0,65,127,64 } // l (Small L)
{ 0,8,54,65 } // { [9]
{ 0,65,54,8 } // } [10]
};
char const ascii_char5[8][5] = {
{ 0, 8,62, 8, 8 } // + [0]
{ 0,8,20,34,65 } // < [1]
{ 0,65,34,20,8 } // > [2]
{ 0,56,68,68,68 } // c [3]
{ 0,32,64,68,61 } // j [4]
{ 0,127,16,40,68} // k [5]
{ 0, 4,63,68,68 } // t [6]
{ 0, 2, 1, 2,42 } // ~ [7]
};
char const ascii_char6[30][6] = {
{ 0, 20,127,20,127,20 } // DEC 35 '#' [0]
{ 0, 36, 42, 127, 42, 18 } // 36D '$' [1]
{ 0, 39, 21, 107, 84, 114 } // 37D '%' [2]
{ 0, 54, 73, 86, 32, 80 } // 38D '&' [3]
{} //0, 11, 7 // 39H [4]
{} //0, 28, 34, 65 // 40D [5]
{} //0, 65, 34, 28 // 41D [6]
{ 0, 42, 28, 127, 28, 42 } // 42D '*' [7]
{} //0, 8, 62, 8, 8 // 43D [8]
{} //0, 88, 56 // 44D [9]
{ 0, 8,8,8,8,8 } // 45D '-' [10]
{} //0, 96, 96 // 46D [11]
{ 0, 32, 16, 8, 4, 2 } // 47D '/' [12]
{ 0, 62, 81, 73, 69, 62 } // 48D '0' [13]
{} //0,66, 127, 64 // 49D [14]
{ 0, 114, 73, 73, 73, 70 } // 50D '2' [15]
{ 0, 34, 65, 73, 73, 54 } // 51D '3' [16]
{ 0, 24, 20, 18, 127, 16 } // 52D '4' [17]
{ 0, 39, 69, 69, 69, 57 } // 53D '5' [18]
{ 0, 120, 74, 73, 73, 48 } // 54D '6' [19]
{ 0, 1, 113, 9, 5, 3 } // 55D '7' [20]
{ 0, 54, 73, 73, 73, 54 } // 56D '8' [21]
{ 0, 6, 73, 73, 41, 30 } // 57D '9' [22]
{} //0, 54, 54 // 58D [23]
{} //0, 91, 59 // 59D [24]
{} //0, 8, 20, 34, 65 // 60D [25]
{ 0, 20, 20, 20, 20, 20 } // 61D [26]
{} //0, 65, 34, 20, 8 // 62D [27]
{ 0, 2, 1, 81, 9, 6 } // 63D [28]
{ 0, 50, 73, 121, 65, 62 } // 64D [29]
};
char const ascii_char7[31][6] = {
{ 0, 124, 18, 17, 18, 124 } // 65
{ 0, 65, 127, 73, 73, 54 } // 66
{ 0, 62, 65, 65, 65, 34 } // 67
{ 0, 65, 127, 65, 65, 62 } // 68
{ 0, 127, 73, 73, 65, 65 } // 69
{ 0, 127, 9, 9, 1, 1 } // 70
{ 0, 62, 65, 73, 73, 58 } // 71
{ 0, 127, 8, 8, 8, 127 } // 72
{ } // 0, 65, 127, 65 // 73 X
{ 0, 32, 64, 65, 63, 1 } // 74
{ 0, 127, 8, 20, 34, 65 } // 75
{ 0, 127, 64, 64, 64, 64 } // 76
{ 0, 127, 2, 12, 2, 127 } // 77
{ 0, 127, 2, 4, 8, 127 } // 78
{ 0, 62, 65, 65, 65, 62 } // 79
{ 0, 127, 9, 9, 9, 6 } // 80
{ 0, 62, 9, 81, 33, 94 } // 81
{ 0, 127, 9, 25, 41, 70 } // 82
{ 0, 38, 73, 73, 73, 50 } // 83
{ 0, 1,1,127, 1, 1 } // 84
{ 0, 63, 64, 64, 64, 63 } // 85
{ 0, 7, 24, 96, 24, 7 } // 86
{ 0, 127, 32, 24, 32, 127 } // 87
{ 0, 99, 20, 8, 20, 99 } // 88
{ 0, 3, 4, 120, 4, 3 } // 89
{ 0 97, 81, 73, 69, 67 } // 90
{ } // 0, 127, 65, 65 // 91 X
{ 0, 2, 4, 8, 16, 32 } // 92
{ } //0, 65, 65, 127 // 93 X
{ 0, 4, 2, 1, 2, 4 } // 94
{ 0, 64, 64, 64, 64, 64 } // 95
};
char const ascii_char8[26][6] = {
{ 0, 32, 84, 84, 84, 56 } // 97
{ 0, 127, 40, 68, 68, 556 } // 98
{ } // 0, 56, 68, 68, 68 // 99 X
{ 0, 56, 68, 68, 40, 127 } // 100
{ 0, 56, 84, 84, 84, 24 } // 101
{ 0, 8, 63, 9, 9, 2 } // 102
{ 0, 8, 84, 84, 84, 60 } // 103
{ 0, 127, 8, 4, 4, 120 } // 104
{ } // 0, 68, 125, 64 // 105 X
{ } // 0, 32, 64, 68, 61 // 106 X
{ } // 0, 127, 16, 40, 68 // 107 X
{ } //0, 65, 127, 64 // 108 X
{ 0, 124, 4, 120, 4, 120 } // 109
{ 0, 124, 8, 4, 4, 120 } // 110
{ 0, 56, 68, 68, 68, 56 } // 111
{ 0, 124, 20, 20, 20, 8 } // 112
{ 0, 8, 20, 20, 20, 124 } // 113
{ 0, 124, 8, 4, 4, 8 } // 114
{ 0, 72, 84, 84, 84, 36 } // 115
{ } //0, 4, 63, 68, 68 // 116 X
{ 0, 60, 64, 64, 32, 124 } // 117
{ 0, 28, 32, 64, 32, 28 } // 118
{ 0, 60, 64, 48, 64, 60 } // 119
{ 0, 68, 40, 16, 40, 68 } // 120
{ 0, 12,80, 80, 80, 60 } // 121
{ 0, 36, 100, 84, 76, 36 } // 122
};
main()
{
int n = 0;
int mask[4];
int data[4];
int delaycount;
int startposition;
int index;
int i = 0; int x = 0; int y = 0; // x=counter for row, y=counter for column ie. [x][y]
int z = 0; // to count size of msg[]
mask[0] = 0x01; mask[1] = 0x00; mask[2] = 0x00; mask[3] = 0x00;
set_tris_b(0); //set portb to outputs
set_tris_c(0); //set portc to outputs
set_tris_d(0);
port_b = 0;
port_c = 0; //zero port c
startposition = 0;
msg[0] = ascii_char6[1][0]; // $
msg[1] = ascii_char6[1][1];
msg[2] = ascii_char6[1][2];
msg[3] = ascii_char6[1][3];
msg[4] = ascii_char6[1][4];
msg[5] = ascii_char6[1][5];
msg[6] = ascii_char6[22][0]; // 9
msg[7] = ascii_char6[22][1];
msg[8] = ascii_char6[22][2];
msg[9] = ascii_char6[22][3];
msg[10] = ascii_char6[22][4];
msg[11] = ascii_char6[22][5];
msg[12] = ascii_char5[7][0]; // ~
msg[13] = ascii_char5[7][1];
msg[14] = ascii_char5[7][2];
msg[15] = ascii_char5[7][3];
msg[16] = ascii_char5[7][4];
msg[17] = ascii_char3[2][0]; // .
msg[18] = ascii_char3[2][1];
msg[19] = ascii_char3[2][2];
msg[20] = ascii_char4[7][0]; // i
msg[21] = ascii_char4[7][1];
msg[22] = ascii_char4[7][2];
msg[23] = ascii_char4[7][3];
z = sizeof(msg);
do
{
if(!input(PIN_E1)) // if RE1 == LOW (pressed)
{
printf("\r\nEnter the char.: ");
get_line1(); // acquire 16 char.
n = 0; z=0;
for(n=0; n<8 ; n++) // allow display of 8 char.
{
if(s1[n]==32) // ' BLANK ' ==> 1 column
{ msg[n]=0; z+=1;}
if(s1[n]==33) // ' ! ' ==> 2 columns incl.LEADING SPACE
{ msg[n]=0;
msg[n+1]=95;
z+=2; }
// ==> 5 columns incl. LEADING SPACE
if((s1[n]==43)&&(s1[n]==60)&&(s1[n]==62)&&(s1[n]==99)&&(s1[n]==106)&&(s1[n]==107)&&(s1[n]==116)&&(s1[n]==126))
{
if(s1[n]==43)
x = 0;
if(s1[n]==60)
x = 1;
if(s1[n]==62)
x = 2;
if(s1[n]==99)
x = 3;
if(s1[n]==106)
x = 4;
if(s1[n]==107)
x = 5;
if(s1[n]==116)
x = 6;
if(s1[n]==126)
x = 7;
for(y=0;y<5;y++)
{
msg[z+y] = ascii_char5[x][y];
}
z+=5;
} // end of IF s1 compare for 5columns
// ==> 4 columns incl. LEADING SPACE
if((s1[0]==34) && (s1[0]==40) && (s1[0]==41) && (s1[0]==49) && (s1[0]==73) && (s1[0]==91) && (s1[0]==93)
&& (s1[0]==105) && (s1[0]==108) && (s1[0]==123) && (s1[0]==125))
{
switch(s1[n])
{
case 34: x=0; break;
case 40: x=1; break;
case 41: x=2; break;
case 49: x=3; break;
case 73: x=4; break;
case 91: x=5; break;
case 93: x=6; break;
case 105: x=7; break;
case 108: x=8; break;
case 123: x=9; break;
case 125: x=10; break;
}
for(y=0;y<4;y++)
{
msg[z+y] = ascii_char4[x][y];
}
z+=4;
} // end of IF s1 compare for 4columns
// ==> 3 columns incl. LEADING SPACE
if((s1[n]==39) && (s1[n]==44) && (s1[n]==46) && (s1[n]==58) && (s1[n]==59) && (s1[n]==96))
{
switch(s1[n])
{
case 39: x=0; break;
case 44: x=1; break;
case 46: x=2; break;
case 58: x=3; break;
case 59: x=4; break;
case 96: x=5; break;
}
for(y=0;y<3;y++)
{
msg[z+y] = ascii_char3[x][y];
}
z+=3;
} // end of IF s1 compare for 3columns
} //END OF for-loop for n-flag
} // END of INPUT(PIN_E1)
delaycount=5;
while (delaycount)
{
index = startposition;
for (i=0;i<32;i++) // we have 32 columns to drive //for (i=0;i<32;i++) //
{
// store our mask in an array. we need to do this because
// the call to write_expanded_outputs will destroy the value
// passed in.
data[0] = mask[0]; // store which column we are driving
data[1] = mask[1]; // in an array
data[2] = mask[2];
data[3] = mask[3];
if(!input(PIN_E2)) // to allow user to FREEZE DISPLAY/SCROLLING when RE2==LOW
delaycount = 4;
index = i + startposition; // point to the next pattern to display
if (index >= z) //sizeof(msg)) // make sure that we don't exceed the array
index -= z; //sizeof(msg);
// port_b = 0; // disable driving the LEDs
//port_d = 0; // use port d to drive ROWS
port_d=0;
write_expanded_outputs(data); // enable our column driver
// port_b = msg[index]; // drive our LEDs
port_d = msg[index];
if (shift_left(mask,4,0))
mask[0] = 0x01;
delay_us(750); // adjust this value to control the drive time
//for the leds
}
--delaycount; // decrement our delay loop counter
}
++startposition; // Point to the next data pattern
if (startposition >= sizeof(msg)) // make sure that we don't exceed the array
startposition = 0;
// if(!input(PIN_E1)) // to allow user to FORCE the display to RETURN to ORIGIN when RE1==LOW
// {
// startposition = 2; // reset starting position with OFFSET of 2 (otherwise 2 trash column will be shown)
// index = 0; // reset index
// i = 0; // reset i count
// }
} while(1); // END while(1)
} // END main()
THANK YOU. |
|
 |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Nov 02, 2004 11:24 am |
|
|
| No double posting!!!!! |
|
 |
ernest
Joined: 11 Feb 2004 Posts: 51
|
|
Posted: Tue Nov 02, 2004 6:27 pm |
|
|
Dear Mark,
Errr...errr..sorry about this, Mark.... Is it not allowed/recommended/advisable to send out posting or enquiry to a few different forum topics? Since these forums were created and visited by different people, I'm just trying to get more opinions or ideas. These different ideas/solutions/advices to my problem would help to enrich my skill or knowledge. Moreover, we may not get any positive reply if we post to a single forum.
But anyway, if it is not advisable to post to more than 1 forum, then I must apologize for my insensitivity and for what I did, I'm not aware of this at all.
Ernest |
|
 |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Nov 02, 2004 7:06 pm |
|
|
| You posted in a single forum but asked the same question in multiple topics. It is better to ask in a single place so that all the answers are together. I usually don't bother to even read the post if they post multiple times. It just gripes me. I also don't give a full effort if they don't use the code button when posting code. It is just too hard to read and I don't have enough hours in the day to copy the text and reformat just to have a look. |
|
 |
ernest
Joined: 11 Feb 2004 Posts: 51
|
|
Posted: Wed Nov 03, 2004 9:05 pm |
|
|
Hi everyone,
I've tried to display characters on dot matrix using RS232. I managed to get it to work. By pressing RE1, user can type in 8 characters for display on the 5x7 LEDs. With 8char., I set the array size to pat[50]. This is on assumption that each char. will have max.of 6columns (inclusive of a BLANK spacing),so 8x6=48columns.
However, when I change the array size to pat[60] or higher, it FAILED to work. Why ? The ROM usage is 23% while the RAM usage is 53%.
The problem now is, how can I send more characters for eg.80 char.using RS232 for display? Can a single PIC16F877A MCU handle it?
What else or what can I do to optimize my program? Is there a better way?
Thanks a lot in advance.
Ernest
| Code: | #if defined(__PCM__)
#include <16F877A.H>
#fuses HS,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600,xmit=PIN_A4, rcv=PIN_A5) //RA4, RA5 for RS232
#IFNDEF EXP_OUT_ENABLE
#define EXP_OUT_ENABLE PIN_C2
#define EXP_OUT_CLOCK PIN_C1
#define EXP_OUT_DO PIN_C0
#define NUMBER_OF_74595 3
#ENDIF
#include <74595_V02.C>
#byte port_a=5
#byte port_b=6
#byte port_c=7
#byte port_d=8
char s1[8];
void get_line1() { // to acquire 8 characters for display
s1[0]=getc();
printf("%C , %D",s1[0],s1[0]);
s1[1]=getc();
printf("%C , %D",s1[1],s1[1]);
s1[2]=getc();
printf("%C , %D",s1[2],s1[2]);
s1[3]=getc();
printf("%C , %D",s1[3],s1[3]);
s1[4]=getc();
printf("%C , %D",s1[4],s1[4]);
s1[5]=getc();
printf("%C",s1[5]);
s1[6]=getc();
printf("%C",s1[6]);
s1[7]=getc();
printf("%C",s1[7]);
// s1[8]=getc(); // tried to get 9characters but DOES NOT WORK
// printf("%C",s1[8]);
}
char pat[50]; // LED display for 50 columns
char const ascii_char3[6][3] = { //char. with 3 columns
{ 0,11,7 } // ' [0]
{ 0,88,56 } // , [1]
{ 0,96,96 } // . [2]
{ 0,54,54 } // : [3]
{ 0,91,59 } // ; [4]
{ 0,7,11 } }; // ` [5]
char const ascii_char4[11][4] = { //char.with 4 columns
{ 0, 7, 0, 7 } // " [0]
{ 0,28,34,65 } // ( [1]
{ 0,65,34,28 } // ) [2]
{ 0,66,127,64 } // 1 [3]
{ 0,65,127,65 } // I (Capital i)
{ 0,127,65,65 } // [ [5]
{ 0,65,65,127 } // ] [6]
{ 0,68,125,64 } // i [7]
{ 0,65,127,64 } // l (Small L)
{ 0,8,54,65 } // { [9]
{ 0,65,54,8 } }; // } [10]
char const ascii_char5[8][5] = { // char.with 5columns
{ 0, 8,62, 8, 8 } // + [0]
{ 0,8,20,34,65 } // < [1]
{ 0,65,34,20,8 } // > [2]
{ 0,56,68,68,68 } // c [3]
{ 0,32,64,68,61 } // j [4]
{ 0,127,16,40,68} // k [5]
{ 0, 4,63,68,68 } // t [6]
{ 0, 2, 1, 2,42 } }; // ~ [7]
char const ascii_char6[30][6] = { // char.with 6columns ('#' <--> '@')
{ 0, 20,127,20,127,20 } // DEC 35 '#' [0]
{ 0, 36, 42, 127, 42, 18 } // 36D '$' [1]
{ 0, 39, 21, 107, 84, 114 } // 37D '%' [2]
{ 0, 54, 73, 86, 32, 80 } // 38D '&' [3]
{} //0, 11, 7 purposely left blank since it's not 6columns // 39H [4]
{} //0, 28, 34, 65 // 40D [5]
{} //0, 65, 34, 28 // 41D [6]
{ 0, 42, 28, 127, 28, 42 } // 42D '*' [7]
{} //0, 8, 62, 8, 8 // 43D [8]
{} //0, 88, 56 // 44D [9]
{ 0, 8,8,8,8,8 } // 45D '-' [10]
{} //0, 96, 96 // 46D [11]
{ 0, 32, 16, 8, 4, 2 } // 47D '/' [12]
{ 0, 62, 81, 73, 69, 62 } // 48D '0' [13]
{} //0,66, 127, 64 // 49D [14]
{ 0, 114, 73, 73, 73, 70 } // 50D '2' [15]
{ 0, 34, 65, 73, 73, 54 } // 51D '3' [16]
{ 0, 24, 20, 18, 127, 16 } // 52D '4' [17]
{ 0, 39, 69, 69, 69, 57 } // 53D '5' [18]
{ 0, 120, 74, 73, 73, 48 } // 54D '6' [19]
{ 0, 1, 113, 9, 5, 3 } // 55D '7' [20]
{ 0, 54, 73, 73, 73, 54 } // 56D '8' [21]
{ 0, 6, 73, 73, 41, 30 } // 57D '9' [22]
{} //0, 54, 54 // 58D [23]
{} //0, 91, 59 // 59D [24]
{} //0, 8, 20, 34, 65 // 60D [25]
{ 0, 20, 20, 20, 20, 20 } // 61D [26]
{} //0, 65, 34, 20, 8 // 62D [27]
{ 0, 2, 1, 81, 9, 6 } // 63D [28]
{ 0, 50, 73, 121, 65, 62 } }; // 64D [29]
char const ascii_char7[31][6] = { //char.with 6columns ('A' <--> '_')
{ 0, 124, 18, 17, 18, 124 } // 65 [0]
{ 0, 65, 127, 73, 73, 54 } // 66
{ 0, 62, 65, 65, 65, 34 } // 67 [2]
{ 0, 65, 127, 65, 65, 62 } // 68
{ 0, 127, 73, 73, 65, 65 } // 69 [4]
{ 0, 127, 9, 9, 1, 1 } // 70
{ 0, 62, 65, 73, 73, 58 } // 71 [6]
{ 0, 127, 8, 8, 8, 127 } // 72
{ } // 0, 65, 127, 65 // 73 X
{ 0, 32, 64, 65, 63, 1 } // 74 [9]
{ 0, 127, 8, 20, 34, 65 } // 75
{ 0, 127, 64, 64, 64, 64 } // 76 [11]
{ 0, 127, 2, 12, 2, 127 } // 77
{ 0, 127, 2, 4, 8, 127 } // 78 [13]
{ 0, 62, 65, 65, 65, 62 } // 79
{ 0, 127, 9, 9, 9, 6 } // 80 [15]
{ 0, 62, 9, 81, 33, 94 } // 81
{ 0, 127, 9, 25, 41, 70 } // 82 [17]
{ 0, 38, 73, 73, 73, 50 } // 83
{ 0, 1,1,127, 1, 1 } // 84 [19]
{ 0, 63, 64, 64, 64, 63 } // 85
{ 0, 7, 24, 96, 24, 7 } // 86 [21]
{ 0, 127, 32, 24, 32, 127 } // 87
{ 0, 99, 20, 8, 20, 99 } // 88 [23]
{ 0, 3, 4, 120, 4, 3 } // 89
{ 0 97, 81, 73, 69, 67 } // 90 [25]
{ } // 0, 127, 65, 65 // 91 X
{ 0, 2, 4, 8, 16, 32 } // 92 [27]
{ } //0, 65, 65, 127 // 93 X
{ 0, 4, 2, 1, 2, 4 } // 94 [29]
{ 0, 64, 64, 64, 64, 64} }; // 95 [30]
char const ascii_char8[26][6] = { //6columns char. ('a' <--> 'z')
{ 0, 32, 84, 84, 84, 56 } // 97 [0]
{ 0, 127, 40, 68, 68, 556 } // 98
{ } // 0, 56, 68, 68, 68 // 99 X
{ 0, 56, 68, 68, 40, 127 } // 100 [3]
{ 0, 56, 84, 84, 84, 24 } // 101
{ 0, 8, 63, 9, 9, 2 } // 102 [5]
{ 0, 8, 84, 84, 84, 60 } // 103
{ 0, 127, 8, 4, 4, 120 } // 104 [7]
{ } // 0, 68, 125, 64 // 105 X
{ } // 0, 32, 64, 68, 61 // 106 X [9]
{ } // 0, 127, 16, 40, 68 // 107 X
{ } //0, 65, 127, 64 // 108 X [11]
{ 0, 124, 4, 120, 4, 120 } // 109
{ 0, 124, 8, 4, 4, 120 } // 110 [13]
{ 0, 56, 68, 68, 68, 56 } // 111
{ 0, 124, 20, 20, 20, 8 } // 112 [15]
{ 0, 8, 20, 20, 20, 124 } // 113
{ 0, 124, 8, 4, 4, 8 } // 114 [17]
{ 0, 72, 84, 84, 84, 36 } // 115
{ } //0, 4, 63, 68, 68 // 116 X [19]
{ 0, 60, 64, 64, 32, 124 } // 117
{ 0, 28, 32, 64, 32, 28 } // 118 [21]
{ 0, 60, 64, 48, 64, 60 } // 119
{ 0, 68, 40, 16, 40, 68 } // 120 [23]
{ 0, 12,80, 80, 80, 60 } // 121
{ 0, 36, 100, 84, 76, 36} }; // 122 [25]
main()
{
int n = 0; int matched = 0; int mask[4]; int data[4];
int delaycount; int startposition; int index;
int i = 0; int x = 0; int y = 0; // x=counter for row, y=counter for column ie. [x][y]
int z = 0; // to count size of pat[]
mask[0] = 0x01; mask[1] = 0x00; mask[2] = 0x00; mask[3] = 0x00;
set_tris_b(0); //set portb to outputs
set_tris_c(0); //set portc to outputs
set_tris_d(0);
port_b = 0;
port_c = 0; //zero port c
startposition = 0;
for(i=0;i<50;i++)
{ pat[i] = 0; }
do
{
if(!input(PIN_E1)) // if RE1 == LOW (pressed),read RS232
{
for(i=0;i<50;i++)
{ pat[i] = 0; }
printf("\r\n\n Enter the char.: ");
get_line1(); // acquire char.for display
n = 0; z=0;
for(n=0; n<8 ; n++) // allow display of 8 char.
{
matched = 0;
if(s1[n]==32) // ' BLANK ' ==> 1 column display?
{ pat[z]=0;
z+=1; matched = 1; }
if( (s1[n]==33) || (s1[n]==124) ) // 2 columns display?
{
if(s1[n] == 33)
{ pat[z]=0; pat[z+1]=95; }
else
{ pat[z]=0; pat[z+1]=119;}
z+=2; matched = 1; // if z=0, now z=2
}
// 5 columns display?
if((s1[n]==43)||(s1[n]==60)||(s1[n]==62)||(s1[n]==99)||(s1[n]==106)||(s1[n]==107)||(s1[n]==116)||(s1[n]==126))
{
switch(s1[n])
{
case 43: x=0; break;
case 60: x=1; break;
case 62: x=2; break;
case 99: x=3; break;
case 106: x=4; break;
case 107: x=5; break;
case 116: x=6; break;
case 126: x=7; break; }
for(y=0;y<5;y++)
{ pat[z+y] = ascii_char5[x][y]; } // y=0,1,2,3,4
z+=5; matched = 1; // if z=0, then z=5
} // end of IF s1 compare for 5columns
// 4 columns display?
if((s1[n]==34) || (s1[n]==40) || (s1[n]==41) || (s1[n]==49) || (s1[n]==73) || (s1[n]==91) || (s1[n]==93)
|| (s1[n]==105) || (s1[n]==108) || (s1[n]==123) || (s1[n]==125))
{
switch(s1[n])
{
case 34: x=0; break;
case 40: x=1; break;
case 41: x=2; break;
case 49: x=3; break;
case 73: x=4; break;
case 91: x=5; break;
case 93: x=6; break;
case 105: x=7; break;
case 108: x=8; break;
case 123: x=9; break;
case 125: x=10; break; }
for(y=0;y<4;y++)
{ pat[z+y] = ascii_char4[x][y]; }
z+=4; matched = 1;
} // end of IF s1 compare for 4columns
// 3 columns display?
if((s1[n]==39) || (s1[n]==44) || (s1[n]==46) || (s1[n]==58) || (s1[n]==59) || (s1[n]==96))
{
switch(s1[n])
{
case 39: x=0; break;
case 44: x=1; break;
case 46: x=2; break;
case 58: x=3; break;
case 59: x=4; break;
case 96: x=5; break; }
for(y=0;y<3;y++)
{ pat[z+y] = ascii_char3[x][y]; }
z+=3; matched = 1;
} // end of IF s1 compare for 3columns
if( (s1[n]>34) && (s1[n]<65) && (matched==0) ) // run this ONLY IF the char. ('#' <--> '@') incl. numeric
{
x = s1[n] - 35;
for(y=0;y<6;y++)
{ pat[z+y] = ascii_char6[x][y]; }
z+=6;
matched = 1;
}
if( (s1[n]>64) && (s1[n]<96) && (matched==0) ) // run this ONLY IF the char. ('A' <--> '_') incl. numeric
{
x = s1[n] - 65;
for(y=0;y<6;y++)
{ pat[z+y] = ascii_char7[x][y]; }
z+=6;
matched = 1;
}
if( (s1[n]>96) && (s1[n]<123) && (matched==0) ) // run this ONLY IF the char. ('a' <--> 'z') incl. numeric
{
x = s1[n] - 97;
for(y=0;y<6;y++)
{
pat[z+y] = ascii_char8[x][y];
}
z+=6;
matched = 1;
}
} //END OF for-loop for n-flag
} // END of INPUT(PIN_E1)
delaycount=5;
while (delaycount)
{
index = startposition;
for (i=0;i<32;i++) // we have 32 columns to drive //for (i=0;i<32;i++) //
{ data[0] = mask[0]; // store which column we are driving
data[1] = mask[1]; // in an array
data[2] = mask[2];
data[3] = mask[3];
if(!input(PIN_E2)) // to allow user to FREEZE DISPLAY/SCROLLING when RE2==LOW
delaycount = 4;
index = i + startposition; // point to next pattern to display
if (index >= sizeof(pat)) //make sure don't exceed the array
index -= sizeof(pat);
port_d=0;
write_expanded_outputs(data); // enable our column driver
port_d = pat[index]; //// drive our LEDs
if (shift_left(mask,4,0)) //(mask,4,0))
mask[0] = 0x01;
delay_us(650); // adjust this value to control the drive time
//for the leds
}
--delaycount; // decrement our delay loop counter
}
++startposition; // Point to the next data pattern
if (startposition >= sizeof(pat)) // make sure don't exceed the array
startposition = 0;
} while(1); // END while(1)
} // END main() |
|
|
 |
ernest
Joined: 11 Feb 2004 Posts: 51
|
|
Posted: Wed Nov 03, 2004 9:24 pm |
|
|
Mark,
Yes, I agree with you. I can understand that. Just wanna thank you for helping, assisting and guiding so many visitors to this forum. I really appreciate that and I'm sure others who have benefited from this forum agree to me as well.
Thumbs Up to you..and others who have help to solve many problems,
and stay cool too..
Cheers,
Ernest
| Mark wrote: | | You posted in a single forum but asked the same question in multiple topics. It is better to ask in a single place so that all the answers are together. I usually don't bother to even read the post if they post multiple times. It just gripes me. I also don't give a full effort if they don't use the code button when posting code. It is just too hard to read and I don't have enough hours in the day to copy the text and reformat just to have a look. |
|
|
 |
ernest
Joined: 11 Feb 2004 Posts: 51
|
|
Posted: Fri Nov 05, 2004 3:30 am |
|
|
Hi...
I would like to seek the guidance and help from the experts...Can anyone please help me to solve this problem of mine ?
I'm trying to display ASCII char.on 5x7 dot matrices but has difficulty to use RS232 to send the char. for display.
If I use the following with a do..while loop to drive the dot matrices in my program, I can get it to display "ABCDEFGH01234567abcdefgh".
| Code: | char pat[50] = {0,124,18,17,18,124, 0,65,127,73,73,54, 0,62,65,65,65,34, 0,65,127,65,65,62, 0,127,73,73,65,65, 0,127,9,9,1,1, 0,62,65,73,73,58, 0,127,8,8,8,127,0,127};
char const pat1[98] = {0, 0,62,81,73,69,62, 0,66,127,64, 0,114,73,73,73,70, 0,34,65,73,73,54, 0,24,20,18,127,16, 0,39,69,69,69,57, 0,120,74,73,73,48, 0,1,113,9,5,3, 0,0,0,0, 32,84,84,84,56, 0,127,40,68,68,556, 0,56,68,68,68, 0,56,68,68,40,127, 0,56,84,84,84,24, 0,8,63,9,9,2, 0,8,84,84,84,60, 0,127,8,4,4,120};
|
The do..while loop to drive the row and control the column is given below.I have tried this with the codes above as well as the codes for RS232 but only the codes above can work.
| Code: | delaycount=5;
while (delaycount)
{
index = startposition;
for (i=0;i<32;i++) // we have 32 columns to drive {
data[0] = mask[0]; // store which column we are driving
data[1] = mask[1]; // in an array
data[2] = mask[2];
data[3] = mask[3];
if(!input(PIN_E2)) // allow user to FREEZE DISPLAY
delaycount = 4;
index = i + startposition; // point to next pattern to display
if (index >= (sizeof(pat)+sizeof(pat1)) ) //don't exceed the array
index -= (sizeof(pat) + sizeof(pat1)) ; //z;
port_d=0;
write_expanded_outputs(data); // enable column driver
if(index<50) // drive LED
port_d = pat[index];
if(index>=50)
port_d = pat1[index-50];
if (shift_left(mask,4,0)) //(mask,4,0))
mask[0] = 0x01;
delay_us(650); // to control the drive time
}
--delaycount; // decrement our delay loop counter
}
++startposition; // Point to the next data pattern
if (startposition >= (sizeof(pat) + sizeof(pat1) - 1) )// make sure that we don't exceed the array
startposition = 0;
} while(1); // END do..while(1)
|
But when I try to acquire char. using RS-232, it FAIL to display and Hyperterminal becomes very slow and not responsive.WHY?? The code is:
| Code: | if(!input(PIN_E1)) // if RE1==LOW (pressed),get rs232
{ for(i=0;i<50;i++)
{ pat[i] = 0; } //pat1[i]=0; tried to concentrate on pat[] only
printf("\r\n\n Enter the char.: ");
delay_ms(1);
get_line1(); // func. to acquire 8 char.for pat[]
n = 0; z=0;
for(n=0; n<8 ; n++) // allow display of 8 char.
{
matched = 0;
if(s1[n]==32) // ' BLANK ' ==> 1 column
{ pat[z]=0;
z+=1; matched = 1; }
if( (s1[n]==33) || (s1[n]==124) ) // ==> 2 columns incl.space
{
if(s1[n] == 33)
{ pat[z]=0; pat[z+1]=95; }
else
{ pat[z]=0; pat[z+1]=119;} }
z+=2; matched = 1; // if z=0, now z=2
}
// ==> 5 columns incl. LEADING SPACE
if((s1[n]==43)||(s1[n]==60)||(s1[n]==62)||(s1[n]==99)||(s1[n]==106)||(s1[n]==107)||(s1[n]==116)||(s1[n]==126))
{
switch(s1[n])
{
case 43: x=0; break;
case 60: x=1; break;
case 62: x=2; break;
case 99: x=3; break;
case 106: x=4; break;
case 107: x=5; break;
case 116: x=6; break;
case 126: x=7; break;
}
for(y=0;y<5;y++)
{
pat[z+y] = ascii_char5[x][y]; // y=0,1,2,3,4
}
z+=5; matched = 1; // if z=0, then z=5
} // end of IF s1 compare for 5columns
// ==> 4 columns incl. LEADING SPACE
if((s1[n]==34) || (s1[n]==40) || (s1[n]==41) || (s1[n]==49) || (s1[n]==73) || (s1[n]==91) || (s1[n]==93)
|| (s1[n]==105) || (s1[n]==108) || (s1[n]==123) || (s1[n]==125))
{
switch(s1[n])
{
case 34: x=0; break;
case 40: x=1; break;
case 41: x=2; break;
case 49: x=3; break;
case 73: x=4; break;
case 91: x=5; break;
case 93: x=6; break;
case 105: x=7; break;
case 108: x=8; break;
case 123: x=9; break;
case 125: x=10; break;
}
for(y=0;y<4;y++)
{
pat[z+y] = ascii_char4[x][y];
}
z+=4; matched = 1;
} // end of IF s1 compare for 4columns
// ==> 3 columns incl. LEADING SPACE
if((s1[n]==39) || (s1[n]==44) || (s1[n]==46) || (s1[n]==58) || (s1[n]==59) || (s1[n]==96))
{
switch(s1[n])
{
case 39: x=0; break;
case 44: x=1; break;
case 46: x=2; break;
case 58: x=3; break;
case 59: x=4; break;
case 96: x=5; break;
}
for(y=0;y<3;y++)
{ pat[z+y] = ascii_char3[x][y]; }
z+=3; matched = 1;
} // end of IF s1 compare for 3columns
if( (s1[n]>34) && (s1[n]<65) && (matched==0) ) // run this ONLY IF the char. ('#' <--> '@') incl. numeric
{
x = s1[n] - 35;
for(y=0;y<6;y++)
{
pat[z+y] = ascii_char6[x][y];
}
z+=6;
matched = 1;
}
if( (s1[n]>64) && (s1[n]<96) && (matched==0) ) // run this ONLY IF the char. ('A' <--> '_') incl. numeric
{
x = s1[n] - 65;
for(y=0;y<6;y++)
{ pat[z+y] = ascii_char7[x][y]; }
z+=6;
matched = 1;
}
if( (s1[n]>96) && (s1[n]<123) && (matched==0) ) // run this ONLY IF the char. ('a' <--> 'z') incl. numeric
{
x = s1[n] - 97;
for(y=0;y<6;y++)
{ pat[z+y] = ascii_char8[x][y]; }
z+=6;
matched = 1;
}
} //END OF for-loop for n-flag
delay_ms(100);
} // END of INPUT(PIN_E1) |
Please help....I've been trying very hard to solve this problem.
THANK YOU.
Ernest |
|
 |
dz
Joined: 03 Mar 2012 Posts: 4
|
| Re: HOW TO SCROLL 8X8 LED |
Posted: Sat Mar 03, 2012 6:39 pm |
|
|
Hello mark...
I am new in this forum.
I have problem. How to scroll word using 8 (7x5 led) using pic16f877 ?
I used the program in your reply to Isaac aiyanyo but still not function.
I hope you can help me.
Thanks in advance.
Dz |
|
 |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
| Read the CCS forum guide |
Posted: Sun Mar 04, 2012 2:09 pm |
|
|
Give us a clue.
Show us what you have done.
Give us a description of your hardware or a schematic.
Tell us concisely:-
(1) What is wrong.
(2) What your code does that it shouldn't.
(3) What you expect your code to do.
(4) How your code is supposed to operate.
(5) Your compiler version No.
Send a SHORT compilable version of you code which demonstrates the problem.
YOU must help us to help you.
Mike |
|
 |
dz
Joined: 03 Mar 2012 Posts: 4
|
| How to scroll message on 8 units 5x7 dot matrix |
Posted: Tue Mar 06, 2012 7:36 am |
|
|
Ok Mike thanks because you try to help me.
Actually i'm doing my third semester project on my high school.
My project using PIC16F877, 20MHz crystal, 8 units of 74LS595, 1 unit CD4017, 8 units 5x7 dot matrix.
I try to submit the schematic diagram in this reply box bot don't know how.
I really need you help me.
I will try to send the schematic to you via email.
The program as shown below.
Thanks a lot...
//Project: scroll dot matrix on 8 units 7X5 Dot Matrix
//PIC: PIC16F877
//Crystal Frequency: 20MHz
//Compiler: HI-TECH ANSI C / MPLAB IDE V8.83
#include <htc.h>
__CONFIG(0X3F32);
#define R7 RB6
#define R6 RB5
#define R5 RB4
#define R4 RB3
#define R3 RB2
#define R2 RB1
#define R1 RB0
#define DATA PORTB
#define _XTAL_FREQ 20000000
void pic_init();
void COLUMN(unsigned char i);
void ROW(unsigned char i);
void CHAR_A(unsigned char i);
void CHAR_B(unsigned char i);
void CHAR_C(unsigned char i);
void CHAR_D(unsigned char i);
void CHAR_E(unsigned char i);
void CHAR_F(unsigned char i);
void CHAR_G(unsigned char i);
void CHAR_H(unsigned char i);
void CHAR_I(unsigned char i);
void CHAR_J(unsigned char i);
void CHAR_K(unsigned char i);
void CHAR_L(unsigned char i);
void CHAR_M(unsigned char i);
void CHAR_N(unsigned char i);
void CHAR_O(unsigned char i);
void CHAR_P(unsigned char i);
void CHAR_Q(unsigned char i);
void CHAR_R(unsigned char i);
void CHAR_S(unsigned char i);
void CHAR_T(unsigned char i);
void CHAR_U(unsigned char i);
void CHAR_V(unsigned char i);
void CHAR_W(unsigned char i);
void CHAR_X(unsigned char i);
void CHAR_Y(unsigned char i);
void CHAR_Z(unsigned char i);
void CHAR_dot(unsigned char i);
void CHAR_clr(unsigned char i);
void CHAR_love(unsigned char i);
main()
{int i,j,k;
int speed=110,bright=110;;
pic_init(); // initialize PIC
for(;;){
for(i=1;i<=speed;i++){
for(j=1;j<=5;j++){
for(k=1;k<=bright;k++){
COLUMN(j);CHAR_love(j);}}}
for(i=1;i<=speed;i++){
for(j=1;j<=5;j++){
for(k=1;k<=bright;k++){
COLUMN(j);CHAR_D(j);}}}
for(i=1;i<=speed;i++){
for(j=1;j<=5;j++){
for(k=1;k<=bright;k++){
COLUMN(j);CHAR_Z(j);}}}
for(i=1;i<=speed;i++){
for(j=1;j<=5;j++){
for(k=1;k<=bright;k++){
COLUMN(j);CHAR_A(j);}}}
}}
void pic_init(){
TRISA=0b00000000;
TRISB=0b00000000;
TRISC=0b00000000;
TRISD=0b00000000;
TRISE=0b00000000;
ADRESL=0b00000000;
ADRESH=0b00000000;
PORTA=0b00000000;
PORTB=0b00000000;
PORTC=0b00000000;
PORTD=0b00000000;
PORTE=0b00000000;}
void COLUMN(unsigned char i)
{switch(i){
case 1:C1=0xff;C2=0x0;C3=0x0;C4=0x0;C5=0x0;break;
case 2:C1=0x0;C2=0xff;C3=0x0;C4=0x0;C5=0x0;break;
case 3:C1=0x0;C2=0x0;C3=0xff;C4=0x0;C5=0x0;break;
case 4:C1=0x0;C2=0x0;C3=0x0;C4=0xff;C5=0x0;break;
case 5:C1=0x0;C2=0x0;C3=0x0;C4=0x0;C5=0xff;break;}
}
void ROW(unsigned char i)
{DATA=((DATA|0xFF)&i);
}
void CHAR_A(unsigned char i)
{switch(i){
case 1:ROW(0b01111110);break;
case 2:ROW(0b00001001);break;
case 3:ROW(0b00001001);break;
case 4:ROW(0b00001001);break;
case 5:ROW(0b01111110);break;}
}
void CHAR_B(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b01001001);break;
case 3:ROW(0b01001001);break;
case 4:ROW(0b01001001);break;
case 5:ROW(0b10111110);break;}
}
void CHAR_C(unsigned char i)
{switch(i){
case 1:ROW(0b00111110);break;
case 2:ROW(0b01000001);break;
case 3:ROW(0b01000001);break;
case 4:ROW(0b01000001);break;
case 5:ROW(0b01000001);break;}
}
void CHAR_D(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b01000001);break;
case 3:ROW(0b01000001);break;
case 4:ROW(0b01000001);break;
case 5:ROW(0b00111110);break;}
}
void CHAR_E(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b01001001);break;
case 3:ROW(0b01001001);break;
case 4:ROW(0b01001001);break;
case 5:ROW(0b01001001);break;}
}
void CHAR_F(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b00001001);break;
case 3:ROW(0b00001001);break;
case 4:ROW(0b00001001);break;
case 5:ROW(0b00000001);break;}
}
void CHAR_G(unsigned char i)
{switch(i){
case 1:ROW(0b00111110);break;
case 2:ROW(0b01001001);break;
case 3:ROW(0b01001001);break;
case 4:ROW(0b01001001);break;
case 5:ROW(0b00110010);break;}
}
void CHAR_H(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b00001000);break;
case 3:ROW(0b00001000);break;
case 4:ROW(0b00001000);break;
case 5:ROW(0b01111111);break;}
}
void CHAR_I(unsigned char i)
{switch(i){
case 1:ROW(0b01000001);break;
case 2:ROW(0b01000001);break;
case 3:ROW(0b01111111);break;
case 4:ROW(0b01000001);break;
case 5:ROW(0b01000001);break;}
}
void CHAR_J(unsigned char i)
{switch(i){
case 1:ROW(0b00111001);break;
case 2:ROW(0b01000001);break;
case 3:ROW(0b01000001);break;
case 4:ROW(0b01000001);break;
case 5:ROW(0b01111111);break;}
}
void CHAR_K(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b00001000);break;
case 3:ROW(0b00010100);break;
case 4:ROW(0b00100010);break;
case 5:ROW(0b01000001);break;}
}
void CHAR_L(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b01000000);break;
case 3:ROW(0b01000000);break;
case 4:ROW(0b01000000);break;
case 5:ROW(0b01000000);break;}
}
void CHAR_M(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b00000010);break;
case 3:ROW(0b00011100);break;
case 4:ROW(0b00000010);break;
case 5:ROW(0b01111111);break;}
}
void CHAR_N(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b00000100);break;
case 3:ROW(0b00001000);break;
case 4:ROW(0b000100000);break;
case 5:ROW(0b01111111);break;}
}
void CHAR_O(unsigned char i)
{switch(i){
case 1:ROW(0b00111110);break;
case 2:ROW(0b01000001);break;
case 3:ROW(0b01000001);break;
case 4:ROW(0b01000001);break;
case 5:ROW(0b00111110);break;}
}
void CHAR_P(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b00001001);break;
case 3:ROW(0b00001001);break;
case 4:ROW(0b00001001);break;
case 5:ROW(0b00000110);break;}
}
void CHAR_Q(unsigned char i)
{switch(i){
case 1:ROW(0b01011110);break;
case 2:ROW(0b00100001);break;
case 3:ROW(0b01010001);break;
case 4:ROW(0b01000001);break;
case 5:ROW(0b00111110);break;}
}
void CHAR_R(unsigned char i)
{switch(i){
case 1:ROW(0b01111111);break;
case 2:ROW(0b00001001);break;
case 3:ROW(0b00001001);break;
case 4:ROW(0b00011001);break;
case 5:ROW(0b01100110);break;}
}
void CHAR_S(unsigned char i)
{switch(i){
case 1:ROW(0b00100110);break;
case 2:ROW(0b01001001);break;
case 3:ROW(0b01001001);break;
case 4:ROW(0b01001001);break;
case 5:ROW(0b00110010);break;}
}
void CHAR_T(unsigned char i)
{switch(i){
case 1:ROW(0b00000001);break;
case 2:ROW(0b00000001);break;
case 3:ROW(0b01111111);break;
case 4:ROW(0b00000001);break;
case 5:ROW(0b00000001);break;}
}
void CHAR_U(unsigned char i)
{switch(i){
case 1:ROW(0b00111111);break;
case 2:ROW(0b01000000);break;
case 3:ROW(0b01000000);break;
case 4:ROW(0b01000000);break;
case 5:ROW(0b00111111);break;}
}
void CHAR_V(unsigned char i)
{switch(i){
case 1:ROW(0b00011111);break;
case 2:ROW(0b00100000);break;
case 3:ROW(0b01000000);break;
case 4:ROW(0b00100000);break;
case 5:ROW(0b00011111);break;}
}
void CHAR_W(unsigned char i)
{switch(i){
case 1:ROW(0b00111111);break;
case 2:ROW(0b01000000);break;
case 3:ROW(0b00111111);break;
case 4:ROW(0b01000000);break;
case 5:ROW(0b00111111);break;}
}
void CHAR_X(unsigned char i)
{switch(i){
case 1:ROW(0b01100011);break;
case 2:ROW(0b00010100);break;
case 3:ROW(0b00001000);break;
case 4:ROW(0b00010100);break;
case 5:ROW(0b01100011);break;}
}
void CHAR_Y(unsigned char i)
{switch(i){
case 1:ROW(0b00000111);break;
case 2:ROW(0b00001000);break;
case 3:ROW(0b01110000);break;
case 4:ROW(0b00001000);break;
case 5:ROW(0b00000111);break;}
}
void CHAR_Z(unsigned char i)
{switch(i){
case 1:ROW(0b01100001);break;
case 2:ROW(0b01010001);break;
case 3:ROW(0b01001001);break;
case 4:ROW(0b01000101);break;
case 5:ROW(0b01000011);break;}
}
void CHAR_dot(unsigned char i)
{switch(i){
case 1:ROW(0b00000000);break;
case 2:ROW(0b00000110);break;
case 3:ROW(0b00000110);break;
case 4:ROW(0b00000000);break;
case 5:ROW(0b00000000);break;}
}
void CHAR_clr(unsigned char i)
{switch(i){
case 1:ROW(0b00000000);break;
case 2:ROW(0b00000000);break;
case 3:ROW(0b00000000);break;
case 4:ROW(0b00000000);break;
case 5:ROW(0b00000000);break;}
}
void CHAR_love(unsigned char i)
{switch(i){
case 1:ROW(0b00011110);break;
case 2:ROW(0b00111111);break;
case 3:ROW(0b01111110);break;
case 4:ROW(0b00111111);break;
case 5:ROW(0b00011110);break;}
} |
|
 |
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
| Off topic |
Posted: Tue Mar 06, 2012 7:45 am |
|
|
Unfortunately this forum is for CCS C. We can't support Hi-Tech C  |
|
 |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
| No no no |
Posted: Tue Mar 06, 2012 8:41 am |
|
|
I said a post a SHORT code section, not the whole lot for a different compiler. Nobody here is going to give you the time of day if you don't follow the forum guidance.
You can do schematics like this in notepad, then copy & paste. They look wrong in the editor but are OK in 'code' boxes.
| Code: |
-----------------
RD7 -------WWW---------| o o o o o o o o |
RD6 -------WWW---------| o o o o o o o o |
RD5 -------WWW---------| o o o o o o o o |
RD4 -------WWW---------| o o o o o o o o |
RD3 -------WWW---------| o o o o o o o o |
RD2 -------WWW---------| o o o o o o o o |
RD1 -------WWW---------| o o o o o o o o |
RD0 -------WWW---------| o o o o o o 0 0 |
-----------------
| | | | | | | |
RC7 --------------------- | | | | | | |
RC6 ----------------------- | | | | | |
RC5 ------------------------- | | | | |
RC4 --------------------------- | | | |
RC3 ----------------------------- | | |
RC2 ------------------------------- | |
RC1 --------------------------------- |
RC0 -----------------------------------
|
You can use crude boxes with labels for chips. We don't need posh pictures to get the idea. It's up to you to make it easy for us to help you. We (or I) do not want to wade through mountains of code to locate your problems/bugs/typos. We are not going to do your homework for you. We will give you a helping hand to assist in getting you to work it out for yourself.
Are you intending to use CCS compiler? If not you will have to try elsewhere.
Mike |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|