Skip to main content
Topic: Bus Pirate PIC 24F Programmer Dev Thread (Read 44487 times) previous topic - next topic

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #15
That archive also includes a logic capture in Saleae client format.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #16
So I will try the read to test out my configuration.  It was unclear to me if you were suggesting testing more than that or not.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #17
So I wired things, uploaded the nightly build you send out to the BP, and connected then I selected  the Pic18 Read device Id scrip and I get
Pinging Bus Pirate...
Running Script C:busPirateiolsupdateP18ScriptReadDeviceID from DataSheet.scrp18 ...
Entering PIC18 ICSP Mode!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0e3f!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef8!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0eff!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef7!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0efe!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef6!
Sending 4-bit Command with Data: 0x09!
Sending 8-bit data: 0x00!
8-bit Data Read: 0xfe!
Sending 4-bit Command with Data: 0x09!
Sending 8-bit data: 0x00!
8-bit Data Read: 0xfe!
Exit ICSP Mode!
Done!


This look good so far.  Is there any other test I should try at this point?

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #18
While I am getting ahead of myself here, I went to collect the current state of files.  As far as I can see there is a V4 firmware, and V5 firmware and a V6firmware image, but I believe I need a bootloader image first.  So a link to that would be appreciated, as soon as it is wise to try to burn it.

Then is there a good reason not to jump to the V6 Firmware image and corresponding bitstreams?

I am assuming that the Pump.hex file out of the 2.04 firmware is the right bitstream to be testing here.  Is this correct?

So awaiting confirmatiion and a pointer to the bootloader hex file to load with the appropriate script file.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #19
The pump.hex will be the firmware for the OLS (without the Bootloader) the bitstream to be loaded into the SPI rom is .mcs.

I don't know what will happen if loaded the .hex into the fpga ;) Are bitstreams protected by some kind of checksum?

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #20
Thanks for giving it a test rhyde. It looks like there was a problem of some kind (connection from BP to OLS?). The OLS should return ID 0x02 0x4c:
Quote
Pinging Bus Pirate...
Running Script E:Workdp-svntrunkPIC24FProgrammerP18ScriptReadDeviceID from DataSheet.scrp18 ...
Entering PIC18 ICSP Mode!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0e3f!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef8!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0eff!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef7!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0efe!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef6!
Sending 4-bit Command with Data: 0x09!
Sending 8-bit data: 0x00!
8-bit Data Read: 0x02!
Sending 4-bit Command with Data: 0x09!
Sending 8-bit data: 0x00!
8-bit Data Read: 0x4c!
Exit ICSP Mode!
Done!

I'd check the connection to the OLS and that the OLS is powered @ 3.3volts during the connection.

There isn't anything more to test at the moment. We're almost there, there may be a full test today with the .HEX loader, or at least a full script that contains the bootloader. Once the 'auto' tab is finished you will be able to load the bootloader .HEX file from the project archive and program it, thus far we have only experimented with a scripted format to help figure out the algos.

Once you have the bootloader installed you're free to switch between firmwares and bitstreams.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #21
Still getting the same results.  Here are a couple shots of the connections.  3.3 is from the bp, the rest as I understood the directions.  Is there some other jumper I need to get it to talk?  I was happy with a result that was not all 0s or 1s, guess there is another issue.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #22
rhyde, did you install the [s:](as of now unreleased)[/s:] firmware v4.3 test [s:](BPv3-fimware-v4.3-test.rar)[/s:] BPv3-programmer-test.zipon your BP?

The Bus Pirate PIC programmer requires a modified raw-2-wire mode not available in the so far released BP firmware up to v4.2!

//EDIT// Just saw that ian released the BP firmware v4.3-test required for the Bus Pirate PIC programmer in BPv3-programmer-test.zip

I checked your cable connections between BP and OLS (on your pictures) - they are ok! You draw 3.3V from the BP, so it's ok that the OLS is not connected to USB for power.

