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

LCD16x2 Driver

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



Joined: 08 Mar 2012
Posts: 38
Location: Canada

View user's profile Send private message

LCD16x2 Driver
PostPosted: Wed Mar 21, 2012 6:01 pm     Reply with quote

Hello,

I am testing a 16x2 LCD driver source code on a PIC16F877A, and I am having trouble understanding what one section of it does:

Code:
#include <pic.h>
static bit LCD_RS @ ((unsigned)&PORTE*8+0); // Register select
static bit LCD_EN @ ((unsigned)&PORTE*8+2); // Enable
static bit LCD_RW @ ((unsigned)&PORTE*8+1); // R/W
#define EN_TRIG ((LCD_EN = 1),(LCD_EN = 0));


The error I am getting when I compile is that the #include <pic.h> cannot be found.

What does this portion of code mean?:
Code:
@ ((unsigned)&PORTE*8+0);


Couldn't that whole portion of code be replaced by the code below since TRISE = 0x89?:
Code:

#include<16F877A.h>
static bit LCD_RS = 0x9.0 // Register Select
static bit LCD_EN = 0x9.2 // ENable
static bit LCD_RW = 0x9.1 // R/W
#define EN_TRIG ((LCD_EN = 1),(LCD_EN = 0));
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 6:35 pm     Reply with quote

That's because it's for the Hi-Tech C compiler. Are you using CCS or
Hi-Tech ?

If you are using the CCS compiler:
If you need an lcd driver, don't waste your time converting Hi-Tech code
to CCS. Just use the CCS compatible drivers. Either use lcd.c from the
CCS drivers directory:
Quote:

c:\program files\picc\drivers\lcd.c

Or use the Flex lcd driver in the Code Library forum
http://www.ccsinfo.com/forum/viewforum.php?f=2
wordizlife



Joined: 08 Mar 2012
Posts: 38
Location: Canada

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 6:57 pm     Reply with quote

I am using CCS.

So I will be looking at the lcd.c file.

I had created my own LCD header file but I am having trouble sending data to the screen that is coming from another pic and thought that my coding would probably have been the problem.
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