USB Bootloader with PICKit 2? Confused!

Discuss PIC and electronic related things

Moderators: David Barker, Jerry Messina

bitfogav
Registered User
Registered User
Posts: 167
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: USB Bootloader with PICKit 2? Confused!

Post by bitfogav » Sat Jul 25, 2015 10:01 pm

Hi guys,

Can I just say that I have the old version RKPK40 with the two voltage regulators, which I think is the same one has Aresby has and my board works ok, with the following changes:
I have a 20mhz crystal (and caps) fitted to my board instead of the 10mhz crystal supplied in the kit/on board, and the only change to Rangerbob usb keyboard code
was to comment out the bootloader code which was mentioned a few posts ago:

Code: Select all

// Use with FSUSB Bootloader
'#option org_reset = $0800
The board also requires you to manually link the usb lines D+ and D- (pin header J38) to the correct connections on the PIC lines, the following image shows what I mean:
usbkeyboard.jpg
usbkeyboard.jpg (126.04 KiB) Viewed 3632 times

Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Re: USB Bootloader with PICKit 2? Confused!

Post by Aresby » Sun Jul 26, 2015 5:18 pm

Hi Jerry

Thanks for the information, I shall certainly be looking more closely this board to ensure it's not going to start damaging whatever it's connected to, +ve wise.

Anyway, your queries prompted me to check out the connections and here's a funny thing. How you'll laugh.

This board is fundamentally for PIC18F4550 development and prototyping. The PIC18F4550 has USB connectivity, which is why I chose it for my experimentation.

So you'd think, well, I did assume this, that the damned USB socket would actually be wired to the only two pins that the chip uses for the USB data. Nope.

Although I originally did fit the correct 20Mhz crystal (I bought a bulk lot from eBay to replace the 10Mhz it came with).

Sigh. I've now wired up RC4/RC5 (how spooky, I've just seen the response by bitfogav) and of course, it works as intended. So, it only took a year to work out why the PICkit2 wasn't writing to this board (wrong way round) and the same amount of time to understand that this prototyping board is not pre-wired but has the capability to allow USB connectivity (but allows you to use RC4/5 for other purposes).

Gosh, I'm laughing so hard. Manic laughter, teetering on the edge of hysteria. :oops:

Anyway, thanks everyone for all the posts and pictures and nudges, the project builds, loads and works just fine at address 0x0 and Windows can now detect it too. Now I can get on with what I wanted to do...

HURRAH! :lol:
Aresby
Swordfish & PIC Newbie

Jerry Messina
Swordfish Developer
Posts: 1246
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: USB Bootloader with PICKit 2? Confused!

Post by Jerry Messina » Sun Jul 26, 2015 11:00 pm

Your little escapade gave me a chuckle, so I'll share this.

Years ago my first PIC programmer was an ICD2, which had an RJ11 connector on it. I made an RJ11 to 0.1" single inline connector cable to connect up to my first design, and after struggling a bit got things working. Note: I wasn't smart enough to buy a development board or anything.. after all, how hard could it be to connect up to a measly 28-pin chip? Development boards are for wussies.

Fast forward a few years when I got a shiny new ICD3, which came with its own RJ11<->SIL header adapter. Great, no more kludgy cable! Plugged it into one of my boards and no-go. I spent hours looking through the docs and when I finally compared cables I found out that my boards ICSP connector was layed out backwards! Turns out there was a mixup in the original documentation on the ICD2 and I had been designing boards with the ICSP SIL header the wrong way around for years!

To this day I STILL do it backwards on my designs out of fear that the techs wouldn't know how to connect up to it if I changed it to be correct.

I know the next guy after me will be cussing and calling me an idiot.

Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Re: USB Bootloader with PICKit 2? Confused!

Post by Aresby » Mon Jul 27, 2015 8:03 am

Jerry Messina wrote:I found out that my boards ICSP connector was layed out backwards! Turns out there was a mixup in the original documentation on the ICD2 and I had been designing boards with the ICSP SIL header the wrong way around for years!
...
I know the next guy after me will be cussing and calling me an idiot.
Goddammit Jerry, you're an idiot! :D

Just to be clear, you didn't have anything to do with the design of the ICSP connector for the PicKit2 on this RKPK40 board did you? That connector is most DEFINITELY on the board backwards!

Yes, that story made me smile.
Aresby
Swordfish & PIC Newbie

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Re: USB Bootloader with PICKit 2? Confused!

Post by RangerBob » Mon Jul 27, 2015 8:21 am

Hey Aresby, good to hear you got it working.

If it helps to add my own "doh" moment; the links I sent you should work now. It helps if you haven't "temporarily" disabled your dropbox syncing as I did on friday. ;)

Jerry Messina
Swordfish Developer
Posts: 1246
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: USB Bootloader with PICKit 2? Confused!

Post by Jerry Messina » Mon Jul 27, 2015 9:26 am

Just to be clear, you didn't have anything to do with the design of the ICSP connector for the PicKit2 on this RKPK40 board did you? That connector is most DEFINITELY on the board backwards!
You know, I didn't think about that. Maybe RK is ripping off my designs!

Oh, and I should have mentioned... now I ALWAYS buy one of those wussy development boards when working with a new chip. Of course it's funny watching me plug into it as I always have to hesitate a bit while I repeat "Mine backwards, theirs correct. Mine backwards, theirs correct" over and over again.

bitfogav
Registered User
Registered User
Posts: 167
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: USB Bootloader with PICKit 2? Confused!

Post by bitfogav » Mon Jul 27, 2015 5:23 pm

The schematics for that board is here if you need it Aresby :)
schematicrp40.jpg
schematicrp40.jpg (207.81 KiB) Viewed 3607 times

Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Re: USB Bootloader with PICKit 2? Confused!

Post by Aresby » Tue Jul 28, 2015 11:30 am

Thank you bitfogav, appreciated. :D
Aresby
Swordfish & PIC Newbie

Post Reply