|
|
View previous topic :: View next topic |
Author |
Message |
jbeginner
Joined: 14 Apr 2010 Posts: 1
|
Flex_lcd.c - #DEVICE required before that line |
Posted: Wed Apr 14, 2010 9:26 pm |
|
|
thx alot for that code
but actually it didn't work with me ,,,,,, when i compile it ,i get that error
"a #DEVICE required before that line"
int8 const LCD_INIT_STRING[4] =
actually i can't understand why is that so i need ur help as i really need to use flex ports within my pic (i am using 16F877A)
thxxxxx alot
waiting 4 ur reply |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19545
|
|
Posted: Thu Apr 15, 2010 1:55 am |
|
|
You might simply try searching the forum....
Have answered this in the last few days.
Basically, with CCS, follow the following layout in your code:
First include the processor file - in your case #include "16F877A.h"
Then add any other device lines (ADC=10 etc.)
Then setup your fuses
Then setup your clock
Then your RS232
These may all be in a single 'project' include file, but should still be in this order.
Then have any defines needed by later include files (so pin defines for LCD, etc.).
Only now, include the other files (flex LCD etc.).
Then have your other code.
Order is _vital_. You cannot define any memory arrays etc., _before_ the processor is defined. Similarly, you cannot use RS232, or delays, before the clock is defined, etc. etc..
Best Wishes |
|
|
|
|
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
|