View previous topic :: View next topic |
Author |
Message |
a Guest
|
Please help me. If i used pic18f458 with crystal 40 MHz. |
Posted: Wed Dec 15, 2004 10:19 am |
|
|
Please help me. If i used pic18f458 with crystal 40 MHz. How many value of Capacitor for 40MHz Crystal? Because i use c=22Pf . it is not work.
And in datasheet of PIC18F458 in table2-2. What is TBD. Please explain me. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Dec 15, 2004 10:56 am |
|
|
What voltage are you running the processor at?
Please post your #fuse settings. |
|
|
Ttelmah Guest
|
Re: Please help me. If i used pic18f458 with crystal 40 MHz. |
Posted: Wed Dec 15, 2004 11:20 am |
|
|
a wrote: | Please help me. If i used pic18f458 with crystal 40 MHz. How many value of Capacitor for 40MHz Crystal? Because i use c=22Pf . it is not work.
And in datasheet of PIC18F458 in table2-2. What is TBD. Please explain me. |
You cannot use the 18F458 with a 40MHz crystal...
The options are:
Use 10Mhz, and the PLL
Use an external oscillator module.
The internal oscillator is rated for 25MHz _maximum_. Table 27-6 in the data sheet.
Best Wishes |
|
|
Ttelmah Guest
|
|
Posted: Wed Dec 15, 2004 11:21 am |
|
|
TBD is 'To Be Determined' |
|
|
a Guest
|
|
Posted: Thu Dec 16, 2004 3:20 am |
|
|
#include <18F458.h>
#device adc=8
#use delay(clock=40000000,RESTART_WDT)
#fuses NOWDT,WDT128,HS, NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, PUT, NOCPD, NOSTVREN, NODEBUG, NOLVP, NOWRT, NOWRTD, NOWRTB, NOCPB, NOWRTC, NOEBTR, NOEBTRB
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=SDATA1) |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Thu Dec 16, 2004 5:39 am |
|
|
Quote: | The internal oscillator is rated for 25MHz _maximum_. Table 27-6 in the data sheet. | Looking at table 27-6 I read it as 40MHz being allowed in the -40C to +85C temperature range. The 25MHz maximum is for the temperature range +85C to +125C.
Most people running the PIC18F458 at 40MHz are using a 10MHz crystal combined with the internal PLL frequency multiplier because of better EMC properties and I guess 10MHz crystals are easier to acquire.
At a quick glance I don't see any errors in the #fuses line. Only one strange thing, you have set the Brown Out voltage reset at 2.0V, with a processor running at 5V this seems a bit low.
Which brings me to the next thing; You didn't answer my question about the voltage you are running the processor at.
What exact version of the 458 are you using? Please give the exact type number as it is on your chip package so we can see if it is the F or LF and the industrial or Extended temperature range.
Many small details can go wrong, but before going into this any further make sure the rest of your circuit is correct. An easy way to prove this is by placing a 10MHz crystal and a small test program blinking a led. |
|
|
a Guest
|
|
Posted: Thu Dec 16, 2004 9:42 am |
|
|
thank you "ckielstra" Now i use crystal 4 pin==> Vcc,GND,OUTPUT,N/C
its is OK. now i'm not use capacitor. and my Vcc is 5V. Thank you for your reply. |
|
|
Ttelmah Guest
|
|
Posted: Thu Dec 16, 2004 4:22 pm |
|
|
I must have a different version of the 'sheet' to you Ckielstra. On mine, the maximum _oscillator_ frequency for the internal oscillator, is listed a 25MHz, independant of temperature range. The maximum CLKI frequency _for an external source_ goes to 40Mz on the lower temperature range. This is why I said that an external oscillator (rather than using the internal oscillator), was one option. This is what the original poster has now done...
Best Wishes |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Dec 17, 2004 2:45 am |
|
|
Hi Ttelmah,
The name of my datasheet is 41159c.pdf (January 2003), it turns out there is a newer version 41159d.pdf (September 2004). This newer document has the maximum frequency for HS oscillator lowered from 40MHz to 25MHz.
Thanks for helping me find this new datasheet document. |
|
|
Ttelmah Guest
|
|
Posted: Fri Dec 17, 2004 5:54 am |
|
|
That sounds a typical 'MicroChip' change, to really annoy people using the chip!.... :-)
Best Wishes |
|
|
achamber2k Guest
|
h4 |
Posted: Sun Dec 19, 2004 10:08 pm |
|
|
is h4 not hs in fuses, delay in 40000000 |
|
|
|