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 CCS Technical Support

LCD programing

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



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

LCD programing
PostPosted: Tue Jan 24, 2017 8:07 am     Reply with quote

Why in the LCD.c file, if I want to write (lcd_putc), a read routine is performed before the writing routine?
What is being checked before the execution of data writing? There is some documentation about it???
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Tue Jan 24, 2017 8:42 am     Reply with quote

Before you attempt to access the LCD you first need to "ask" it if it is busy; it will hold its data bit 7 high if it is busy. All the driver is doing is checking this busy flag and waiting until it clears, if it is set, before proceeding.

You can omit the read if you respect the delays that you'll need to give the LCD between accesses in order to allow it to complete one task before giving it another.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jan 24, 2017 10:59 am     Reply with quote

The flex lcd driver in the code library forum has the option of not using
the R/W line and therefore it doesn't poll the busy bit. It uses delays
as newguy said.
rfjhh



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

PostPosted: Wed Feb 01, 2017 9:35 am     Reply with quote

Thanks.
Another question: What's lcdlat, where is it???
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 01, 2017 10:04 am     Reply with quote

Use the forum's search page to find the threads that have lcdlat in them.
Here is the link to the search page:
http://www.ccsinfo.com/forum/search.php
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Feb 01, 2017 10:06 am     Reply with quote

lcdlat could refer to the 'latch' or output port of a PIC. Newer PICs have them.
My version of LCD.C and FlexLCD.c do not have 'lcdlat' though.

Jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 01, 2017 10:07 am     Reply with quote

Come on Jay, the search engine shows it to be in the Code Library.
It's a #byte statement for the LCD's data port.
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Feb 01, 2017 11:29 am     Reply with quote

hmm.. I just checked again and neither my copies of lcd.c and flex_lcd.c have 'lcdlat' in them, according to edit>find......

now I'm thinking I may have old versions and they've been 'updated' over the past few years ?

Jay
rfjhh



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

PostPosted: Wed Feb 01, 2017 2:02 pm     Reply with quote

Guys

I've find where, in LCD.c, the lcdlat definition is made:

#if defined(__PCB__)
LCD_PIN_MAP lcd, lcdlat;
#byte lcd = LCD_DATA_PORT
#byte lcdlat = LCD_DATA_PORT
#elif defined(__PCM__)
LCD_PIN_MAP lcd, lcdlat, lcdtris;
#byte lcd = LCD_DATA_PORT
#byte lcdlat = LCD_DATA_PORT
#byte lcdtris = LCD_DATA_PORT+0x80
#elif defined(__PCH__)
LCD_PIN_MAP lcd, lcdlat, lcdtris;
#byte lcd = LCD_DATA_PORT
#byte lcdlat = LCD_DATA_PORT+9
#byte lcdtris = LCD_DATA_PORT+0x12
#elif defined(__PCD__)
LCD_PIN_MAP lcd, lcdlat, lcdtris;
#word lcd = LCD_DATA_PORT
#word lcdlat = LCD_DATA_PORT+2
#word lcdtris = LCD_DATA_PORT-0x02
#endif
#endif //LCD_DATA4 not defined

Thanks
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