we want to program a PIC18F4550 and use the internal clock
We have found this code:
Code:
#include <p18f4550.h>
#include <delays.h>
#pragma config FOSC = HS
#pragma config PWRT = OFF
#pragma config BOR = OFF
#pragma config WDT = OFF
#pragma config CCP2MX = OFF
#pragma config LVP = OFF
We use MPLab v7.6 with MMC18 compiler (student version).
We use MPLab ICD 2 to load the program in the pic.
We connect a LED and a resistor at RA0 and it seems that nothing is happening.
We think that the choice for the clock is wrong
we found on other sites that
Code:
#pragma config FOSC = HS
has to be changed to
Code:
#pragma config FOSC = INTRC
but when building this we get an error
Quote:
Make: The target "C:\Documents and Settings\Matthijs te Lintelo\Bureaublad\Biertafel programmeren\programma's\07-11-24_1\07-11-24_1\blinkled.o" is out of date.
Executing: "C:\MCC18\bin\mcc18.exe" -p=18F4550 "blinkled.c" -fo="blinkled.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
MPLAB C18 v3.14 (feature limited)
Copyright 1999-2005 Microchip Technology Inc.
This version of MPLAB C18 does not support the extended mode
and will not perform all optimizations. To purchase a full
copy of MPLAB C18, please contact your local distributor or
visit buy.microchip.com.
C:\Documents and Settings\Matthijs te Lintelo\Bureaublad\Biertafel programmeren\programma's\07-11-24_1\07-11-24_1\blinkled.c:5:Error [1225] configuration value 'INTRC' not recognized for configuration setting 'FOSC'
Halting build on first failure as requested.
BUILD FAILED: Wed Nov 28 16:20:06 2007
Here it looks like we have the wrong code or the compiler can't compile it (because of student version)
can anyone help us with this problem?
Matthijs & Wouter
amcfall
Joined: 20 Oct 2005 Posts: 44
Posted: Wed Nov 28, 2007 9:46 am
This forum is for the *CCS* compiler, not the Microchip C** series. Try the Microchip forums. The syntax is very different for pre processor directives.
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