CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How to display ADC value on LCD ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
miskol



Joined: 01 Feb 2011
Posts: 16

View user's profile Send private message

How to display ADC value on LCD ?
PostPosted: Tue Feb 01, 2011 2:42 am     Reply with quote

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: 19359

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 3:04 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 3:06 am     Reply with quote

It works! thanks!
miskol



Joined: 01 Feb 2011
Posts: 16

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 3:10 am     Reply with quote

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: 19359

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 5:04 am     Reply with quote

Depends on your LCD. Most can't...

Best Wishes
miskol



Joined: 01 Feb 2011
Posts: 16

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 5:14 am     Reply with quote

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: 19359

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 5:56 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 8:09 am     Reply with quote

My LCD is JHD162A.
The driver from MPLAB that I used is xlcd.c
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 3:48 pm     Reply with quote

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: 19359

View user's profile Send private message

PostPosted: Wed Feb 02, 2011 3:55 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Feb 13, 2011 5:15 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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