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

Unable to Compile lcd.c

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







Unable to Compile lcd.c
PostPosted: Thu Apr 17, 2003 1:23 pm     Reply with quote

I am using a 2x16 display and a 16F877 and trying to run the ex_lcdkb.c program which uses the lcd.c. When I compile the program I get the following error.

"Unknown Type" and the word boolean is highlighted.

code snippet:
PRE

// As defined in the following structure the pin connection is as follows:
// D0 enable
// D1 rs
// D2 rw
// D4 D4
// D5 D5
// D6 D6
// D7 D7
//
// LCD pins D0-D3 are not used and PIC D3 is not used.

// Un-comment the following define to use port B
// #define use_portb_lcd TRUE

#DEVICE PIC16f877 *=16
struct lcd_pin_map {
boolean enable; // This is where error accours
boolean rs;
boolean rw;
boolean unused;
int data : 4;
} lcd;

/PRE

What do I need to do?

Thanks
___________________________
This message was ported from CCS's old forum
Original Post ID: 13768
Dave Yeatman
Guest







Re: Unable to Compile lcd.c
PostPosted: Thu Apr 17, 2003 1:42 pm     Reply with quote

<font face="Courier New" size=-1>This is because BOOLEAN is not a standard type in CCS C. You have to put in either #define BOOLEAN short int -or- include the 16F877.h header file as the first line. You will also have to change the current first line to #device *=16

Dave


:=I am using a 2x16 display and a 16F877 and trying to run the ex_lcdkb.c program which uses the lcd.c. When I compile the program I get the following error.
:=
:="Unknown Type" and the word boolean is highlighted.
:=
:=code snippet:
:=PRE
:=
:= // As defined in the following structure the pin connection is as follows:
:=// D0 enable
:=// D1 rs
:=// D2 rw
:=// D4 D4
:=// D5 D5
:=// D6 D6
:=// D7 D7
:=//
:=// LCD pins D0-D3 are not used and PIC D3 is not used.
:=
:=// Un-comment the following define to use port B
:=// #define use_portb_lcd TRUE
:=
:=#DEVICE PIC16f877 *=16
:=struct lcd_pin_map {
:= boolean enable; // This is where error accours
:= boolean rs;
:= boolean rw;
:= boolean unused;
:= int data : 4;
:= } lcd;
:=
:=/PRE
:=
:=What do I need to do?
:=
:=Thanks</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 13770
R.J.Hamlett
Guest







Re: Unable to Compile lcd.c
PostPosted: Thu Apr 17, 2003 1:43 pm     Reply with quote

:=I am using a 2x16 display and a 16F877 and trying to run the ex_lcdkb.c program which uses the lcd.c. When I compile the program I get the following error.
:=
:="Unknown Type" and the word boolean is highlighted.
:=
:=code snippet:
:=PRE
:=
:= // As defined in the following structure the pin connection is as follows:
:=// D0 enable
:=// D1 rs
:=// D2 rw
:=// D4 D4
:=// D5 D5
:=// D6 D6
:=// D7 D7
:=//
:=// LCD pins D0-D3 are not used and PIC D3 is not used.
:=
:=// Un-comment the following define to use port B
:=// #define use_portb_lcd TRUE
:=
:=#DEVICE PIC16f877 *=16
:=struct lcd_pin_map {
:= boolean enable; // This is where error accours
:= boolean rs;
:= boolean rw;
:= boolean unused;
:= int data : 4;
:= } lcd;
:=
:=/PRE
:=
:=What do I need to do?
:=
:=Thanks
#include <16F877.h>

as the first line of your file.
Then do your 16 bit pointer defintion, as
#DEVICE *=16

Otherwise you will get an error saying that you cannot change the type this far into the code.
The include file, has th Boolean definition in it.

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 13771
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: Unable to Compile lcd.c
PostPosted: Thu Apr 17, 2003 1:48 pm     Reply with quote

:=
:=/PRE
:=

Everyone else answered the main question before me, so I'll
mention one other item:

You're trying to use the PRE and /PRE tags, but they
didn't work. That's because you need to enclose them inside
"angle brackets". Here is a demo page that shows you how
to do it.
<a href="http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_pre" TARGET="_blank">http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_pre</a>
___________________________
This message was ported from CCS's old forum
Original Post ID: 13772
whmeade10
Guest







Re: Unable to Compile lcd.c
PostPosted: Fri Apr 18, 2003 9:24 am     Reply with quote

Thanks to everyone who responded to my question. I have the LCD working perfectly with the 16F877.

Bill
___________________________
This message was ported from CCS's old forum
Original Post ID: 13790
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