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 Driver for 18LF4620

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



Joined: 17 May 2005
Posts: 3

View user's profile Send private message

Lcd Driver for 18LF4620
PostPosted: Wed May 25, 2005 8:52 am     Reply with quote

Hi everyone

I use a PIC18LF4620 with PCW 3.206.
I'm trying to use lcd driver using the code found at http://www.ccsinfo.com/forum/viewtopic.php?t=19327
(because the default "lcd.c" used for my old PIC16F877A doesn't work anymore with PIC18LF4620)

But I have compiler errors at these lines :
Code:

//*********  set tris d  *******
#define set_tris_lcd_read(){\
set_tris_a(TRISA & 0xf1/*0b11110001*/);\
set_tris_d(TRISD | 0x0f/*0b00001111*/);\
   }
#define set_tris_lcd_write(){\
   set_tris_a(TRISA & 0xf1/*0b11110001*/);\
   set_tris_d(TRISD & 0xf0/*0b11110000*/);\
   }

The error is : "Undefined identifier TRIS A"
When I tried to define TRISA (ex. #define TRISA 0x85), I have an another error which is : "Undefined Identifier set_tris_d."

The problem is that I don't really understand these lines. If you have examples of application or explanations I would be gratefull, maybe I can rewrite these instructions in an another way.
Ttelmah
Guest







PostPosted: Wed May 25, 2005 9:44 am     Reply with quote

1) Yes you need to define the TRIS registers to use the commands as given. The original poster must have been including a file with these definitions.
2) 0x85, is _not_ the address for th TRISA register on the 18 family. Read the data sheet...
3) You need to upgrade the compiler. There was a problem around the version you are using that though it 'purported' to support the 18F/LF4620, it still has the register map setup for the 2620 instead, and hence did not recognise portD.

Best Wishes
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