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

I2C/Serial LCD

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







I2C/Serial LCD
PostPosted: Wed Apr 23, 2008 5:38 am     Reply with quote

Hi,

I'm currently using a DS1307 I2C real time clock and i can display the time/date on PC. I'd like to be able to display this on my I2C/Serial LCD that i purchased.

I can display normal text on LCD fine but don't know how i'd display the time/date as the data is converted from bcd into bytes by the CCS example. I realise that you tell the printf function what you want to display it in and it converts it but how would i do this for the LCD?

Any ideas?

Thanks DVC
Matro
Guest







PostPosted: Wed Apr 23, 2008 5:42 am     Reply with quote

If you use the serail feature of your LCD, the same way as you do with the PC. But you probably have to add some extra commands to set up the LCD.

We can't say more because we don't know neither the LCD part number nor the used protocol.

Matro
dvc
Guest







PostPosted: Wed Apr 23, 2008 5:48 am     Reply with quote

Hi Tthanks for your reply,

Sorry, i'd like to use in I2C mode. I can drive the LCD fine to display text messages but don't know how to diplay time.

I thought i'd need to convert the byte data from the rtc to decimal before sending to LCD?
Matro
Guest







PostPosted: Wed Apr 23, 2008 6:14 am     Reply with quote

You have to convert each digit (decimal value) in the corresponding ASCII character.
But that's simply done by adding 0x30 to the decimal value (this works only for numerical digits).

Matro.
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