|
DarkstarTM
|
 |
« on: August 31, 2009, 05:46:30 PM » |
|
 This flasher can be built for about 5 Euros on breadboard (or even without breadboard). All components are available from Reichelt (Germany) or Digikey. It takes about 5 minutes for 16 MB. The USB protocol is compatible with NandPro. PIC FirmwareUpdate: PIC Source code for this board is at http://free60.git.sourceforge.net/git/gitweb.cgi?p=free60/tools;a=tree;f=picflashThe final pinmapping is at http://free60.git.sourceforge.net/git/gitweb.cgi?p=free60/tools;a=blob;f=picflash/readme.txtBinaries (V3)http://www.megaupload.com/?d=X6TBNFDCProgramming the PICSee http://free60.git.sourceforge.net/git/gitweb.cgi?p=free60/tools;a=blob;f=picflash/boot/readme.txtUpdate: Shopping listFor the Flasher: 1x HPR 50X100 Breadboard 1x CST 12,00 12 MHz Resonator 1x Z5U-2,5 220N Capacitor 1x Z5U-2,5 100N Capacitor 1x 1/4W 10K Resistor 6x 1/4W 100 Resistor 2x SL 1X36G 2,54 Pin Headers (male) 1x PIC 18F2455-I/SP the PIC 1x LITZE SW Some wire 3x BL 1X10G 2,54 Pin Headers (female) 1x USB BG USB Connector 1x AK 670/2-1,0 USB cable For the porgrammer: 1x 74HCT 573 Driver IC 1x 1/4W 270 Resistor 1x 1/4W 1,0K Resistor 1x D-SUB BU 25 LPT Connector The part names are from www.reichelt.de.
|
|
|
|
« Last Edit: September 20, 2009, 08:35:28 AM by DarkstarTM »
|
Logged
|
|
|
|
|
Spider85
|
 |
« Reply #1 on: August 31, 2009, 11:56:40 PM » |
|
Iam really looking forward to the details  Tnx!
|
|
|
|
|
Logged
|
|
|
|
kelv_uk
Newbie

Posts: 4
|
 |
« Reply #2 on: September 01, 2009, 02:12:43 AM » |
|
Thanks DarkstarTM, knew there was a reason I kept those knackered ICD2's, was planning on trying with 18f14k50 as a cheap way of doing it, wont bother now  Please dont loose the source!!!! 
|
|
|
|
|
Logged
|
|
|
|
|
GyTe
|
 |
« Reply #3 on: September 01, 2009, 03:19:29 AM » |
|
Well done  Stick here for the details
|
|
|
|
|
Logged
|
|
|
|
|
Hoax
|
 |
« Reply #4 on: September 01, 2009, 03:23:59 AM » |
|
Nice! Good job! Hehe.. exactly what GyTe was looking for  Maybe he has more luck this time..
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Andy1988
|
 |
« Reply #6 on: September 01, 2009, 07:51:55 AM » |
|
Nice! Especially that you are releasing the sources!  I was just getting in touch with the SPI protocol and today I etched a board for an Atmega8 to use it as an SPI flasher. It took me a few days to get some stuff that works for sniffing the NandPro protocol... And I'm just able to get the flashconfig. At least sometimes... I think my cables are too long. My own board isn't finished yet, so I hooked up an STK500. Several things I tried for sniffing: 1) The Logic Analyzer I used for sniffing didn't have a protocol analyzer and counting clock cycles was boring and just sucked  2) Using an AVR to sniff the SPI stuff "on the wires" didn't work out... Perhaps too fast. 3) MS Detours for hooking the DLL calls to DLPortIO didn't work, too. 4) Then I created my own DLPortIO.dll, loaded the real DLPortIO.dll and delegated the calls of NandPro to the real ones and logged everything. That worked finally. Oh and a whole bunch of diasassembling-fun of NandPro  At least I learned very much doing all this stuff. I think that the SPI protocol that is used for reading/deleting/writing is the same as in lflash, right? I haven't looked at it, as I'm not yet able to read the flashconfig reliably :-/ http://free60.git.sourceforge.net/git/gitweb.cgi?p=free60/tools;a=blob_plain;f=lflash/lflash.c;hb=HEADHow did you find out the protocol?
|
|
|
|
« Last Edit: September 01, 2009, 07:56:46 AM by Andy1988 »
|
Logged
|
|
|
|
|
DarkstarTM
|
 |
