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 CCS Technical Support

Problem with pic16f877a

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



Joined: 25 Mar 2010
Posts: 4

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

Problem with pic16f877a
PostPosted: Mon Apr 05, 2010 9:19 pm     Reply with quote

My project by creating a tool MPLAB and PICC. I want to display text on screen glcd 128 * 64, I have some errors as follows:
Quote:

The target "C: \ projectA \ glcd not keypad-16F877A \ GLCD.o" is already up to date.
Executing: "C: \ Program files \ Picc \ CCSC.exe" + FM "main.c" EXPORT + + DF + LN + T + A + M + Z + Y = 9 + EA
*** Error 23 "C: \ PROGRA ~ 1 \ PICC \ devices \ 16F877A.h" Line 2 (9.19): Can not change device type this far into the code
Info 300 --- "C: \ PROGRA ~ 1 \ PICC \ devices \ 16F877A.h" Line 165 (6.11): More info: The First Declaration of CCP_1
*** Error 31: "C: \ PROGRA ~ 1 \ PICC \ devices \ 16F877A.h" Line 165 (6.11): Identifier is already used in this scope
Info 300 --- "C: \ PROGRA ~ 1 \ PICC \ devices \ 16F877A.h" Line 169 (6.11): More info: The First Declaration of CCP_2
*** Error 31 "C: \ PROGRA ~ 1 \ PICC \ devices \ 16F877A.h" Line 169 (6.11): Identifier is used already in this scope
D: \ projectA \ glcd not keypad-16F877A \ main.o ===> 3 Errors, 0 Warnings.

I use the PICC glcd.c library and I was adding more declarations
#include <16F877A.h> in PICC library and main.c , but still error.
Can someone tell me where I was wrong? Thanks you very much!
This is my program:
Code:

# Include <16F877A.h>
# Include "GLCD.C"

# Fuses HS, NOWDT, NOPROTECT, NOLVP
# Use delay (clock = 12000000)

void main ()
(
char text1 [3] [25] = ("orange that low com", "my middle tom," "My xao thit bo");
char text2 [3] [25] = ("cafe den da", "cafe da nau", "Water lemon");
glcd_init (ON);
glcd_fillScreen (1);
delay_cycles (10);
glcd_text57 (0, 0, text1 [0], 1, OFF);
glcd_text57 (0, 8, text1 [1], 1, OFF);
glcd_text57 (0, 15, text1 [2], first, OFF);
glcd_text57 (0, 22, text2 [0], 1, OFF);
glcd_text57 (0, 29, text2 [1], 1, OFF);
glcd_text57 (0, 36, text2 [2], 1, OFF);
)
Ttelmah



Joined: 11 Mar 2010
Posts: 19503

View user's profile Send private message

PostPosted: Tue Apr 06, 2010 2:13 am     Reply with quote

Fuses, and clock setttings, _must_ be before code that uses them.
Layout should be:

Compiler include file
Device statements (ADC etc.)
Fuses
Clock settings
Setups for RS232/I2C etc..
Other include files
Main code

This can be tweaked a little (fuses after clock settings for example), but generally this is the order that things should appear for them to work.

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