XboxHacker BBS
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2013, 05:02:22 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 309129 times)
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #100 on: September 24, 2009, 08:51:07 AM »

It erases fine here - but the PIC I am using is what the code was originally designed for (18F4550) so perhaps that is not much help.
Reading/writing works great over here with the original pic & the v3 archive, no problem there.
To clarify, the reference is to an error when using 'erase' button from microchip's pc side MCHPUSB exe. The bootloader itself was originally written for 18F4550 but I see no flash size references in it; 18F2455 has 24K (0x6000-0x800bootloader = 0x5800, which is where the error mentioned occurs) while 18F4550 has 32K (0x8000-0x800=0x7800) so I presume 18F4550 flash size is used by erase verify causing this error on the chip with the smaller flash (rather than an issue with the flash itself.) Why they would be inconsistent and use 0x5800 instead of 0x6000 is not known to me.
Quote
1. Shutting down the pc with a booted xbox360 will turn off/crash?!? the 360.(happened at least once)
2. Connecting the pc while the 360 is connected to the mains will result in the pc not finding the usb powered pic.
First connection the usb and then connection the 360 to power solves this. (happened a couple of times)
I haven't tried it recently (before bootloader was added) but there is a nice fat pad by the power plug which 5V standby can be gotten from the PSU while just using usb 5V connected to USB sense (RC2) - though I did note myself that just disconnecting 5V from sense is not enough to stop usb module, a pulldown to ground is needed.
Quote
Documentation:
A reference to J1D2.6 or J2B1.12 would be nice for the VSS pin.
edit:/ added a note to my diagram Wink
« Last Edit: September 24, 2009, 09:21:18 AM by cory1492 » Logged
docentore
Member
**
Posts: 24


View Profile
« Reply #101 on: September 24, 2009, 09:11:26 AM »

I'm starting to build this thing and I'm looking to get few answers. Please bear with me as I'm not elctronic engineer, just simple IT technician.

I bought most of the parts, but I couldn't get 12mhz resonator. Will 10mhz do? Or can I use 12mhz cristal (the silver metal thing on two legs).
I don't fully understand a purpose for bootloader. If I have access to eeprom programmer, can I flash the PIC with the main hex only?

I would appreciate any help on this matter.

Cheers!
Logged
maximilian0017
Xbox Hacker
*****
Posts: 684


View Profile
« Reply #102 on: September 24, 2009, 09:37:59 AM »

I bought most of the parts, but I couldn't get 12mhz resonator. Will 10mhz do? Or can I use 12mhz cristal (the silver metal thing on two legs).
I don't fully understand a purpose for bootloader. If I have access to eeprom programmer, can I flash the PIC with the main hex only?

--Removed because of incorrect data.--
Maby you could take a look at some old hardware (preferly usb stuf or motherboards), that can be a great source of crystals.

The bootloader is for easy updates and to use the other functionality that is being implemented, so please use the bootloader, its really simple and does not take any time at all. 
« Last Edit: September 24, 2009, 09:48:39 AM by maximilian0017 » Logged
docentore
Member
**
Posts: 24


View Profile
« Reply #103 on: September 24, 2009, 11:05:04 AM »

ok, thanks for those answers.
I used something like http://www.dataman.com/webpages/productview.aspx?pid=4 with its own software.

There was 18f2455 in the device list so I chose that and flashed with hex. So do I have to erase it and flash again with bootloader and then main hex?

Thanks
« Last Edit: September 24, 2009, 02:32:18 PM by docentore » Logged
fail
Member
**
Posts: 18


View Profile
« Reply #104 on: September 24, 2009, 04:49:18 PM »

For USB recognition only, is this correct ?


Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #105 on: September 24, 2009, 07:29:20 PM »

Close. Pin 14 is an output not a power lead despite it's name VUSB, need to use a cap to ground to use "Internal USB 3.3V voltage regulator." To quote the diagram I just posted a couple posts ago: "VUSB - 100 to 330 nF capacitor to ground" (in this case bigger is better, apparently.)
Logged
fail
Member
**
Posts: 18


