0

All those fiddly components are there for a reason you know

Posted by Chris on Thursday, April 23, 2009 in , ,
After several attempts of modifying code and getting nowhere, I followed the schematics on the Oshonsoft website exactly and copied and pasted the example code and burned it all to my 18F2455. I even included the 22pF capacitors across the crystal (not something I usually bother with) just to make sure that the code and hardware exactly matched the working setup.



The only thing I didn't have was a 470nF capacitor to connect the Vusb pin to ground. But then again, it's only a capacitor to ground: it's obviously not that important. Here's the schematic that I sent to Vladimir, author of Oshonsoft's Pic Simulator:



I sent the diagram to Vlad, pleading for help.
What could I have possibly done wrong? It all looks perfect and still my Windows PC can't detect the device (it recognises that something has been plugged in but keeps saying that there's been an error with the device)



I got this reply from Vladimir:

Please take a look at the schematics published on the web site.
There is one critical component missing on the schematics you sent
to me. It is 470n cap from Vusb pin to ground. According to the
datasheet it should be at least 220n value, and its presence is
critical. I hope that fixing this will lead to success!

Good luck and best regards,
Vladimir


I couldn't believe that something as insignificant as a tiny capacitor - which simply connects to ground - would cause the device to run, but not enumerate properly. I did some digging about on the 'net and came across this forum post; it's almost exactly the same problem I was having

http://www.picbasic.co.uk/forum/archive/index.php/t-3724.html

I re-read the datasheet for the 18F2455 and searched for "Vusb". There were references there to tying Vusb to D+ or D- and in a lot of the diagrams it showed Vusb connected to ground through a capacitor (but curiously no capacitance value is shown).
The datasheet does indeed mention 220nF but in his forum post, Robert says:


Robert Hedan - 6th July 2006, 17:14

Thanks to everyone!
I just received my order from DigiKey this morning. The 220pF caps didn't work, despite what the datasheet says. :( But the 470pF worked beautifully, man I'm happy I ordered a set of each, just in case. The device is recognized, YAHOO!!!

Robert
:D


I'm assuming that it's a typo in the forum post and that Robert actually meant 220nF and 470nF, as all other entries talk about nano- not pico- farad capacitors. Time will tell. So it looks like yet another trip to Maplins to try to find some 220nF/470nF capacitors.....

0 Comments

Post a Comment

whos.amung.us

Copyright © 2009 .Nerd Club All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive Supported by Blogger Templates.