Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - W1N9Zr0

1
Bus Pirate Support / Re: Another Bus Pirate case and PIC programmer
It's not ready for end users yet, I still have some random bugs ( for example it can't figure out if it entered the raw mode properly once in a while). And it only programs the 16f628a now since there's no configuration, or a "browse for hex file" dialog even :P

If anyone wants to try it on their pic and knows their way around C#, you can edit the PIC configuration variables in PIC16ProgrammerHelper.cs, and then try the Read Program, Read Data and Program Test buttons in Form1
Program Test will ERASE the pic! Then write some random numbers into code and data memory, and as of right now reads the 628a user id, chip id, and the configuration word.
The Read Hex button can also program a hex file into the pic, but you have to edit the path to it, and change the hex/pic address offsets to your own (again, it's set up for 16f628a now)
The circuit itself is just AUX switching a 12v supply to MCLR, the pic is powered by the Bus Pirate's 5v, and the BP pullups are also connected to the 5v. The pic PGC is BP's CLK, and PGD is BP's MOSI.



The VPP before VDD requirement is probably not a very strict thing, the spec for 628a also says you need VPP first, but I can kick it in and out of program mode with VDD on all the time just fine.
2
Bus Pirate Support / Re: Another Bus Pirate case and PIC programmer
It's been a busy time at work so I haven't had much time to work on this, but I've committed some stuff to SVN just now.
http://the-bus-pirate.googlecode.com/sv ... rateRawCS/
AnkhSVN gave me some problems exporting it from visual studio, so it ended up one directory deeper than it should be.

I started on a C# library to use the raw modes and handle the SerialPort asynchronously since the .net SerialPort isn't very fast synchronously.
Then there is a PIC programmer library which implements dsPIC30 (as BusPiratePICProgrammer.DsPICProgrammer) and PIC10/12/16 programming (as BusPiratePICProgrammer.PIC16Programmer) based on the Usbpicprog firmware code.
I didn't have time to convert the PIC18 code and a very specific case of one 16 chip yet, but it should almost be a direct copy-paste from Usbpicprog firmware.
From what I've read, PIC24 should be very close the dsPIC, so that should be pretty easy to tack on too.
The PIC16Programmer class also needs an options loader to configure it for other 10/12/16 pics, right now it defaults to PIC16F6x8A.
The code also includes a .hex file reader.

All of these in combination write my 16F628A perfectly using the example app!
I'm still using my programming circuit, haven't played with Ian's voltage booster board yet. My circuit just uses an opto isolator on the AUX pin to connect the 12v battery to the MCLR pin on the pic.
3
Bus Pirate Support / Re: Another Bus Pirate case
[quote author="ian"]
Are there some chips/operations that might have a problem without precise delays? We might be able to write some extensions for that stuff.
[/quote]
[quote author="Sjaak"]
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?
[/quote]
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.

[quote author="ian"]
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?
[/quote]
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?
4
Bus Pirate Support / Re: Another Bus Pirate case
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.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01482320504session_write_close ( )...(null):0
20.01522452096ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01522452872Database_MySQL->query( ).../DatabaseHandler.php:119
40.06102591608Database_MySQL->error( ).../Db-mysql.class.php:273