Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[SOLVED] compilation d'un code en C avec mplab v8 et compilateur c18

Status
Not open for further replies.

dido1987

Member level 2
Joined
Apr 1, 2011
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,633
J'ai un erreur bizarre empêche la compilation dans le fichier main dont je veux configurer la port B en sortie j'ai déclaré les bibliothèques
#include <p18f4550.h>
#include <stdio.h>
et j'ai met
set_tris_b(0);
et en plus j'ai essayé
set_tris_b(0x00);
mais l'erreur suivant sorte :
MPLINK 4.14, Linker
Copyright (c) 2007 Microchip Technology Inc.
Error - could not find definition of symbol 'set_tris_b' in file 'C:\Users\Administrateur\Desktop\PIC-USB-fonctionnel\main.o'.
Errors : 1

Link step failed.
BUILD FAILED: Fri Apr 15 14:15:14 2011

j'ai aucune idée comment le corriger !!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

dido1987

Member level 2
Joined
Apr 1, 2011
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,633
un compilateur postuler par michrochip "mplabc18-v3_37_01-lite-installer"
 

horace1

Advanced Member level 5
Joined
Nov 18, 2008
Messages
2,123
Helped
596
Reputation
1,188
Reaction score
573
Trophy points
1,393
Location
Norwich, UK
Activity points
13,071
I have never seen
Code:
set_tris_b(0);
using mcc18 compiler, I would use
Code:
TRISB = 0;
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,273
Trophy points
1,413
Location
Southwest, USA
Activity points
62,490
I believe set_tris_b() is in CCS compiler lib.

CCS built-in functions

...
set_pwm4_duty( )*
set_pwm5_duty( )*
set_pwm_duty( )+
set_rtcc( )*
set_timerx( )
set_timerxy( )+
set_tris_x( )
set_uart_speed( )
setjmp( )
setup_adc( )
....
Maybe you are using a code snippet written for the CCS compiler, dido1987.
 

dido1987

Member level 2
Joined
Apr 1, 2011
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,633
I believe set_tris_b() is in CCS compiler lib.

CCS built-in functions



Maybe you are using a code snippet written for the CCS compiler, dido1987.
I tayed TRISB=0x00; but it dosen't work the same error
now am thinking perhaps is the CDC configuration of usb code but i dont know were's the mistake
 

horace1

Advanced Member level 5
Joined
Nov 18, 2008
Messages
2,123
Helped
596
Reputation
1,188
Reaction score
573
Trophy points
1,393
Location
Norwich, UK
Activity points
13,071
it is very strange. I tried the following with mcc18
Code:
#include <p18f4550.h>

void main (void)
{
   TRISB = 0x00;
   PORTB = 0;
   PORTB = 0x5A;
   while (1)
    ;
}
which compiled and built OK with the following tools
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37

check you have the correct PIC18 seleceted in Configure > Select Device

try the above program and if it fails post the full error listing from the output window
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,273
Trophy points
1,413
Location
Southwest, USA
Activity points
62,490
Upload your code and I'll take a look at it.

---------- Post added at 18:46 ---------- Previous post was at 18:39 ----------

Are you using a library that perhaps is using CCS Compiler built-in functions?
 

dido1987

Member level 2
Joined
Apr 1, 2011
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,633
Upload your code and I'll take a look at it.

---------- Post added at 18:46 ---------- Previous post was at 18:39 ----------

Are you using a library that perhaps is using CCS Compiler built-in functions?
the code is not that small because am traying to write a code for connection between USB and my PIC18f4550,so T took the original code from microchip and reconfigurate with my needs it works but when i put TRISB to send data for PORTB one erreur appear and i searched all the code and i didin't find any thing for portb configuration except what i put in main ""TRISB"and still dont work
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,273
Trophy points
1,413
Location
Southwest, USA
Activity points
62,490
Can you zip up the whole project directory and upload it? This would make troubleshooting the problem much easier.
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,273
Trophy points
1,413
Location
Southwest, USA
Activity points
62,490
By the way, the compiler error is on line 94 in main.c. What is on line 94?


I just got your code, I take a look and get back with you.

---------- Post added at 09:24 ---------- Previous post was at 09:20 ----------

I guess line 94 is TRISB=0x00; . I need to start up my dev system with C18 and see what I come up with.
 

dido1987

Member level 2
Joined
Apr 1, 2011
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,633
the line 94 is " TRISB=0x00;" it isen't a strange thing by the way thinks for your help
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top