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

PROBLEMS WITH #use delay(clock=4000000)

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



Joined: 19 Jun 2005
Posts: 2

View user's profile Send private message

PROBLEMS WITH #use delay(clock=4000000)
PostPosted: Wed Aug 03, 2005 3:55 am     Reply with quote

Hi

Im working with PIC18LF4620 with 4 MHz external clock.

my header is

#include <18F4620.h>
#device ICD=TRUE
#fuses NOWDT,XT,NOPUT
#use delay(clock=4000000)
#use rs232(DEBUGGER)

and the program never reach the main function, it remains at the #use delay(clock=4000000) line. The clock seems to work fine, my CCS compiler version its 3.224. If somebady knows abut this, all help its welcome,

thanks
_________________
dax
mickey231bhq



Joined: 06 Apr 2005
Posts: 19
Location: Formosa

View user's profile Send private message

PostPosted: Wed Aug 03, 2005 4:14 am     Reply with quote

XT???? Very Happy
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed Aug 03, 2005 8:42 am     Reply with quote

Quote:
XT???? Very Happy


In other words, try using HS instead of XT. Anytime you are running at 4MHZ or faster you should use HS (High Speed) fuse.

Ronald
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 03, 2005 12:42 pm     Reply with quote

Many PIC data sheets recommend XT for 4 MHz operation.
Examples:
16F877
16F877A
16F628
16F628A
18F452
I have used XT mode at 4 MHz on most of the PICs above with no problem.

For newer PICs, the data sheets give the option of using XT or HS mode
for a 4 MHz crystal. Examples:
16F88
16F688
18F4620

I don't think using XT mode is causing his problem.
It's more likely that he needs to add NOLVP to the #fuses statement.
That might fix the problem.
Kit
Guest







PostPosted: Wed Aug 03, 2005 9:15 pm     Reply with quote

#fuses NOWDT,XT,NOPUT

use
#fuses NOWDT,HS,NOPUT

or you can add
#fuses NOWDT,HS, NOPUT, NOLVP

I only manage to get my PIC run after adding NOLVP.

if you dont want to use MCLR
#fuses NOWDT,HS, NOPUT, NOLVP, NOMCLR (try this first)
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