• AVR Freaks

Hot!External 20MHz not working on PIC18F4550

Page: < 123 > Showing page 2 of 3
Author
jack@kksound
code tags!
  • Total Posts : 3198
  • Reward points : 0
  • Joined: 2014/05/14 10:03:19
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 10:37:36 (permalink)
+2 (2)
Gort2015
Joining the 3.3v (top and bottom) and (0v top and bottom) tracks.
 


Hopefully NOT 3.3 volts on an 18F4550......minimum is 4.2.
Also 22pF may be too much considering possible capacitances of the plugboard.
#21
Flipp3rix
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/28 14:40:19
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 10:44:59 (permalink)
0
Gort2015
Joining the 3.3v (top and bottom) and (0v top and bottom) tracks.
 


Already did
#22
KTrenholm
Super Member
  • Total Posts : 709
  • Reward points : 0
  • Joined: 2012/08/08 14:04:23
  • Location: Connecticut, USA
  • Status: offline
Re: External 20MHz not working 2019/03/21 10:46:37 (permalink)
0
Do you have the means such as a Oscilloscope to determine if the oscillator is actually oscillating when powered?
#23
Flipp3rix
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/28 14:40:19
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 11:10:43 (permalink)
0
Something happen if i touch my solder joint on my perfoboard something starts to work
I have ulpaded a video on youtube, maybe you can tell me what'is wrong or whathappent to my solder joints, i'm using pull up resistor on both input and output pins
 
LINK:https://www.youtube.com/watch?v=jyPEWWqOS14&feature=youtu.be
#24
pcbbc
Super Member
  • Total Posts : 1104
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: online
Re: External 20MHz not working 2019/03/21 11:40:26 (permalink)
+1 (1)
Try putting the crystal as close as possible to the PIC pins.  Ideally (if you can) without using any connecting wires.
So:
1. Crystal in the breadboard rows attached to the CLK pins.
2. Capacitors straight from those rows down to ground.
 
Edit: I don;t think you marked your video public.  It says "unavailable" when I try to view it.
post edited by pcbbc - 2019/03/21 11:42:11
#25
Flipp3rix
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/28 14:40:19
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 11:56:33 (permalink)
0
pcbbc
Try putting the crystal as close as possible to the PIC pins.  Ideally (if you can) without using any connecting wires.
So:
1. Crystal in the breadboard rows attached to the CLK pins.
2. Capacitors straight from those rows down to ground.
 
Edit: I don;t think you marked your video public.  It says "unavailable" when I try to view it.




I updated the video, now you should see it
 
What a bad day man :(
#26
pcbbc
Super Member
  • Total Posts : 1104
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: online
Re: External 20MHz not working 2019/03/21 12:31:49 (permalink)
+2 (2)
The crystal being on the breadboard while the PIC is mounted on the vero is just horrid! Sorry.
All kinds of noise and stray capacitance introduced by that.
Put the crystal and capacitors as close as possible the the micro controller pins. Hardwire them on the vero board.
Either that or use the internal oscillator, if your device has one.
#27
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: External 20MHz not working 2019/03/21 12:35:14 (permalink)
+1 (1)
pcbbc
The crystal being on the breadboard while the PIC is mounted on the vero is just horrid! Sorry.
All kinds of noise and stray capacitance introduced by that.
Put the crystal and capacitors as close as possible the the micro controller pins. Hardwire them on the vero board.
Either that or use the internal oscillator, if your device has one.

Agreed.
You can get away with some pretty horrid wiring at 4MHz, but at 20MHz you have to start paying proper attention to your wiring, inductance, and ground return paths.
 

Nearly there...
#28
Flipp3rix
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/28 14:40:19
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 12:42:07 (permalink)
0
qhb
pcbbc
The crystal being on the breadboard while the PIC is mounted on the vero is just horrid! Sorry.
All kinds of noise and stray capacitance introduced by that.
Put the crystal and capacitors as close as possible the the micro controller pins. Hardwire them on the vero board.
Either that or use the internal oscillator, if your device has one.

Agreed.
You can get away with some pretty horrid wiring at 4MHz, but at 20MHz you have to start paying proper attention to your wiring, inductance, and ground return paths.
 


I'm currentyly develop a pcb board in eagle, any suggestions?
#29
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: External 20MHz not working 2019/03/21 12:47:27 (permalink)
+1 (1)
Keep the tracks to the crystal as short as possible, and the ground return tracks from the load capacitors back to the PIC should also be as short as possible.
 

Nearly there...
#30
Flipp3rix
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/28 14:40:19
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 13:01:03 (permalink)
0
qhb
Keep the tracks to the crystal as short as possible, and the ground return tracks from the load capacitors back to the PIC should also be as short as possible.
 


Ok then... in this days I will open a new topic about my custom board, thanks to all of you anf for your patiencie :)
 