View Profile
« Reply #106 on: September 24, 2009, 08:57:10 PM »

Like this ?
« Last Edit: September 24, 2009, 09:03:15 PM by fail » Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #107 on: September 24, 2009, 11:21:48 PM »

Looks right; don't forget your oscillator will need a ground as well, either using a pair of pF caps on each leg or the ground leg of a 3pin resonator.
Logged
fail
Member
**
Posts: 18


View Profile
« Reply #108 on: September 25, 2009, 05:06:40 AM »

Is it possible that i cooked the pic giving direct 5V supply to VUSB ?

Are the 22 pF capacitor mandatory to get the "picflashed" pic recognized?

I can program the pic via PICDEM FS USB but then (after debridging RB5 to ground) there's no new device recognization ...

I placed the pic on the willem after programming it via USB and readed all of its content (.hex file format):
http://www.mediafire.com/download.php?doxnnmk1mat

Can someone do an hex comparison with his correctly working pic ?  Grin

« Last Edit: September 25, 2009, 10:09:15 AM by fail » Logged
maximilian0017
Xbox Hacker
*****
Posts: 684


View Profile
« Reply #109 on: September 25, 2009, 12:57:03 PM »

-- Removed, did not read the question correctly --

You should try to follow the building instructions as close as possible as the device may not function correctly otherwise.
« Last Edit: September 25, 2009, 04:41:43 PM by maximilian0017 » Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #110 on: September 25, 2009, 02:54:25 PM »

It's possible, though this PIC series has quite a bit of thought out protection in the way of internal pull downs and such.
I can program the pic via PICDEM FS USB but then (after debridging RB5 to ground) there's no new device recognization ...
If you are getting USB in bootloader mode then the transceiver obviously isn't fried from applying 5V to VUSB and as well that kind of proves the oscillator shouldn't be an issue unless you aren't able to get into usb bootloader 100% of the time (the signal must be working to achieve USB frequency, bootloader or not.) The main difference between the bootloader and the main program regarding USB is that the bootloader doesn't pay attention to any designated USB sense pin (RC2 in the main program, needs to be high to detect USB and initiate the device on the PC.)

