View previous topic :: View next topic |
Author |
Message |
miskol
Joined: 01 Feb 2011 Posts: 16
|
How to display ADC value on LCD ? |
Posted: Tue Feb 01, 2011 2:42 am |
|
|
How to display ADC value on the LCD using the Flex driver?
Example, this command can be used to display ADC value on serial.
Code: |
printf("ADC Port RA0: %03u\n\r", value);
|
How to do? Can it be done using the Flex_LCD.c driver? If not, please help to upgrade the code to include such feature.
Thank you very much. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Tue Feb 01, 2011 3:04 am |
|
|
Code: |
printf(lcd_putc,"\fADC Port RA0: %03u\n\r", value);
|
The '\f', will make the LCD clear, and go back to the first line. If you don't want to do this, you will need to use something like the lcd_goto command to position your output where you want it, before sending the data.
Best Wishes |
|
|
miskol
Joined: 01 Feb 2011 Posts: 16
|
|
Posted: Tue Feb 01, 2011 3:06 am |
|
|
It works! thanks! |
|
|
miskol
Joined: 01 Feb 2011 Posts: 16
|
|
Posted: Tue Feb 01, 2011 3:10 am |
|
|
How about character rotation?
Currently, my last problem is that the LCD is upside down, and I need to vertically rotate my characters (eg. 180 degree).
Please help, thank you. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Tue Feb 01, 2011 5:04 am |
|
|
Depends on your LCD. Most can't...
Best Wishes |
|
|
miskol
Joined: 01 Feb 2011 Posts: 16
|
|
Posted: Tue Feb 01, 2011 5:14 am |
|
|
it can. i tried by using a sample program from MPLab. the driver have the option for rotating the characters.
i tried to convert the driver from MPlab into ccs, but still couldn't do so. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Tue Feb 01, 2011 5:56 am |
|
|
This depends on your LCD. We cannot 'guess' what display you have, or what MPLAB driver you are talking about (there are thousands of the former, and dozens of the latter).
On displays that do support inversion, it is usually just a single bit change the the setup parameters, but we cannot help you, unless you tell us what display is involved...
Best Wishes |
|
|
miskol
Joined: 01 Feb 2011 Posts: 16
|
|
Posted: Tue Feb 01, 2011 8:09 am |
|
|
My LCD is JHD162A.
The driver from MPLAB that I used is xlcd.c |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 01, 2011 3:48 pm |
|
|
Prove it. Your LCD looks like a generic 16x2 character LCD module.
Prove that it has all these fancy features. Post a link to the documentation
and give the page and section that says it can display characters upside
down.
Other than the "8 custom characters" feature which is in every LCD of
this type, I don't know how you are going to make upside-down characters.
And you are limited to only 8 custom characters. That's not probably
not enough to display all your desired upside-down messages.
Also, prove that xlcd.c can somehow make 32 upside-down characters
simultaneously displayed on the 16x2 LCD. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Wed Feb 02, 2011 3:55 am |
|
|
There is a little about this, after some Googling.
The chip, is a 'substitute' COG unit, that Microchip are now using. Has _not_ got a software inversion, but has a hardware invert on pin 63. Designed to cover the situation where it can be put on the front or the back of the glass in manufacture. When this chip first appeared, there were references to the display being upside down with the standard MPLAB driver (which does the same job as the Flex driver). It appears Microchip, may have made a connection to the inversion pin, allowing a line on the PIC to invert the display. Problem is, that this is _undocumented_....
If xlcd, displays everything the right way up, then you need to disassemble this, and find what it is doing to invert the display.
Best Wishes |
|
|
miskol
Joined: 01 Feb 2011 Posts: 16
|
|
Posted: Sun Feb 13, 2011 5:15 am |
|
|
Sorry for my misinformation. I only saw the output on the lcd, the example program did rotate the characters 90degree. But after I checked the program, the characters is written bit by bit..something like that. |
|
|
|