Have a nice day
#31
dan1138
Super Member
  • Total Posts : 3122
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 14:10:45 (permalink)
+1 (1)
@Flipp3rix,

You have connected a 20MHz crystal to a PIC18F4550 in every wrong way possible.

1 - The wires from the PIC18F4550 to the crystal are each over 3 inches long.
2 - The 20MHz crystal is on a solderless breadboard.
3 - The 22pF capacitors are also on a solderless breadboard.

The only way to make this worse would be to connect the circuit to the wrong pins on the PIC18F4550.

To make it stable you MUST solder the pins of the 20MHz crystal to the pins 13 and 14 of the DIP-40 socket (on the bottom of the prototype PCB you have the PIC18F4550 socket in). Then solder the two 22pF capacitors one from pin 13 to pin 12, the other from pin 14 to pin 12.

So do yourself a favor and use a better physical method to connect a crystal to the oscillation amplifier.
#32
RodoPIC
Senior Member
  • Total Posts : 174
  • Reward points : 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 15:48:28 (permalink)
0
Why #include "XC8.h" and not #include <XC8.h>
post edited by RodoPIC - 2019/03/21 15:53:23
#33
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: External 20MHz not working 2019/03/21 15:54:35 (permalink)
+1 (1)
(Your code tags didn't work because you had \code where it should be /code)
We're having just that discussion about the xc.h location in this topic:
https://www.microchip.com/forums/m1091116.aspx
 
 

Nearly there...
#34
Gort2015
Klaatu Barada Nikto
  • Total Posts : 3122
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/21 17:49:28 (permalink)
-1 (1)
Hopefully NOT 3.3 volts on an 18F4550......minimum is 4.2.
Also 22pF may be too much considering possible capacitances of the plugboard.

No.

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#35
jack@kksound
code tags!
  • Total Posts : 3198
  • Reward points : 0
  • Joined: 2014/05/14 10:03:19
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/22 07:38:39 (permalink)
+2 (2)
Gort2015
Hopefully NOT 3.3 volts on an 18F4550......minimum is 4.2.
Also 22pF may be too much considering possible capacitances of the plugboard.

No.


No what?
From the datasheet DS39632E for the 18F2455/2550/4455/4550:
Note 2. Table 28.1 DC characteristics
"PIC18F products in this device family are rated for 4.2V minimum in all oscillator modes."
 
And all that extra wire and solderless plugboard are definitely going to make a 20 Mhz oscillator unhappy.
 
#36
NiKHiL
New Member
  • Total Posts : 23
  • Reward points : 0
  • Joined: 2017/11/24 05:02:22
  • Location: India
  • Status: offline
Re: External 20MHz not working 2019/03/22 23:15:19 (permalink)
+1 (1)
In your schematic MCLR pin in unconnected, so make sure it is pulled up, because MCLR is ON in your configuration bits.
#37
Gort2015
Klaatu Barada Nikto
  • Total Posts : 3122
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/23 03:45:56 (permalink)
0
"No what?"
Agreeing with, "Hopefully NOT 3.3 volts on an 18F4550......minimum is 4.2."

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#38
nigelwright7557
Super Member
  • Total Posts : 227
  • Reward points : 0
  • Joined: 2006/11/06 08:15:51
  • Location: 0
  • Status: offline
Re: External 20MHz not working 2019/03/23 06:34:12 (permalink)
0
I use 20MHz crystal with two 15pf capacitors and have never had a problem.
 
#39
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: External 20MHz not working 2019/03/23 14:12:03 (permalink)
0
nigelwright7557
I use 20MHz crystal with two 15pf capacitors and have never had a problem.

You've probably never attempted a physical arrangement as poor as the OP's!
 

Nearly there...
#40
Page: < 123 > Showing page 2 of 3
Jump to:
© 2019 APG vNext Commercial Version 4.5