Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Crystal Oscillator distance from OSC pins

Status
Not open for further replies.
Hi 3v0 and everbody. Here is the first design of the board(just made it.... been busy lately). The idea is of a general purpose target board that allows to use multiple reset, oscillator configurations, debugging, programming and also the UART tool. I want you guys's comments, suggestions and any faults that you find( if i am off my rocker than that too lmao). If this thing is ok than i will add ability to use the logic analyzer tool. All advice is welcome.

PS: I know the connector names are not easy. I intend to change them :p
 

Attachments

  • Guide to use the 40 pin Junebug Target Board.pdf
    312.3 KB · Views: 208
  • 40pin PICKIT2 Target Board schematic.png
    40pin PICKIT2 Target Board schematic.png
    16.4 KB · Views: 224
  • 40pin PICKIT2 Target Board.png
    40pin PICKIT2 Target Board.png
    18.7 KB · Views: 327
Last edited:
You need 0.1 uF bypass caps very close to each pair of power pins on the PIC. This is a common omission that leads to all sorts of interesting problems.

Also, are you sure that the crystal footprint is correct? The ones I use are > 0.2" spacing between the pins.

On my TAP-28 board, I use separate 6-pin connectors for ICSP and UART- just swapping connectors is easier than flipping switches.

One trick I recently figured out when using the PICkit 2 and you just want a UART output to monitor program operation. Set up a software UART with pin RB7 as the transmit line. Then you can program in the usual way with the PICkit 2, then fire off the UART tool to monitor program operation without switching anything! Just click CONNECT each time you start the UART tool. When you have new code to load, exit the UART tool, load it and switch back. Pretty slick.

I did however notice yesterday when using this trick extensively for the first time, some times the UART tool looked like it was working but I wasn't getting any output. Unplugging the PICkit 2, closing the GUI and starting over fixed it. I haven't figured out just what's causing this yet.
 
I would rather keep RB6 and RB7 for use with the MPLAB debugger and use a second PICkit2 for a Serial Tool or Logic Tool. But that is me.

Well, actually, it's me too 3V0, but the particular board I'm using has an ICSP connector and nothing else. The only thing better than a PICkit 2 is two PICkit 2s, but if making do with one, the software UART trick saves some screwing around.
 
Hi, and thanks for your suggestions.
You need 0.1 uF bypass caps very close to each pair of power pins on the PIC. This is a common omission that leads to all sorts of interesting problems.

Thanks Jon, this was the first thing i was supposed to add but forgot. Added them now

Also, are you sure that the crystal footprint is correct? The ones I use are > 0.2" spacing between the pins.

Yeah i know, but i have put female headers instead of crystals or any other components for that matter. I tried it and found that all components go in nice and are quite sturdy too!.

On my TAP-28 board, I use separate 6-pin connectors for ICSP and UART- just swapping connectors is easier than flipping switches.

One trick I recently figured out when using the PICkit 2 and you just want a UART output to monitor program operation. Set up a software UART with pin RB7 as the transmit line. Then you can program in the usual way with the PICkit 2, then fire off the UART tool to monitor program operation without switching anything! Just click CONNECT each time you start the UART tool. When you have new code to load, exit the UART tool, load it and switch back. Pretty slick.

I did however notice yesterday when using this trick extensively for the first time, some times the UART tool looked like it was working but I wasn't getting any output. Unplugging the PICkit 2, closing the GUI and starting over fixed it. I haven't figured out just what's causing this yet.

Nice tip about making the UART tool general, i could do that.
I would rather keep RB6 and RB7 for use with the MPLAB debugger and use a second PICkit2 for a Serial Tool or Logic Tool. But that is me.

I think BE has one you can build for about $10.

2 PICKIT2s? That would be a luxury! I have only made one clone and that too gave to my friend. Working on another though. I will do the UART/Logic tool thing in a single connector and make them usable separately from the debugger/programmer part.
 
Last edited:
For a board like that, just use an oscillator. Please. It is so much simpler. It isn't expensive. Pay someone else about 1/4 the cost of the ZIF to worry about load capacitance, isolation etc.


I guess it depends on your experiences. I've never had any problems with crystals, so it's hard for me the justify spending 10x more to go from a crystal to an oscillator (ok, maybe only 3x more by the time you add the caps).

Also, a random 20 MHz crystal from Farnell's has a 30 ppm frequency tolerance (and tighter tolerances can be had for a few pennies more) compared to 100 ppm on the oscillator.
 
I guess it depends on your experiences. I've never had any problems with crystals, so it's hard for me the justify spending 10x more to go from a crystal to an oscillator (ok, maybe only 3x more by the time you add the caps).

Also, a random 20 MHz crystal from Farnell's has a 30 ppm frequency tolerance (and tighter tolerances can be had for a few pennies more) compared to 100 ppm on the oscillator.

I think that it depends on your design cost. If the OP is making less than a few hundred, if you put any reasonable cost on the time for forum members, then an oscillator is cheaper. It is certainly a simple precaution if you have a long distance from the PIC to the oscillator / crystal. We certainly don't go and suggest to newbies that they should think of the price of every 10 nF decoupling capacitor, or tell them that a couple of inches from an IC will do in most cases. (Look at your own post on this thread).

The 100 ppm on the oscillator is the overall tolerance including adjustment. The 30 ppm for the crystal will usually be the temperature tolerance, and there is the adjustment and ageing to add to that, along with getting the capacitors correct to get within sight of the right frequency.

Also, the 100 ppm is just the standard tolerance. When I was making oscillators, we made 50 ppm and 100 ppm the same, and had next to none that weren't good enough for 50 ppm. We temperature tested the 25 ppm ones and only a small percentage didn't meet that.
 
I do not recall doing a pic layout where I had much problems getting the crystal in. In many/all cases the two OSC pins are next to the VSS pin. If you use a resonator in place of, a crystal and two caps, run the vss behind the resonator and you have it. As show below in red on this 16F886 layout.

smackFoil.png

Resonators are not quite as good as crystals but good enough for most every thing but directly generating NTSC or PAL signals. Much of the time I use the internal clocks.

It seems to me you are making this much harder then it has to be.
 
Here A nice tool it's cheap and it work great. The best clone there is LOL

No joke it works well.

It's powered by usb or you can use your own 3.3 volt power
 

Attachments

  • MY_CLONE.PNG
    MY_CLONE.PNG
    107.2 KB · Views: 168
Hi, here is an update on the board. I kept separate connectors for the UART tool and the programmer. I know things are congested so will improve it in my PCB design. Every thing works great apart from the crystal oscillator part(for which i started the thread in the first place). I believe it is a grounding problem. It starts execution when i touch the crystal on its top :(. Otherwise its working fine(with an internal oscillator of course).
 

Attachments

  • 01022011004.jpg
    01022011004.jpg
    314.3 KB · Views: 138
  • 01022011007.jpg
    01022011007.jpg
    382.7 KB · Views: 131
  • 04022011010.jpg
    04022011010.jpg
    206.3 KB · Views: 136
Eating head again :p

Hi, this is an other work i did with the same PCB, as before need your inputs. This time around, all the ports have been made available sequence wise.




PS: Damn does nobody care to read my posts any more lolz :(
 

Attachments

  • betterboard.png
    betterboard.png
    79.9 KB · Views: 131
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top