View previous topic :: View next topic |
Author |
Message |
dax
Joined: 19 Jun 2005 Posts: 2
|
PROBLEMS WITH #use delay(clock=4000000) |
Posted: Wed Aug 03, 2005 3:55 am |
|
|
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
|
|
Posted: Wed Aug 03, 2005 4:14 am |
|
|
XT???? |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Wed Aug 03, 2005 8:42 am |
|
|
Quote: | XT???? |
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
|
|
Posted: Wed Aug 03, 2005 12:42 pm |
|
|
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
|
|
Posted: Wed Aug 03, 2005 9:15 pm |
|
|
#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) |
|
|
|