Posted this on the Microchip Forum, but felt it might be of help to visitors here too..maybe start a Troubleshooting FAQ for us newbies on this ?
18F4550 application not working! Not again.. but wait.. now it is!
Noting at how many folk have had the same problems/fun as me trying to get their device 18F4550 device stable/detected thought I would post my journey, and eventual arrival at stability. I'm using the example from www.piccoder.co.uk, and I built my own circuit on some vero board.
1. Oscillator frequency - set this wrong in the programmer and you will have pain, or rather it wont work. The pain comes from banging your head against the wall after you realise you have set them wrong. I use winpic800 and you have to be careful that it gets the right settings when you load your hex file.
For a 20mhz crystal I use: HS Oscillator, PLL enabled, HS Used by USB 96MHZ PLL div 2 Oscillator Divide by 5, 20Mhz
2. Connecting pullup resistors to things you shouldnt do. The PIC 18F4550 has internal pullups, no need to connect external resistor to D+ unless you have explicitly turned off the internal pullups.
Many thanks to Matt @ www.piccoder.co.uk for resolving those 2!
3. USB cable Is your USB cable up to the job? This may be an manufacturer myth, but apparently there are USB 1.0 and USB 2.0 compliant cables, the USB 2.0 ones being extra specially nice for high speed.... a bit like gold plated audio leads for hi-fi enthusiasts I guess.. Anyway I replaced mine as this was causing the device to drop out if I moved it in a way it found unacceptable.
4. Vusb capacitor. Tried a few combinations here.. eventually settled on a 0.47uF electrolytic, the solder bridge just wasnt doing the job.
5. USB vdd/vgnd capacitor I use a 10uF electrolytic cap and a 120pf ceramic cap in parallel across these USB power pins.
6. BUS power.. or not BUS power In the microchip code, if your device is bus powered then comment out the the line in usbcfg.h #define USE_SELF_POWER_SENSE_IO
and alter the line in io_cfg.h #define self_power 1
to #define self_power 0
I also commented out the line #define USE_USB_BUS_SENSE_IO because i wanted some pins back!
7. Windows 2000 - The FINAL STRAW! I'm running windoze 2000, I wonder how many folk are running XP instead and not having these problems. I found that if i booted the machine then the device was generally detected ok in W2K but then went away again. Anyway following this, I updated and patched W2K up to the hilt. If you trawl around Microsofts knowledge base there are many patchlets and discussions for USB related problems.
http://support.microsoft.com/kb/328580/en-us http://support.microsoft.com/kb/242062/en-us http://support.microsoft.com/kb/822568/en-us http://support.microsoft.com/kb/330892/en-us
and so on.. just put USB problem in microsofts knowledge base and filter for 2000 and you will see what I mean.
Anyway read all that lot if you feel fit.. alternatively install W2K SP4 and make sure your operating system is well up to date, or try it on XP instead if you can get access to a machine. Go to the windows update centre, scan your system etc. The works.
Dont forget to uninstall the "?" device, unplug it and reboot at this point, and then try pointing at the drivers once more.
Hope this helps somebody out there, I totally sympathise with the frustration of having the thing not work at all ...to almost work.. and then work for a bit.. and finally work.. please add other *gotchas* to this!!
These things are so cool once you get them working, and if you're starting out like I was/am the first hurdle seems more like a high jump.
Have plenty of coffee on standby though! Pixelchip *come on led, flash! flash dammit!*
|