Skip to main content

Show Posts

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

Messages - AMX

1
Project logs / PK2DeviceFile.dat editing tool (cli)
Hello,

I wrote a small command line tool to modify device files that are used by
the pk2cmd tool. It can dump a device file like
Code: [Select]
./pk2dft -d PK2DeviceFile.dat dump
whereby it creates a directory structure that looks like
Code: [Select]
dump
 +- config.cfg
 +- devices
    +- 11LC010.dev
    +- 11LC020.dev
    ...
    +- PIC32MX460F512L.dev
    +- Unsupported Part.dev
 +- families
    +- Baseline.fam
...
+- PIC24.fam
+- PIC32.fam
 +- scripts
    +- 18F_26K80ChpErase.scr
    ...
+- MR_UsrIDWrInt.3.scr
+- MR_WrOSCCALInt.1.scr
It is then possble to edit files and recompile it:
Code: [Select]
./pk2dft -c dump pk2dev.dat
This gives a new device file named "pk2dev.dat".
I was able to dump and recompile the PK2DeviceFile.dat I am using and
checked that the files are identical using "diff". There are probably
still some bugs but I think it might be usable already.
I attached the source code, you need libconfuse to compile it and it
probaly wont work under windows natively (because the are some
system("mkdir ...") calls as well as "/" in filenames ...).
Code: [Select]
gcc pk2dft.c -lconfuse -o pk2dft

I still have some problems figuring out the instructions of the scripts. I know that they are documented (for example here: http://code.google.com/p/vak-opensource ... 2_commands) but looking at the script commads stored inside the PK2DeviceFile.dat the data doesnt make too much sense.
For example the script code from '32MX_DevIDRd.scr':
Code: [Select]
script        = {
 0xbb, 0xaa, 0x04, 0xbb, 0xbb, 0xaa, 0x01, 0xbb,
 0xb9, 0xaa, 0x00, 0xbb, 0x00, 0xbb, 0x00, 0xbb,
 0x00, 0xbb,
}
hexdump from original file:
0002ad80  65 64 2e f5 00 0c 33 32  4d 58 5f 44 65 76 49 44  |ed....32MX_DevID|
0002ad90  52 64 00 00 00 00 00 00  09 00 bb aa 04 bb bb aa  |Rd..............|
0002ada0  01 bb b9 aa 00 bb 00 bb  00 bb 00 bb 3c 53 65 6e  |............<Sen|
0002adb0  64 43 4d 44 28 4d 54 41  50 5f 53 57 5f 4d 54 41  |dCMD(MTAP_SW_MTA|
0xbb stands for JT2_SENDCMD and takes an additional parameter, but
this would mean that they next instruction is 0x04 which is invalid. Has somebody got
an idea how to interpret the above code? Maybe the byte order is messed up (stored as 16bit unsigned integers)?

--AMX
2
Pirate PIC programmer / Re: Added Support for USBASP in picprog
Hi Cyk,

I read the PIC32 programming specification (61145J.pdf). So far I implemented a 4-phase/2-wire function in the usbasp firmware plus a readback function (to readback TDO response in case its needed) but I havent tested it yet. The PIC32 is wired up already and I am currently modifying my test program to see if I can get some feedback from device.

Regarding OpenOCD, I guess the aforementioned 4ph/2w function is exactly what you were looking for, a simple 4-wrire -> 2wire translation. I checked ebay for the USB Blaster, seems like they are using the Cy7C68013 (or FT232) and by accident I just ordered one of these Cy7C68013 "Logic Analyzer" boards a few weeks ago (got sdcc installed already). I also have one of these FT232 Sparkfun breakout boards.

I registered on the OpenOCD mailing list.
4
Pirate PIC programmer / Re: Added Support for USBASP in picprog
Of course I am aiming for the repo! ;-)

I have some more PICs here for testing (PIC16F628A, PIC24FJ32GB002, PIC32MX220, DSPI33FJ128MC804) so I guess I will implement all the PIC types (24 and dspic are the same?), clean it up and request access to repo heaven afterwards. :-)

Has somebody actually tried it? Shall I supply some HEX files here for the most common configurations?
5
Pirate PIC programmer / Added Support for USBASP in picprog
Hi,

I added support for another programmer named usbasp (WoW.fischl.de/usbasp) to picprog.
If you have a USBASP programmer you need to download the attached modified firmware (make your own changes like assign USB and ISP pins, different clock?), build it and flash it into your usbasp.
The next step would be to checkout picprog from here: code.google.com/p/dangerous-prototypes-open-hardware/source/checkout
apply the attached patch, build it and test it.

(I had to encrypt urls party because: "Your post looks too spamy for a new user, please remove off-site URLs")

EDIT: for now only reading from the device works, but I will fix this asap
EDIT2: fixed and updated attachements. There is one issue: it seems like the write buffer doesnt get cleared to 0xff so if the length of the file mod 64 isn't 0 you get some garbage at the end.

Thanks!