PIC18F4685 40Mhz Crystal configuration
Moderator: Benj
PIC18F4685 40Mhz Crystal configuration
Hi, I have a PIC18F4685 that i try to run on a External 40Mhz Crystal, I connect the crystal between pin 13 and 14 of the PIC and add 2 22pF cap between pin 13 and 14 to ground. But with the 1 sec led flash, i can not find a way to make this chip start at all. hat are the configuration required in Flowcode to make this setup start ? Tanx a lot!
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC18F4685 40Mhz Crystal configuration
Hi Speedy,
Try these config settings. Also are you pulling the MCLR pin up to VDD using a resistor? If not then change the "Master Clear Enable" config setting.
Try these config settings. Also are you pulling the MCLR pin up to VDD using a resistor? If not then change the "Master Clear Enable" config setting.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: PIC18F4685 40Mhz Crystal configuration
I have tried those settings and still no go! To make the chip run at 8Mhz on internal oscillator, i was using the osccon = 0x76;, I have removed it to run at 40Mhz, but does i need to change it or set anything else in my code ?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC18F4685 40Mhz Crystal configuration
Hello,
Have you got the datasheet for the crystal you are using. I have had problems before where the shunt capacitance of the crystal was too large meaning it wouldn't work correctly with a PIC micro. You should not require any additional code at the start of your program to get the crystal working. The device does have an onboard PLL or phase locked loop which you can use to multiply the speed of a much slower crystal. Would this be worth a go?
Have you got the datasheet for the crystal you are using. I have had problems before where the shunt capacitance of the crystal was too large meaning it wouldn't work correctly with a PIC micro. You should not require any additional code at the start of your program to get the crystal working. The device does have an onboard PLL or phase locked loop which you can use to multiply the speed of a much slower crystal. Would this be worth a go?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: PIC18F4685 40Mhz Crystal configuration
I have nerver been able to make the 40Mhz work, but with the exact same cap, the 19660800Mhz work perfectly!!
-
- Posts: 258
- Joined: Wed Nov 29, 2006 6:32 pm
- Location: Finland
- Has thanked: 7 times
- Been thanked: 36 times
- Contact:
Re: PIC18F4685 40Mhz Crystal configuration
Hi.
Try without caps, I might work.
Or at least I have used 25MHz Xtals without caps for quick testings, and it has worked..
If it works, then add small capacitence, and test..
Or like Ben says, use 10Mhz Xtal, and pll, at least that should work..
You dont have to remove internal osc config, just change the the osc config at HS or HSPLL on the PPP, and chip uses external osc.
Mika
Try without caps, I might work.
Or at least I have used 25MHz Xtals without caps for quick testings, and it has worked..
If it works, then add small capacitence, and test..
Or like Ben says, use 10Mhz Xtal, and pll, at least that should work..
You dont have to remove internal osc config, just change the the osc config at HS or HSPLL on the PPP, and chip uses external osc.
Mika