View previous topic :: View next topic |
Author |
Message |
pierscintilla
Joined: 08 Aug 2005 Posts: 54 Location: italy
|
Posted: Sun Jan 02, 2022 4:43 pm Post subject: lcd char problem |
|
|
Hello. I have to represent a sequence of about ten parameters on the LCD display. Each parameter has its own unit of measurement that I want to appear after the value. To avoid many ifs, I generate an array (of 5 characters each) each containing the unit of measurement required for each parameter and then I recall the array relating to each measurement. Everything works except when "°C" should appear.
I've tried all sorts of ways (basically writing the symbol directly and inserting the number corresponding to the character in curly brackets) but instead of the degree sign I get an incorrect character (usually an X with a slash above or the minus sign if i writing the symbol directly). This also happens with other characters beyond 127.
I also point out that I tried with Edit_Insert_Ascii but nothing works. In place of the panel, only a very small box opens that does not allow any choice.
No idea?
Thank you
(BASCOM-AVR version : 2.0.8.5 ) |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Sun Jan 02, 2022 5:36 pm Post subject: |
|
|
Hi,
Please supply code that repreduces the problem. Without code it's hard to help.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
pierscintilla
Joined: 08 Aug 2005 Posts: 54 Location: italy
|
Posted: Sun Jan 02, 2022 6:06 pm Post subject: |
|
|
Ok. Here is my test code
Code: |
$sim
$regfile = "m328pdef.dat"
$crystal = 16000000
$baud = 9600
$hwstack = 32
$swstack = 10
$framesize = 40
Config Lcdpin = Pin , Db4 = Portb.0 , Db5 = Portb.1 , Db6 = Portb.2 , Db7 = Portb.3 , E = Portb.4 , Rs = Portb.5 'setta lcd pin 8-13
Config Lcd = 16x2
Cursor Off Noblink
Cls
locate 1,1
Lcd "°C"
locate 2,1
lcd "{248}C"
End |
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sun Jan 02, 2022 6:32 pm Post subject: |
|
|
you need to have a look at the character map of your lcd display.
otherwise check deflcdchar _________________ Mark |
|
Back to top |
|
|
pierscintilla
Joined: 08 Aug 2005 Posts: 54 Location: italy
|
Posted: Sun Jan 02, 2022 9:41 pm Post subject: |
|
|
I don't think it is a problem of the character map of my lcd because the Bascom simulator has exactly the same problem. However in the character map of my lcd the symbol I want is obtained with HHLH in the upper bits and HHHH in the lower bits. How can I generate it?
Adopting the deflcdchar would mean inserting several IFs (which I would like to avoid) instead of "drawing" from an array.
Then there is the problem of the non-functioning of the edit_insert_ascii ... |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sun Jan 02, 2022 9:50 pm Post subject: |
|
|
edit insert ascii works but maybe you use an old configuration file.
again : look into the datasheet of your LCD font map. there are many different LCD and some have multiple font maps.
before you conclude it does not work you really must know what the manufacturer says in the datasheet what should be shown. so check and upload an image of the font map.
the simulator just simulates one of many maps.
also, take a good look at deflcdchar, it allows to design your own character and show it with a low ascii number. there is a sample too.
it has zero to do with your if then. unless you prove otherwise with your code. _________________ Mark |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Sun Jan 02, 2022 9:55 pm Post subject: |
|
|
Hi,
I imagine they mean with HHLH - 1101 and HHHH - 1111. So the character you want is 11011111 binary or 223 decimal (which works in the simulator).
lcd "{223}C"
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
pierscintilla
Joined: 08 Aug 2005 Posts: 54 Location: italy
|
Posted: Sun Jan 02, 2022 10:19 pm Post subject: |
|
|
Great Dobson. You turned me on a light! Sot works.
For Mark: What does it mean that I am using an old config file? What should I do to fix it?
Thank you |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Mon Jan 03, 2022 8:52 pm Post subject: |
|
|
Old config file means XML file from previous version of Bascom. XML file keeps all the user settings but sometimes you want to reset it into default.
To reset this settings (and keep backup if you want to back) you need to do those steps:
1 - In the Bascom main bar choose "Help"->"About"
2 - Then click "App Data Dir"
3 - When WIndows open that folder you should close the Bascom program. (Because all settings are keeped in the RAM and saved on the program closing)
4 - Right click on the bascom-avr2085.xml and "Rename" it into "bacom-avr2085_.xml" or whatever you want.
5 - After next launching Bascom will not find previous setting and create default one.
6 - If you are not happy with the default setting then you can turn off Bascom and delete new bascom-avr2085.xml and rename old one from underscore to previous name. Then Bascom run as it was before.
Thats all.
|
|
Back to top |
|
|
|