« Reply #7 on: September 01, 2009, 08:29:57 AM » |
|
How did you find out the protocol?
I read the ARM assembly for the LPC2148 board. Got the relevant register addresses from the datasheet to find SPI I/O stuff. Reversing the USB protocol was the harder part. For signal checking signal integrity I used a small DSO. For protocol checking I used a logicport ( http://www.pctestinstruments.com/).
|
|
|
|
|
Logged
|
|
|
|
|
Andy1988
|
 |
« Reply #8 on: September 01, 2009, 08:42:53 AM » |
|
OK... You've got the better equipment  The logic analyzer I was using just showed me the logic levels. It's a pain to count the clock cycles. Especially if you are wrong everytime. For the USB protocol you could have used my DLL wrapping trick with the libusb dlls  But I never did anything with an ARM. So I had to stick with the x86 assembly  And even with that I haven't much experience. What datasheet do you mean?
|
|
|
|
|
Logged
|
|
|
|
|
DarkstarTM
|
 |
« Reply #9 on: September 01, 2009, 08:49:30 AM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
maximilian0017
|
 |
« Reply #10 on: September 01, 2009, 11:54:31 AM » |
|
I was just getting in touch with the SPI protocol and today I etched a board for an Atmega8 to use it as an SPI flasher.
As the Mega8 doesn't have a native usb connection, you are incorperating Bit-bang USB?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
gadget78
|
 |
« Reply #12 on: September 01, 2009, 12:16:17 PM » |
|
this is some amazing work, and so quick too only one request is it poss, to use a PIC 16C745 i know its a little slower, (and once programmable but they half the price) would it be quick enough to cope ? (i think this is the closest 16Xxxx alternative? as then it will support my hardware/programmer!) not to worry if not, will give me an excuse to upgrade i suppose ! again many thanks  Mick ..
|
|
|
|
|
Logged
|
|
|
|
|
Gee99x
|
 |
« Reply #13 on: September 01, 2009, 01:12:54 PM » |
|
DarkstarTM, would a 10MHz or 16MHz Resonator work instead of the listed 12MHz? Reason that I ask is because I can't get a 12MHz.
|
|
|
|
|
Logged
|
|
|
|
danhans115
Newbie

Posts: 3
|
 |
« Reply #14 on: September 01, 2009, 02:19:54 PM » |
|
I would have thought anything timing related will be coded for 12MHz so by changing the oscillator to a lower or higher speed will break any timing critical code.
|
|
|
|
|
Logged
|
|
|
|
|
B1N4RY
|
 |
« Reply #15 on: September 01, 2009, 02:32:26 PM » |
|
Very nice darkstar
|
|
|
|
|
Logged
|
|
|
|
|
raidenxtribe
|
 |
« Reply #16 on: September 01, 2009, 04:26:02 PM » |
|
Way more reasonable than the olimex cost ...
|
|
|
|
|
Logged
|
|
|
|
|
DarkstarTM
|
 |
« Reply #17 on: September 01, 2009, 05:09:21 PM » |
|
DarkstarTM, would a 10MHz or 16MHz Resonator work instead of the listed 12MHz? Reason that I ask is because I can't get a 12MHz.
It will work. You will need to change a fuse. The resonator is just the reference for a PLL with 96 MHz that drives the USB. CPU runs at half that speed. Possible external clock speeds are 48, 40, 24, 20, 16, 12, 8 and 4 MHz. Read http://ww1.microchip.com/downloads/en/DeviceDoc/39632D.pdf, pages 31 and 32 for details on how you need to set the fuses of the device then.
|
|
|
|
|
Logged
|
|
|
|
|
DarkstarTM
|
 |
« Reply #18 on: September 01, 2009, 05:12:42 PM » |
|
Pretty slow. It's low speed USB only and the interrupts from the USB will slow down your SPI code, too.
|
|
|
|
|
Logged
|
|
|
|
|
DarkstarTM
|
 |
« Reply #19 on: September 01, 2009, 05:22:17 PM » |
|
only one request is it poss, to use a PIC 16C745 [...]
No, sorry. 1) From the datasheet: "The PIC16C745/765 USB peripheral module supports Low Speed control and interrupt (IN and OUT) transfers only. The implementation supports 3 endpoint numbers (0, 1, 2) for a total of 6 endpoints.". Low speed is too low. 2) The device has only 256 Bytes of RAM. I need to hold at least one flash block (thats 528 Bytes) in there. 3) I would have to buy a UV lamp for development. 
|
|
|
|
|
Logged
|
|
|
|
|