View previous topic :: View next topic |
Author |
Message |
sokrates
Joined: 14 Mar 2007 Posts: 12
|
Clock Frequency of PIC 18F452 |
Posted: Fri Mar 16, 2007 7:28 am |
|
|
Hi there,
I'm having problems with the clock speed of PIC 18F452.
I configure my C code with
#fuses HS
#use delay(clock=10000000)
since I want to use a crystal of frequency 10 MHz.
However my simulation program (Proteus) does not seem to be accomodating with this change eventhough I use a 10 MHz crystal in the simulation.
Are there any suggestions ?
Thnx |
|
|
Ttelmah Guest
|
|
Posted: Fri Mar 16, 2007 7:45 am |
|
|
Sounds like Proteus problem.
There are a number like ths...
Simulators are not perfect.
What is actually giving problems?.
Have you tried exiting/restarting Proteus?.
Best Wishes |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Fri Mar 16, 2007 7:57 am |
|
|
What do you mean "does not seem to be accommodating with this change"?
It sounds like you are dropping a different crystal into the schematic you drew in Proteus and are expecting that to change the operating frequency of the PIC you also placed in the schematic.
You change the simulation frequency of the PIC in Proteus by right clicking on the PIC to get the Device Properties and then by selecting the frequency you want it to run at. NOT by drawing in a different crystal. You do not even have to have a crystal in the schematic. The simulation of the PIC's behaviour is purely a digital one.
Every Proteus problem I've ever seen described on this board seems to be of the RTFM variety.
r.b. |
|
|
sokrates
Joined: 14 Mar 2007 Posts: 12
|
So .. |
Posted: Fri Mar 16, 2007 8:13 am |
|
|
So the crystal option in Proteus is just an accessory?
In reality, the PIC will accomodate my crystal frequency, right?
The question is, is there any configurable mode of PIC that either selects the internal osc. or the crystal frequency?
Thanks for the advice... |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Fri Mar 16, 2007 8:25 am |
|
|
Well, the schematic is also used to generate a board layout, so you'd draw in a crystal and the remaining circuit if you also wanted to continue on and lay things out. But you do not need to draw in the crystal to simulate.
As this is a digital simulation, the PIC's oscillator circuitry is not simulated and is merely assigned as a property.
Quote: | The question is, is there any configurable mode of PIC that either selects the internal osc. or the crystal frequency? |
Each PIC, in real life, has several clocking options that can be selected with the fuses. Proteus does not simulate these as far as I know. The datasheets will tell you which options can be selected for use in the real world. |
|
|
|