PDA

View Full Version : Multi Language Support on LCD ?



muskut
- 8th June 2007, 13:24
Hi All,

I am on a new project. I am using a 2x16 LCD. I have to make multi language support. I have a lot of way that goes to the solving. But I am searching more powerful and stable an algorithm. I can use ALGORITHM1, there is no problem. But I am using all codes again again that how much I am using language selection. So If I am using 3 lang. supports that means the size of code 3x(1 lang. code size). So Its not efficient. For example

;---------- ALGORITHM 1---------------
;for English
if lang=0 then
lcdout 254, 0, "English Menu"
....
....
.... (All program codes)
endif

;For German
if lang=1 then
lcdout 254, 0, "German Menu"
....
....
.... (All program codes again)
endif



;For Italian
if lang=3 then
lcdout 254, 0, "Italian Menu"
....
....
.... (All program codes again)
endif
;-------------------------


But I want to develop ALGORITHM 2. But I have some problem. I want to use variables for the LCD's menus. So the user when the select the language I will change the variables's value to the suitable language value and I will stamp to the lcd's menu. But I didn't find how I can I do that. I mean:

;---------- ALGORITHM 2---------------
; LCD menu's items.
; we are adjusting LCD menu's language
if lang=0 then
Var1 = "Eng. Menu 1"
Var2 = "Eng. Menu 2"
endif
if lang=1 then
Var1 = "Ger. Menu 1"
Var2 = "Ger. Menu 2"
endif
if lang=3 then
Var1 = "Ita. Menu 1"
Var2 = "Ita. Menu 2"
endif

lcdout 254, 0, Var1
lcdout 254, 40, Var2
....
....
.... (All program codes, only one)
;-------------------------

I hope I could describe my problems. what should I do? I need your valued ideas. Thank you so much.

best regards

Acetronics2
- 8th June 2007, 13:37
Hi, Muskut

A SEARCH with the "STRING" Keyword should show you that subject is not so new ...

Alain

mister_e
- 8th June 2007, 13:39
Routines will be the same , just the language will be different. So you could just store your strings in an external EEPROM and read from there. Choice is yours, 1 EEPROM/Language... Let's say you're using I2CEEPROM,
I2CREAD SCL,SDA,Language, addr...

or a Huge EEPROM + StartAddress offset.
I2CREAD SCL,SDA,ControlByte, addr+Language...

think about it... sure you can start from that.

muskut
- 8th June 2007, 14:03
An external eeprom can be solving. But I am using 16F876A and I am using 4 bit LCD. And I want to solve this problem with only this devices. I have to develop a good algorithm.

Thanks a lot for the answers.

skimask
- 8th June 2007, 14:05
An external eeprom can be solving. But I am using 16F876A and I am using 4 bit LCD. And I want to solve this problem with only this devices. I have to develop a good algorithm.

Thanks a lot for the answers.

Silly idea...could program one '876A for each language, stack the chips, bend out the MCLR pin and put a toggle switch or a DIP switch going to each MCLR. The language you select is the MCLR that's allowed to rise after power on...

mister_e
- 8th June 2007, 14:07
So... store your text strings in the code space and use something around the above suggestion.
http://www.pbpgroup.com/modules/wfsection/article.php?articleid=10