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

lcd.c driver file

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



Joined: 29 Apr 2009
Posts: 13
Location: Kolkata,India

View user's profile Send private message Send e-mail

lcd.c driver file
PostPosted: Sat Aug 01, 2009 12:01 am     Reply with quote

I would like to use port C of pic16f876a to drive lcd. But standard lcd driver lcd.c uses port B or port D. Can it be modified for port C utilization? If yes, then where do I have to change in the code?

I do not want to use flex lcd as it creates some problems.
Please say how standard lcd.c can be used in my program.
anandpv2009



Joined: 26 Jul 2009
Posts: 31

View user's profile Send private message

PostPosted: Tue Aug 04, 2009 11:58 am     Reply with quote

I am also looking for such a driver. I can't use the port as output while using flex_lcd driver. I think it is not just a easy task......
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

Re: lcd.c driver file
PostPosted: Tue Aug 04, 2009 12:16 pm     Reply with quote

UDIPTA wrote:
I would like to use port C of pic16f876a to drive lcd. But standard lcd driver lcd.c uses port B or port D. Can it be modified for port C utilization? If yes, then where do I have to change in the code?

I do not want to use flex lcd as it creates some problems.
Please say how standard lcd.c can be used in my program.



in LCD.C
Code:

#ifndef LCD_DATA_PORT
   #if defined(__PCB__)
      #define LCD_DATA_PORT      0x06     //portb
      #define set_tris_lcd(x)   set_tris_b(x)
   #elif defined(__PCM__)
      #define LCD_DATA_PORT      getenv("SFR:PORTD")     //portd
   #elif defined(__PCH__)
      #define LCD_DATA_PORT      getenv("SFR:PORTD")    //portd
   #elif defined(__PCD__)
      #define LCD_DATA_PORT      getenv("SFR:PORTD")    //portd
   #endif   
#endif


You change it to the port you want.

PORTC would be your answer.

But also look closely at the header...

Code:

////  Example of pin access:                                               ////
////     #define LCD_ENABLE_PIN  PIN_E0                                    ////
////     #define LCD_RS_PIN      PIN_E1                                    ////
////     #define LCD_RW_PIN      PIN_E2                                    ////
////     #define LCD_DATA4       PIN_D4                                    ////
////     #define LCD_DATA5       PIN_D5                                    ////
////     #define LCD_DATA6       PIN_D6                                    ////
////     #define LCD_DATA7       PIN_D7                                    ////


Don't forget to define your control pins.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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