Hallo,
Habe ein Problem mit mehren *.c Dateien und Unterprogramme
MPLAP 7.60 und CCS Compiler
möchte mein Problem mal so beschreiben.
Projekt in MPLAP angelegt und als Compiler CCS gewählt.
Stepp mit Taste F7
Ablauf:
main;
UP init;
i = 0;
Rücksprung
Schleife;
i++;
i++;
" Dieses ist mein Problem "
Wenn ich mein Programm in mehrere *.c und *.h erstelle, Habe ich kein
Zugriff in *.c Dateien auf ein Unterprogramme.
die eingebundene *.h Dateien werden akzeptiert.
dann soll UP "TestenX" in "Testen.c" ausgeführt werden, aber diese
geschied nicht!!!
Hier geht das "Disassembly Listing" Fenster auf.
Programm Count ist an Adresse 000C
Folgender ASM Code
--- E:\Pic_C_Sourcecode\Stellpult\UsbPc\StellpultUsbPc.C
---------------------------------------
0012 EF26 GOTO 0x4c
000C 6A0F CLRF 0xf, ACCESS
000E 0E0A MOVLW 0xa
0010 6E0E MOVWF 0xe, ACCESS
--- E:\Pic_C_Sourcecode\Stellpult\UsbPc\UsbPcProject.h
-----------------------------------------
1: #include <18F4550.h>
005A 0003 SLEEP
--- E:\Pic_C_Sourcecode\Stellpult\UsbPc\myMain.c
-----------------------------------------------
1: #include <UsbPcProject.h>
0000 EF0B GOTO 0x16
2: #include <Testen.h>
3:
4:
5: #include "..\Global\GlobalPic18xxx.h"
Programm Count läuft bis Adresse 0010 und spring dann nach 0012 und
weiter nach 004C
folge Code benutze ich
//***********************
main.c
#include <UsbPcProject.h>
#include <Testen.h>
#include "GlobalPic18xxx.h"
void init()
{
i = 0;
}
void main()
{
init();
while(TRUE)
{
i ++;
i ++;
TestenX();
i ++;
i ++;
}
}
//***********************
UsbPcProject.h
#include <18F4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20mhz)
#use rs232(BAUD=9600, UART1, STREAM=PC)
//***********************
Testen.c
#include <UsbPcProject.h>
#include "GlobalPic18xxx.h"
void TestenX()
{
i = + 10;
}
//***********************
Testen.h
void TestenX();
//***********************
Global.h
long i;
//***********************
dieses sind die Compiler Meldungen
Clean: Deleting intermediary and output files.
Clean: Deleted file "myMain.ESYM".
Clean: Deleted file "E:\Pic_C_Sourcecode\Stellpult\UsbPc\myMain.o".
Clean: Deleted file "Testen.ESYM".
Clean: Deleted file "E:\Pic_C_Sourcecode\Stellpult\UsbPc\Testen.o".
Clean: Deleted file
"E:\Pic_C_Sourcecode\Stellpult\UsbPc\StellpultUsbPc.ESYM".
Clean: Deleted file "myMain.ERR".
Clean: Deleted file "Testen.ERR".
Clean: Deleted file
"E:\Pic_C_Sourcecode\Stellpult\UsbPc\StellpultUsbPc.COF".
Clean: Deleted file
"E:\Pic_C_Sourcecode\Stellpult\UsbPc\StellpultUsbPc.HEX".
Clean: Deleted file
"E:\Pic_C_Sourcecode\Stellpult\UsbPc\StellpultUsbPc.LST".
Clean: Deleted file
"E:\Pic_C_Sourcecode\Stellpult\UsbPc\StellpultUsbPc.PJT".
Clean: Deleted file
"E:\Pic_C_Sourcecode\Stellpult\UsbPc\StellpultUsbPc.ERR".
Clean: Done.
Executing: "C:\Programme\PICC\Ccsc.exe" +FH "myMain.c" +EXPORT +DF +LN
+T +A +M +Z +Y=9 +EA
E:\Pic_C_Sourcecode\Stellpult\UsbPc\myMain.o ===> 0 Errors, 0
Warnings.
Executing: "C:\Programme\PICC\Ccsc.exe" +FH "Testen.c" +EXPORT +DF +LN
+T +A +M +Z +Y=9 +EA
E:\Pic_C_Sourcecode\Stellpult\UsbPc\Testen.o ===> 0 Errors, 0
Warnings.
Executing: "C:\Programme\PICC\Ccsc.exe" +FH
LINK="StellpultUsbPc.hex=myMain.o,Testen.o" +DF +LN +T +A +M +Z +Y=9 +EA
Memory usage: ROM=0% RAM=0% - 0%
0 Errors, 0 Warnings.
Loaded E:\Pic_C_Sourcecode\Stellpult\UsbPc\StellpultUsbPc.cof.
BUILD SUCCEEDED: Sun Sep 07 12:01:19 2008
bin mit meinem Latein am Ende.
wünsche noch einen schönen Sonntag
Gruß Siegfried
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.