ganyfun
Joined: 25 Mar 2010 Posts: 4
|
Problem with pic16f877a |
Posted: Mon Apr 05, 2010 9:19 pm |
|
|
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
|
|
Posted: Tue Apr 06, 2010 2:13 am |
|
|
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 |
|