Log in

View Full Version : External resonator help



rlmack35
- 29th May 2010, 18:39
I'm trying to use a 25MHz osc but it runs like 4 times slower. (1 sec = 4 sec) . I know I need to set the config1h but not sure how to do this. I tried a few samples from what ppl posted but its not compiling. Here are the stats:

18F2620 / 18F4620
PBP Pro 2.50b

mackrackit
- 29th May 2010, 18:50
Are you setting the fuses in the .inc or code space?
http://www.picbasic.co.uk/forum/showthread.php?t=543

In he MPASM directory under program files you will find more .inc files for your chip. Near the bottom of the file all of the options will be listed.

rlmack35
- 30th May 2010, 11:01
I am trying to set it up in the code space
I am new to settings other than defaults. I know that i need it to be in HS mode but everything that I have tried will not compile without errors.

rsocor01
- 30th May 2010, 11:31
I'm trying to use a 25MHz osc but it runs like 4 times slower. (1 sec = 4 sec) . I know I need to set the config1h but not sure how to do this. I tried a few samples from what ppl posted but its not compiling. Here are the stats:

18F2620 / 18F4620
PBP Pro 2.50b

rlmack35,

What kind of tests are you making to determine that your chip runs four times slower? Remember that for Microchip PICs one instruction takes four cycles of the oscillator.

Robert

rlmack35
- 31st May 2010, 08:49
simple test program

TEST:
HIGH PORTB.1
PAUSE 1000
LOW PORTB.1
PAUSE 1000
GOTO TEST

The light should turn on and off in 1 sec intervals.

mackrackit
- 31st May 2010, 09:30
Please post your complete code with the configs so we can see what you got.

Allister
- 1st June 2010, 04:43
simple test program

TEST:
HIGH PORTB.1
PAUSE 1000
LOW PORTB.1
PAUSE 1000
GOTO TEST

The light should turn on and off in 1 sec intervals.

That works but personally I like to increase the time if you are doing a visual on/off led measurement, if you measure on/off cycles over a period of say one or two minutes you can average a more precise result. That is just me though.

rlmack35
- 2nd June 2010, 07:49
ok but that is not what i'm looking for. mine wasn't off by milliseconds it was off by seconds like 3 or 4 seconds on and 3 or 4 seconds off. but once i installed a 4MHz resonator in it worked just fine.

Now back on track, can someone help/explain the config of chips to me? I dont mean what they do that much i understand. I mean how to get them into my program or setting them someplace else.

mackrackit
- 2nd June 2010, 13:37
Now back on track, can someone help/explain the config of chips to me? I dont mean what they do that much i understand. I mean how to get them into my program or setting them someplace else.
See the link in post #2 of this thread.