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 support@ccsinfo.com

PIC18F4550 internal clock

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



Joined: 28 Nov 2007
Posts: 2

View user's profile Send private message

PIC18F4550 internal clock
PostPosted: Wed Nov 28, 2007 9:37 am     Reply with quote

hello,

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

void main(void)
{
   TRISA=0x00;
   ADCON1=0b00001111;
   while(1)
   {
      PORTAbits.RA0 = 1;
      Delay10KTCYx(200);
      PORTAbits.RA0 = 0;
      Delay10KTCYx(200);
   }
}


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

View user's profile Send private message

PostPosted: Wed Nov 28, 2007 9:46 am     Reply with quote

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.

Avery
biertafel



Joined: 28 Nov 2007
Posts: 2

View user's profile Send private message

PostPosted: Wed Nov 28, 2007 9:49 am     Reply with quote

ow Embarassed
sorry Embarassed
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