For the OLS you should get either firmware v05 or v06 (both support SPI and work stable for me - I think it was robots, who reported for firmware v1.06 that the SUMP will not respond to commands which are sent within less than 2 sec after a capture is started  ... it doesn't really matter when using the Java SUMP client since you can't really issue a new command in under 2 sec from the client). Both are contained in OLSv1-firmware-v05v06-20MHz-b.zip.

The correspondig bitstream to both firmware v05 and v06 is bitstream release 2.04 - 2.04TestRelease.zip contains PUMP.hex which is the correct release 2.04 bitstream (btw. release 2.03 does not include the Self Test!)

Quote
... but I believe I need a bootloader image first.  So a link to that would be appreciated, as soon as it is wise to try to burn it.

The OLS bootloader OLSv1-bootloader-v1.hex can be found in OpenBench_LogicSniffer_1.03.zip ... however, please waite for further instructions by ian on how to install it with the Bus Pirate PIC programmer:

[quote author="ian"]
We're almost there, there may be a full test today with the .HEX loader, or at least a full script that contains the bootloader. Once the 'auto' tab is finished you will be able to load the bootloader .HEX file from the project archive and program it, thus far we have only experimented with a scripted format to help figure out the algos.
[/quote]

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #23
I downloaded the nightly build Ian upload to this thread, and the script/programmer client doesn't complain.  If I switch the power arrangement do I have to do something to get the pic to listen to the programmer?  (Just trying to figure out what step I missed or and doing wrong.  I will post the BP startup info to be certain I have the right stuff.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #24
Hmm I can't get the BP to respond to me via hyperterm on this system but the programmer does not seem to have a problem.  Does this firmware have a full UI?  Here is a portmon log attached, and renamed to .txt so the silly system would accept it.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #25
Okay the problem is the power.  If I attach a second usb cable to the OLS to power it I get what I believe are the expected values.  The only difference is I powered it via USB this time.  So either the firmware is not bring up the 3.3, or the OLS is having issues with it.

Pinging Bus Pirate...
Running Script C:olsP18ScriptReadDeviceID from DataSheet.scrp18 ...
Entering PIC18 ICSP Mode!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0e3f!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef8!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0eff!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef7!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x0efe!
Sending 4-bit Command with Data: 0x00!
Sending 16-bit data: 0x6ef6!
Sending 4-bit Command with Data: 0x09!
Sending 8-bit data: 0x00!
8-bit Data Read: 0x02!
Sending 4-bit Command with Data: 0x09!
Sending 8-bit data: 0x00!
8-bit Data Read: 0x4c!
Exit ICSP Mode!
Done!

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #26
Thanks for the report. I'm glad you got it working, I'll check on the power supply issue. I used the BP supply at first, but then I made a special cable so I could connect the BP, ICD2, and logic analyzer at once without swapping probes between every test, and I've used the USB as supply since then.

v4.3 should respond to a terminal. It could be that the programmer app was holding the port open, or maybe it was left in binary mode and there was no ASCII interface.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #27
You could check the supply voltage in the buspirate with command 'v' (before running the scripts), I think the OLS would draw lots of juice.

I assume the pic has a undervoltage protection which assures proper writes in the ICSP mode.

@Rhyde: I assume you disconnect the BP powersupply? connecting two powersupplies to the same rail is tricky without a levelling circuit.

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #28
Looks like you have a working BP --> OLS configuration for programming the PIC18F26J50 on the OLS now :)

One way or the other, the PIC18F26J50 requires 3.3V on VDD while in ICSP mode ... either from the OLS' USB port/VR1 or from 3.3V on the BP's I/O header. However, make sure that you do NOT connect 3.3V from the BP's I/O header while the OLS is connected to USB and gets it's power from USB!!!!!

Re: Bus Pirate PIC 24F Programmer Dev Thread

Reply #29
Guys,

sorry for kind of hijacking your thread, but can the algorithm for programming 18F26J50 be used to program 18F2550/18F4550 also? I have the latter chips laying around and would like to try to program them in LVP mode using my Bus Pirate.