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

PIC18F4580 -- Using INTOSC fuse

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



Joined: 24 Jun 2005
Posts: 1

View user's profile Send private message Send e-mail

PIC18F4580 -- Using INTOSC fuse
PostPosted: Fri Jun 24, 2005 2:28 pm     Reply with quote

The Pic-C compiler seems to have problem using the PIC18F4580's internal oscillator with the following code:

#include <18f4580.h>
#device ADC=8
#fuses INTOSC,NOWDT,NOPROTECT,NOLVP
#use delay(clock=8000000)
#use rs232(baud=9600,parity = E, bits = 7, xmit=PIN_C1, rcv=PIN_C0)


What sort of cajolling does one have to do to get Pic-C to compile to use the built in internal Oscillator. I don't want to use the internal rc circuit (INTRC).
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 24, 2005 3:29 pm     Reply with quote

Can you post the Fuse options listed at the top of your 18F4580.H file ?
mickey231bhq



Joined: 06 Apr 2005
Posts: 19
Location: Formosa

View user's profile Send private message

PostPosted: Fri Jun 24, 2005 10:57 pm     Reply with quote

Code:
////////////////////////////////////////////////////////////////// INTERNAL RC
// Constants used in setup_oscillator() are:
// First param:
#define OSC_31KHZ   0
#define OSC_125KHZ  0x10
#define OSC_250KHZ  0x20
#define OSC_500KHZ  0x30
#define OSC_1MHZ    0x40
#define OSC_2MHZ    0x50
#define OSC_4MHZ    0x60
#define OSC_8MHZ    0x70
// The following may be OR'ed in with the above using |
#define OSC_TIMER1  1
#define OSC_INTRC   2
#define OSC_NORMAL  0
// A second optional parametter may be used with this part to fine
// tune the speed (signed int)
// Result may be (ignore all other bits)
#define OSC_STATE_STABLE 4
// Second param:
#define OSC_31250   0xC0
#define OSC_31KHZ   0
#define OSC_PLL_ON  0x40
#define OSC_PLL_OFF 0
// The tune value 0-31 may be OR'ed in with the above using |
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