scorrpeio
Full Member level 5
The hardware is something like this....
MCU - 128x64 GLCD
The interface may be serial(3 wire spi) or parallel.
Now, I have a set of messages which MCU should display on the LCD regularly or based on the keypad events.
My Design approach is....
1. Save the char codes of A, B...Z; a,b...z; 0,1...9; and special symbols(%,$,*,&,^) on to the Code memory in the form of const char A[] = {code bytes for A}
const char B[] = {code bytes for B} ...and so on
2. Save all the required messages to be displayed on LCD as strings in code memory.
For ex. const char Msg1[] = "The Overflow Count: -"
const char Msg2[] = "Currency Value: - "
3. In program, based on the keypad event or timer event, I would call the Msg1, Msg2 etc using pointer.
Further each character from that string is copied into a variable. This variable will compare the char with the char code database and get the char code for that char.
For ex, in Msg1[], the first char is 'T'
So,
The Data in the CharCodePtr is transmitted to GLCD.
Kindly Let me know if my approach is correct or it will lead to disaster.
I am in state of design, so didnt actually try it on code yet.
MCU - 128x64 GLCD
The interface may be serial(3 wire spi) or parallel.
Now, I have a set of messages which MCU should display on the LCD regularly or based on the keypad events.
My Design approach is....
1. Save the char codes of A, B...Z; a,b...z; 0,1...9; and special symbols(%,$,*,&,^) on to the Code memory in the form of const char A[] = {code bytes for A}
const char B[] = {code bytes for B} ...and so on
2. Save all the required messages to be displayed on LCD as strings in code memory.
For ex. const char Msg1[] = "The Overflow Count: -"
const char Msg2[] = "Currency Value: - "
3. In program, based on the keypad event or timer event, I would call the Msg1, Msg2 etc using pointer.
Further each character from that string is copied into a variable. This variable will compare the char with the char code database and get the char code for that char.
For ex, in Msg1[], the first char is 'T'
So,
Code:
TempVar = 'T';
Switch (TempVar)
{
case 'A':
CharCodePtr = &A[0];
break;
.
.
.
.
case 'T':
CharCodePtr = &T[0];
break;
.
.
.
}
The Data in the CharCodePtr is transmitted to GLCD.
Kindly Let me know if my approach is correct or it will lead to disaster.
I am in state of design, so didnt actually try it on code yet.
Last edited: