Please login or register.

Login with username, password and session length
 

News:

Latest updates at DangerousPrototypes.com.


Author Topic: Another Bus Pirate case and PIC programmer  (Read 1238 times)

W1N9Zr0

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Another Bus Pirate case and PIC programmer
« on: February 20, 2010, 06:15:56 PM »
Here is my take on a Bus Pirate case.

It's made of a PS2 game case and integrates two breadboards, the bus pirate and an A23 12v battery for PIC programming.
More images

What do you think?
« Last Edit: February 21, 2010, 10:22:50 PM by W1N9Zr0 »

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Another Bus Pirate case
« Reply #1 on: February 21, 2010, 02:39:23 AM »
Fantastic build, I'll post it up. Thanks for sharing.

It's cool that you've got the 12volt battery so you'll be ready to program PICs right way.

W1N9Zr0

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Re: Another Bus Pirate case
« Reply #2 on: February 21, 2010, 09:46:23 AM »
I can program a couple PICs I have already! I wrote a quick C# app to use the raw 2 wire mode that does it, but it needs configuration for different chips because microchip decided to use slightly different programming cycles for almost every chip model.

I looked at usbpicprog, but it has half its programming logic in the firmware and half in xml files on the pc. The firmware is the one that deals with all the different programming cycles (it's all hard coded, 1,300 line, C case/if) which is the more difficult part, the xml files only define memory ranges.
Guess one could take the prog.c from the firmware code and write all the write_pic_blah() externals it uses to use the bus pirate and see if it compiles under normal C.

Right now though, I'm thinking of using my C# app though and making config files that define the whole programming cycle along with memory ranges. That way you don't need a compiler to add a chip definition, just search up the microchip PDF for it, type up a config file and you're set.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Another Bus Pirate case
« Reply #3 on: February 21, 2010, 10:02:16 AM »
Fantastic idea. Let me know how I can help, or if it would help to have a custom binmode or raw2wire extensions to improve speed or do 'tricks'.

If you're willing to put the code in SVN, I bet there are other people (like me) who would like to review or contribute to the code. I'd like to add support for the PCI24Fj64GA002, for obvious reasons.

I've worked on porting the USBPICPROG firmware, but there are some foibles because of the difference in data transfer on the two devices. Your method of just using the Bus Pirate as a flexable 2wire IO dongle is great. Are there some chips/operations that might have a problem without precise delays? We might be able to write some extensions for that stuff.

Also, would you like a PIC programming adapter with a boost converter, or maybe just to see the circuit I used for switching VPP and MCLR?

Sjaak

  • Fellow
  • Hero Member
  • *****
  • Posts: 885
  • Karma: +263/-0
  • Überprutser
    • View Profile
Re: Another Bus Pirate case
« Reply #4 on: February 21, 2010, 01:10:04 PM »
I though all the pic12, 16 and 18 had the same way of programming. Since they use a synchronious communication timing isn't very critical or am I way off? I think I really need to look deeper into this :D But good to hear it is possible with the standard libraries ;)

BTW nice the fiberoptics!

W1N9Zr0

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Re: Another Bus Pirate case
« Reply #5 on: February 21, 2010, 10:22:29 PM »
Are there some chips/operations that might have a problem without precise delays? We might be able to write some extensions for that stuff.
I though all the pic12, 16 and 18 had the same way of programming. Since they use a synchronious communication timing isn't very critical or am I way off?
Yup, the 10-16s I looked at use synchronious communication, and 18 and up probably too but I haven't looked at the higher end chips too much yet.

Also, would you like a PIC programming adapter with a boost converter, or maybe just to see the circuit I used for switching VPP and MCLR?
Sure, that'd be great!

I can put it under SVN once I figure out the format for the config files and clean up my bus pirate raw mode wrapper.
The main problem is that there are so many different programming sequences. I've seen at least 5 different ones in the microchip programming spec pdfs for the 8 bit chips. There are at least 3 "begin programming" commands, at least 3 combinations of begin-write-(optional)end cycles, and sometimes different chips do different things with the same command!
I'm wondering if it's easier to work with the pdfs or with the usbpicprog firmware source to figure out what config options the files need to have.

Also, if anyone uses Mono, does Mono implement System.IO.Ports.SerialPort?

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Another Bus Pirate case and PIC programmer
« Reply #6 on: February 23, 2010, 03:21:19 AM »
The ds30 Loader GUI is serial port and works on Mono, you might be able to find some code examples there for universal serial port calls. I was going to give you a link, but I realized we're just using Mackey's current version now.

I gave you access to the google SVN. You'll need to check your google code profile to get your google code password. Feel free to put your work where you like, we can always move it later.

The usbpicprog source seems to reflect a lot of real-world experience. I'd tap that as much as possible to avoid reworking the same issues Frans encountered.

I just read through the 24fjxxxga0xx programming spec for fun. Looks like nothing too critical timing wise:
http://ww1.microchip.com/downloads/en/DeviceDoc/39768d.pdf

The 24fj and 33F don't need a high VPP, I'm unsure about the 30F and 24hj.

I'm posting the case up now, thanks for the picture.

Nibble

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Another Bus Pirate case and PIC programmer
« Reply #7 on: February 27, 2010, 07:59:11 PM »
Hello all,

I am wondering...

What about using the idea (and source code) from the Universal OS PIC Programmer: "This programmer requires only a basic terminal program capable of uploading an ascii PIC HEX file. It does not matter what operating system or computer (MAC, Win98, XP, Vista, DOS, Linux, etc.) is used to talk to it."

The source code is available and perhaps can be easly adapted as a BusPirate script...

Please see: http://mondo-technology.com/upp.html

Sjaak

  • Fellow
  • Hero Member
  • *****
  • Posts: 885
  • Karma: +263/-0
  • Überprutser
    • View Profile
Re: Another Bus Pirate case and PIC programmer
« Reply #8 on: February 28, 2010, 02:30:23 AM »
Looks great. It looks like it can be converted to a new protocol. I really like the idea.

Too bad it is written in asm :) Perhaps it is easier to read the datasheet and implement from scratch. However my asm skill are getting rusty ;)

