XboxHacker BBS
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 18, 2013, 11:10:33 AM


Login with username, password and session length


Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 »
  Print  
Author Topic: USB SPI Flasher with PIC18F2455 - now with source and binaries  (Read 307938 times)
Andy1988
Member
**
Posts: 14


View Profile
« Reply #20 on: September 02, 2009, 01:57:53 AM »

The SPI transfer stuff will be done in hardware with an interrupt which fires, when one byte has been written or read from/to SPI. So I only need to put a new value from a buffer into a register or take it out Smiley

This guy here (http://forums.obdev.at/viewtopic.php?f=8&t=3059&start=0) got 24kB/s out of his AVR. With 16,5MB a whole read/write would take 11 Minutes. Too slow Cry But even faster as with the LPT Bigbanging solution.

The downside of the USBProg is that is costs 34€. Quite expensive for simple NAND Flasher.
But as I have on here, I think I'll try to implement it on this thing, too. Should be done relatively fast.
« Last Edit: September 02, 2009, 01:59:43 AM by Andy1988 » Logged
maximilian0017
Xbox Hacker
*****
Posts: 684


View Profile
« Reply #21 on: September 02, 2009, 04:29:41 AM »

If this gets too slow, I'll try to take the USBProg as a base. This thing is an USB Programmer for several purposes with hardware USB controller:
http://www.embedded-projects.net/index.php?page_id=165
I saw that a 3,3-5v adapter board was also available, will you be using this or just resistors?
http://shop.embedded-projects.net/product_info.php/info/p11_Pegelwandler-5-0-V-auf-3-3-V-fuer-USBprog.html

If you get the Mega8 version done, i'll give it a go (have everyting in stock  Smiley )
« Last Edit: September 02, 2009, 04:43:01 AM by maximilian0017 » Logged
Andy1988
Member
**
Posts: 14


View Profile
« Reply #22 on: September 02, 2009, 08:13:42 AM »

I saw that a 3,3-5v adapter board was also available, will you be using this or just resistors?
http://shop.embedded-projects.net/product_info.php/info/p11_Pegelwandler-5-0-V-auf-3-3-V-fuer-USBprog.html
I have this board here, too. I haven't used it before. My primary goal is getting this stuff to work on a Mega 8, first.

If you get the Mega8 version done, i'll give it a go (have everyting in stock  Smiley )
Yup. That's the reason why I started to build this thing. I have those parts already here.
I'm just waitung for Darkstar to release his sources. I lost my intention to reverse engineer the protocol by hand when somebody else already did it Wink

Oh and Sorry Darkstar. I didn't want to hijack your thread.
If I've got anything in a working state, I'll post it.
I'm going push my development regularly to github. So everybody who wants to have a look can go here: http://github.com/G33KatWork/FreeNAND/tree/master
Logged
raidenxtribe
Hacker
***
Posts: 89


View Profile
« Reply #23 on: September 03, 2009, 05:36:15 PM »

Hi Darkstar, I hope this will not bother you ... Can you upload somewhere the firmware in .hex format ?
Logged
TSX1
Hacker
***
Posts: 94


View Profile
« Reply #24 on: September 04, 2009, 05:32:20 AM »

Excuse me!
Am I wrong or there isn't any schematic for the PIC board posted yet?
If there is, maybe I can not see!
Logged
Gee99x
Hacker
***
Posts: 88


View Profile
« Reply #25 on: September 04, 2009, 06:19:38 AM »

It's shown in the first post.. http://img228.imageshack.us/i/picflashv2.png/
Logged
TSX1
Hacker
***
Posts: 94


View Profile
« Reply #26 on: September 04, 2009, 03:26:05 PM »

Thanks, for some reason the schematic was not shown in my browser!  Huh
Logged
gadget78
Master Hacker
****
Posts: 104


View Profile
« Reply #27 on: September 06, 2009, 06:45:38 AM »

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.  Shocked




many thanks for that quick reply, it was worth an ask i think i already knew it may not be up to the job, but its good to get it confirmed in such a proper explained mannor thankyou ..
its a good excuse to get my pic programmer upgraded ) am using an old MP3.5 serial programmer (elvis they used to call them !! back in the day!)
cheers again will look farward to this project moving to the next step Smiley
Logged
braza
Hacker
***
Posts: 92


View Profile
« Reply #28 on: September 06, 2009, 11:27:01 AM »

You can download the HEX file :

http://rapidshare.com/files/276457024/PICFLASH.rar.html
Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #29 on: September 06, 2009, 12:22:59 PM »

braza, I presume you realize
Code:
#define MISO PORTBbits.RB0
the diagram is not accurate to the posted source, considering at least that RB0 is wired to USB +5V there.
Quote from: DarkstarTM
if you are not familiar with the hardware, please wait a few days until I provide binaries.
Logged
braza
Hacker
***
Posts: 92


View Profile
« Reply #30 on: September 07, 2009, 09:56:57 AM »

the diagram is not accurate to the posted source, considering at least that RB0 is wired to USB +5V there........

........ you remove the 5 volts of RB0 and link to other 5 volts in place of hardware or not??
.
Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #31 on: September 07, 2009, 02:51:23 PM »