If you are using the V3 binaries in the OP I do know LVP bit was enabled (meaning RB5 needs to be grounded for main program to work properly if you don't disable LVP bit before writing) -from experimentation multiplexing RB5 with LVP and bootloader enable doesn't work correctly (random resets, sometimes main program usb not detected by PC or randomly dropping.)

There have been issues with the V3 posted binaries which suggest it is a mix up of essentially unknown pinout (considering my build of git source acts entirely different) and LVP bit enabled which leaves pin assignment questionable for those binaries and could easily cover the issues mentioned recently. Try these binaries from current git source instead, tie RB5 to ground (with 10K resistor if using LVP for flashing to protect your LV programmer when connected, or alternately disable lvp bit before flashing bootloader with a normal level ICSP and leave RB5 floating) and use RC6 to ground to enable USB bootloader instead (follows the info diagram I posted yesterday.)
« Last Edit: September 25, 2009, 03:05:29 PM by cory1492 » Logged
fail
Member
**
Posts: 18


View Profile
« Reply #111 on: September 25, 2009, 07:30:39 PM »

Okay, now i have some life signs with the new picxflash... WinXP says me Found new hardware but it's not working properly bla bla when i plug it in . I still don't know what's wrong.

RC2 need the 10k ohm pullup resistor ? I connected it directly to 5V .
« Last Edit: September 25, 2009, 07:38:09 PM by fail » Logged
cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #112 on: September 25, 2009, 09:41:22 PM »

RC2 needs a pulldown resistor if you are using external 5V to power the pic and USB 5V only for sense (if you are only ever going to use this for SPI flashing there should be no need to worry about this.) Does bootloader mode always work for you, device ID fine in windows and all? Or is it only working sometimes?
« Last Edit: September 25, 2009, 09:46:23 PM by cory1492 » Logged
fail
Member
**
Posts: 18


View Profile
« Reply #113 on: September 26, 2009, 07:35:45 AM »

I have this behaviour :
Bootloader only : the board is recognized every time by USBFS DEV but winxp doesn't make any sound when i plug the device
Bootloader + picxflash on the pic: the board is not recognized anymore in bootloader mode and it's not even recognized properly in flash mode

I tried to flash picxflash directly from the winpic800 but it doesn't work again ...
Logged
docentore
Member
**
Posts: 24


View Profile
« Reply #114 on: September 28, 2009, 10:31:09 AM »

ok, just tell me if I have it right.

I flash the pic with any pic programmer, then build the adapter, connect to usb, put the pic into bootloader and program main hex using spi flasher?

Thanks
Logged
fail
Member
**
Posts: 18


View Profile
« Reply #115 on: September 28, 2009, 10:45:13 AM »

It's like that, remember to put rb5 to ground after hw programming, so the pic will be recognized in bootloader mode when you plug it via USB. After programming it with USBFS DEV and picxflash debridge rb5 from ground.
Logged
docentore
Member
**
Posts: 24


View Profile
« Reply #116 on: September 28, 2009, 11:42:11 AM »

thanks!
Logged
Grim187
Master Hacker
****
Posts: 160



View Profile WWW
« Reply #117 on: September 29, 2009, 10:24:34 PM »

ive been sick so i haven't had any time to work on it until today, flashing has been working to 3ff w/o error but i kept getting read errors to the point it would give me a error on every byte but when i compared the dumped file there were only minor differences (1 or 2 digits changed every 10+ lines), so i tried the very last thing i could think of and switch the 330nf on vusb to a 100nf and dident get a single read error there was a difference in the hex compare but it dosent look major.

http://i12.photobucket.com/albums/a246/Grim187/differances.jpg
Logged

cory1492
Xbox Hacker
*****
Posts: 616


View Profile
« Reply #118 on: September 30, 2009, 01:56:13 AM »

fail: if using both binaries I posted, I can confirm that RB5 only makes a difference when LVP (Low Voltage Program) bit is left on, and to LVP mode. Entering USB bootloader mode is automatic if you haven't done it before and written a user binary, but after you have done that once you must to connect RC6 to ground to enter bootloader again. Consider the info below as well, as it seems you haven't got stable USB.

Grim187: The recommended value is 220nF, I've been using 100nF myself (I've also tried dual 100nF in parallel to get 200nF and a germanium 220nF green-monster without issue) and from what I understand anything up to ~350 should be fine, the technical info from the datasheet reads: (220 nF (±44nF))
Quote from: datasheet
17.2.2.8 Internal Regulator
The PIC18FX455/X550 devices have a built-in 3.3V regulator to provide power to the internal transceiver and provide a source for the internal/external pull-ups. An external 220 nF (±20%) capacitor is required for stability
going by this it looks like the bits you mark are config/setting data (translate from 528 byte pages with spare to 512 byte pages without spare, putting the offset in the shot 0xFF4230 at 0xF78600) which presumably could change every time the 360 is powered, the second red block being the spare ecc for the differentiated data. If you can write an image and dump it immediately and have it come out identical this should tell you if it's working 100 per (though I wouldn't recommend this for an actual test unless the box never returning to stock is an issue.)
« Last Edit: September 30, 2009, 04:30:33 AM by cory1492 » Logged
Grim187
Master Hacker
****
Posts: 160



View Profile WWW
« Reply #119 on: September 30, 2009, 04:01:07 AM »

cory1492: i meant 220nf not 330nf, typo sorry.
could be because im using the sm version?, anyways its working good enough for me.

i flashed back the image i dumped and it booted e73 (iirc), rebooted; it when straight to dash (i forgot to take off the resistors) and then it would only give me e79 with the hacked nand so i just left it stock, took off the resistors and im using it as a live box.
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