honken

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Another Bus Pirate case and PIC programmer
« Reply #9 on: February 28, 2010, 12:10:59 PM »
I got inspired by this, and made a case of my own.
I used a mints tin can, very similar i size to the ubiquitous Altoids variant.
I've got a v2go and it's fastened with some adhesive tack, so it's removable.
I could also fit one of those mini breadboard from Seeedstudio/SparkFun (can't rememder where I got it from) as well as some jumper cables.


ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Another Bus Pirate case and PIC programmer
« Reply #10 on: February 28, 2010, 12:14:43 PM »
I like the guide in the lid. I'll post these up. Fantastic, really great job.

AZRobbo

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Another Bus Pirate case and PIC programmer
« Reply #11 on: February 28, 2010, 08:08:11 PM »
I LOVE the guide in the lid - can you share the file with us?

honken

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Another Bus Pirate case and PIC programmer
« Reply #12 on: March 01, 2010, 11:46:31 AM »
Sure, in part.
I made a little logo for myself and therein lies perhaps a problem.
The skull and bones are taken from wikipedia and GPL'd - so no problem,
but the USB-trident is a registered trademark (again according to wikipedia, where I stole it from).
I'm not sure if this use constitutes any violations.
So I think Ian should decide wether he wants possible infringements on his site.

The rest is stolen from Ian's blog, with some small modifications (removed version 2+ texts).

But here's a safe version without the logo.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Another Bus Pirate case and PIC programmer
« Reply #13 on: March 01, 2010, 12:03:38 PM »
Without the logo if fine for me. Could you give us a link to the GPL'd image license page, just for good measure.

honken

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile