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
Posted: Wed May 25, 2005 9:44 am
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.
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