Braza, not: you will need to figure out ALL the pinouts to the 360 from the source, the diagram does not relate. Or just do what DarkstarTM said, wait until it is completed (I think source was posted early to assist posters who are using other devices.)

DarkstarTM: excellent work and thank you for sharing your source on this, finally gave me reason/incentive to break out my 18F4550 and learn something about PIC Smiley

edit: best lesson learned today - don't forget 10K pullup resistor on pin 1 like most PIC require... random usb not connecting/disconnects is the apparent result (though it's more random chip resets I'd presume.) Works like a charm DarkstarTM and thanks again, timed my 16M dump at 7m10s.
« Last Edit: September 07, 2009, 06:40:09 PM by cory1492 » Logged
DarkstarTM
Member
**
Posts: 45


View Profile
« Reply #32 on: September 10, 2009, 01:55:08 PM »

Binaries are here! See original post for instructions!
Logged
billak
Member
**
Posts: 37


View Profile
« Reply #33 on: September 10, 2009, 03:27:41 PM »

anyone tested this thing? I am going to build it because LPT is much slower and I didn't make it to read valid nand image. Hope this one will work Smiley
 
Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #34 on: September 10, 2009, 05:15:05 PM »

Binaries are here! See original post for instructions!
Are you going to keep the source up to date, to reflect added features like splitting the bootloader? It'd be nice to ditch my makeshift LPT cable (all this pc has for lpt/serial are pin headers, getting OEM header->pci slot adapters proved impossible locally.)

A typo correction if you haven't spotted my post on it previously yet (readme.txt)
Code:
Signal       Mainboard     18F2455
----------------------------------
EJ           J2B1.5        B1 Pin 22 (use resistor)
XX           J2B1.6        B0 Pin 21 (use resistor)
SS           J1D2.2        B4 Pin 25 (use resistor)
SCK          J1D2.3        B3 Pin 24 (use resistor)
MOSI         J1D2.1        B6 Pin 27 (use resistor)
MISO         J1D2.4        B2 Pin 23 (NO RESISTOR)
Those are on J1 not J2 Wink

billak: I used the original source release from last week or so, ported the bits I needed to make it work on 18F4550 (same 'class' pic hardware as 18F2455 just a few more pins/ports) with a 24MHz clock instead of the specified hardware and posted my results in this thread 2 posts back. This should be a lot more stable than peoples results have been on lpt, and I had absolutely no problems with it once I realized I had forgotten a pull up resistor.
« Last Edit: September 10, 2009, 05:51:49 PM by cory1492 » Logged
DarkstarTM
Member
**
Posts: 45


View Profile
« Reply #35 on: September 11, 2009, 04:05:41 AM »

Are you going to keep the source up to date, to reflect added features like splitting the bootloader?

Yes. As soon as I have a sane build process for this. I had to patch some libraries to change entry points. And then I have to fight with git again  Roll Eyes.

A typo correction if you haven't spotted my post on it previously yet (readme.txt)
Ooops. Thank you. I'll fix that.
Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #36 on: September 12, 2009, 12:12:10 PM »

Awesome, looking forward to updates - in fact, I've now altered the existing git project source (as well as the default bootloader to exclude LED and relocate sense to RB5) to work on my device under the mcpusb flasher in anticipation, I think I'm only short a level shifter now.

If anyone needs equivalent binaries for existing source (currently only SPI flashing supported) on 18F4550 feel free to drop me a line.

A typo in the git source has just come to my attention if anyone else is trying to use that code
usb_config.h, around line 59:
Code:
#define USB_BUS_SENSE       PORTBbits.RC2
should be
Code:
#define USB_BUS_SENSE       PORTCbits.RC2
Other than that it is working well.

Also, noted by PM earlier, if you have the matching PIC device (unlike me) but are using a different oscillator frequency it is simple to alter the existing binary without recompiling if you use winpic800 as the programming software, it offers a config tab that lets you set the appropriate bits after loading the hex file with a handy/simple full description drop-down box (should only need to do it once, for the bootloader itself, after that ICSP can be put aside and the config bits should be protected.)
« Last Edit: September 12, 2009, 12:21:16 PM by cory1492 » Logged
Gee99x
Hacker
***
Posts: 88


View Profile
« Reply #37 on: September 12, 2009, 12:30:15 PM »

Thanks Cory. That was a painless quick-fix for using a 16MHz resonator.
Logged
maximilian0017
Xbox Hacker
*****
Posts: 684


View Profile
« Reply #38 on: September 12, 2009, 12:32:16 PM »

Also, noted by PM earlier, if you have the matching PIC device (unlike me) but are using a different oscillator frequency it is simple to alter the existing binary without recompiling if you use winpic800 as the programming software

Will this also speed up reading/writing the NAND?
Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #39 on: September 12, 2009, 02:20:46 PM »

Nope, there is no speed increase to be had with the oscillator; the external clock is only really required for USB/primary if USB is going to be used, the divider in this source is set such that internal clock is always at it's best @48MHz (96MHz/2) so long as you set the osc bits properly.
Logged
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM