0

Would you Adam and Eve it?

Posted by Chris on Friday, April 24, 2009 in , , , ,
After attending the Robot Brighton Shadow Robot Company Talk I had just a few minutes from getting home to retiring to bed (it was gone midnight after all!).
I'd asked around and managed to blag a 470nF capacitor from Kind Steve (and borrowed a PIC programmer from him, just in case mine was playing up: I still didn't know if it was burning hex files onto the 18F series of chips properly) and thought I'd shove it into my breadboard and see what happened.

As I pulled it from it's little plastic bag, I realised he'd given me a 470uF not a 470nF capacitor. It was a big black cylindrical thing, not the little round disk I'd been expecting.

I was about to call it all off and go to bed, when I decided that there'd be no harm in giving it a try anyway, what with him having taken the time to dig one out and bring it with him. So I did. And then plugged in the USB cable.

Nothing happened.
And then this came up:



Wahoo! I finally had a native USB device working!
And just to make sure, I ran the test app that came with the PIC 18 simlulator called hidterminal.
What is does is generate a random 8-byte string and send it to the device.
If you read through the sample code, you'll see that it decreases each value in each byte of the feature code by one, just before the data is sent back to the host (and increases the i/o report by one). From the screenshot below, you can actually see this in action:


The vendor ID was changed to 1221 just to see that a USB device with
any VID/PID combination would be recognised


And all this without having to use a different programmer.
It seems that mine does work with 18F chips, using DonkeyProg after all.
Here's the final schematic for anyone trying to get a native USB device working from a PIC18F2455 controller - don't skimp on any of the parts: they're all critical!



How exciting!
Tomorrow I might just lay out a PCB for it....

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.