XboxHacker BBS
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2013, 11:17:05 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 308973 times)
sandungas
Master Hacker
****
Posts: 212



View Profile
« Reply #560 on: January 12, 2010, 06:28:51 PM »

And can I really just drop in an 18F2550 in place of the 18F2455, 'cos Farnell are out of stock of the latter at the moment so it would speed things up if I could?
Take a look at the pictures of page 4 of the datasheet, there are different sizes, number of pins, and pins moved in other models
All the PICs of the datasheet are compatibles with the code, but only this 2 matchs with my diagram

But you can use any of them, just take care of the signals at the pins and addapt it to match my diagram
The models with 40 pins are almost similar to the 28 pin ones (you just need to modify a bit my diagram)


Edit:
Yes, the link you posted for the board is correct
Quote
Hole Pitch:2.54mm
Row Pitch:2.54mm
« Last Edit: January 12, 2010, 06:36:39 PM by sandungas » Logged
SpikedCola
Member
**
Posts: 44


View Profile
« Reply #561 on: January 12, 2010, 07:01:45 PM »

I was hopring to provoke some responce from the PIC minded people over here, as this is Darkstar and also Cory's department i dont want to change anything that can give problems later on.


If you really want to test something test this, only modify these lines:
TRISCbits.TRISC6 = 1; // Set PortC bit 6 as INPUT

// LATCbits.LATC6 = 1; // Set PortC bit 6 to High (5v) (DISABLED)

And connect a 100k or so from the pin to VCC, hopefully standard the PIC flasher will start and if you also connect a 10k to GND the Bootloader will start.
Resistor values are out of the blue and open for discussion ofcourse...  

C6 should read 0v or so if nothing connected and 5v if a 100k to VCC is connected
With that line commented, a 100k pull-up, and a switch (to switch to bootloader mode) through 10k to ground, it works exactly as it should! Thank you so much!

If anyone wants them, here are the latest hex files, compiled from GIT, along with that line being commented out to make the bootloader jumper work properly.

EDIT After cutting the legs of the resistors and soldering them flat with the board, it wouldnt come out of bootloader mode. I changed the 100k to a 10k and the 10k to a 100 ohm (so it goes VCC -- 10k -- C6 -- jumper -- 100 -- GND) and now its great
« Last Edit: January 12, 2010, 07:25:28 PM by SpikedCola » Logged
chaoz2
Member
**
Posts: 10


View Profile
« Reply #562 on: January 12, 2010, 07:09:20 PM »

got the 100nF value from the old diagram, the 10uF wasn't stated at that time yet, can 100nF damage my circuit/PIC or could it just cause stabillity problems?

maybe it will cause some instability

just a note on ceramic caps on this article http://www.dataweek.co.za/news.aspx?pklNewsId=27008&pklCategoryID=45


X5V X7S Z5U and not mentioned Y5V have too much capacitance change over temp, go for COG/NPO for crystal compensation and X7R X8R X5R X7S for the others
Logged
SpikedCola
Member
**
Posts: 44


View Profile
« Reply #563 on: January 12, 2010, 08:11:02 PM »

You should - however - be careful with the PIC's VUSB voltage regulator. I fried one and I still don't know why. Also, be careful with the xbox side.
Do you have any ideas at all, or any insight to offer as to why it happened? I have a chip here that isnt being recognized by USB but I can still flash it with my PICKit. There is ~0.11v between Vusb and GND (Ive tried a 100nF and 200nF (2x100nF) but it didnt make a difference)

EDIT strange, I see everyone quoting different Vusb cap values. My datasheet says it should be 0.47uF (470nF) so I will try that out, and I think Im going to switch my 100nF on all the boards to 470nF to comply with the datasheet.

EDIT 2 changing caps didnt work, but I just pulled a new chip out of the rail, and it too has nearly 0 volts on Vusb, even on another board.

EDIT 3 okay, now all of my chips and boards have stopped working... every single one gives ~0v on Vusb, even the ones I had set aside that just worked 10 minutes ago. This is getting to be so frustrating, I wish I didnt have so much invested in it or Id be thinking about refunding all the payments and not doing this.

EDIT 4 well, at least I figured out a solution. by turning VREGEN off, you can feed Vusb from a 3v3 regulator, and this made the flashers recognized over USB again. Therefore Im going to be flashing all my chips with the internal regulator turned off, and Ill add an external 3v3 regulator to the Vusb pin.

EDIT 5 did some more reading about the Vusb cap and in another place in the datasheet they recommend 220nF. As 220nF caps are smaller and cheaper Im going to move the 100nF caps already there across the supply pins for decoupling, and replace the 100nF cap with a 220nF cap
« Last Edit: January 12, 2010, 09:33:52 PM by SpikedCola » Logged
chaoz2
Member
**
Posts: 10


View Profile
« Reply #564 on: January 12, 2010, 08:48:42 PM »



-Replaced 100 nF capacitor in PIC pin 20 by a 10uF capacitor (recommended in the datasheet)



i reviewed the pic datasheet, i am quite puzzled, first says use a 220nf cap for vusb to vss, and then on table page 385 a value from 0,22uf to 12uf, so is the value of pin 14 cap to vss that have to be changed and not the vdd to vss?
Logged
sandungas
Master Hacker
****
Posts: 212



View Profile
« Reply #565 on: January 12, 2010, 11:24:04 PM »



-Replaced 100 nF capacitor in PIC pin 20 by a 10uF capacitor (recommended in the datasheet)



i reviewed the pic datasheet, i am quite puzzled, first says use a 220nf cap for vusb to vss, and then on table page 385 a value from 0,22uf to 12uf, so is the value of pin 14 cap to vss that have to be changed and not the vdd to vss?
Damn, you are right, but first... what datasheet revision are you reading ?
I can see the data that you are pointing in your messages, but not in the same pages (i have an overlay of 1 or 2 pages)
Are you sure yours is the last one from here ? http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010273

Then...
Page 385 talks about the capacitor needed for the internal usb regulator (C4 in pin 14 in my diagram)
Gives a typicall value of 0.47 uF (from 0.22 uF to 12 uF)

Page 172... again the USB regulator gives a value of 220 nF (+-20%)
220 nF = 0.22 uF (matchs with the range of page 385)

And a new one... page 188 - USB power modes/USB power only
Quote
In order to meet the inrush current requeriments of the USB 2.0 specifications, the total effective cpacitance appearing across Vbus and ground must be no more than 10uF
This is the capacitor at pin 20 in my diagram (main power line/ground)


---------------------------------------------------------------

So i must change in the diagram C3= 10 uF & C4= 0.47 uF ?
This is what i can see in the datasheet, but im not sure if we want to "keep the USB 2.0 specifications" in the board, and i dont know if darkstarTM choosed the original values for some considerations that i dont understand


By the other way.... this 2 capacitors of 10uF matches with what is explained in this document
http://hifi.metalabs.org/docs/usbame.pdf
« Last Edit: January 12, 2010, 11:31:18 PM by sandungas » Logged
threesixtyuser
Master Hacker
****
Posts: 115


View Profile
« Reply #566 on: January 13, 2010, 04:33:24 AM »

got the 100nF value from the old diagram, the 10uF wasn't stated at that time yet, can 100nF damage my circuit/PIC or could it just cause stabillity problems?

maybe it will cause some instability

just a note on ceramic caps on this article http://www.dataweek.co.za/news.aspx?pklNewsId=27008&pklCategoryID=45
http://www.dataweek.co.za/Articles/Dataweek%20-%20Published%20by%20Technews/dw2756table2.png

X5V X7S Z5U and not mentioned Y5V have too much capacitance change over temp, go for COG/NPO for crystal compensation and X7R X8R X5R X7S for the others

Thx! I'll just try it with 100nF first. BTW I used Low-K +/-15% for the crystal comp and X7R +/-2% for the others.

.....

And a new one... page 188 - USB power modes/USB power only
Quote
In order to meet the inrush current requeriments of the USB 2.0 specifications, the total effective cpacitance appearing across Vbus and ground must be no more than 10uF
This is the capacitor at pin 20 in my diagram (main power line/ground)

....

Unfortunatelly can't seem to find this spec in the datasheet of my pic :S

Soldered my PCB's yesterday and once again I was confronted with the fact why I never liked soldering on Prototype board Sad it takes a hell of a lot of more time than- and replacing components isn't as easy as with an etched PCB , next time I'll have someone etch a board for a few bucks for sure!

Here's my 2 boards (sorry 4 phone pics):



Gonna cut the excess board later on.
small difference with the location of the USB socket, placing it one row further gave me some more room
Used 16AWG wire for the GND and +5V instead of soldering pads together.
Used Cat5 Cable cores for USB Data + and -
Using the 3 pin header messed up the alignment so I chose to use 2 pins instead.

BTW I noticed some schematics with + and - symbols on the capacitors, but all caps are non-polarized if I'm correct.
« Last Edit: January 13, 2010, 05:00:26 AM by threesixtyuser » Logged
doveman
Master Hacker
****
Posts: 186


View Profile
« Reply #567 on: January 13, 2010, 06:04:40 AM »

Farnell are still awaiting delivery of the 18f2455, so if someone could confirm that the 18f2550 can be used as a direct replacement without needing to change anything else then I'd appreciate it as I could get my order placed, but I'd rather be patient than order something that's going to cause problems.

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


View Profile
« Reply #568 on: January 13, 2010, 06:15:31 AM »

As said by Sandugas:

18F2455, 18F2550, 18F4455 and 18F4550 are all from the same 'line' and are code/pin compatible with what has been posted in this thread (though 2 of them have extra pins/devices.)

Watch out for the different pin layout!!
Logged
doveman
Master Hacker
****
Posts: 186


View Profile
« Reply #569 on: January 13, 2010, 06:22:33 AM »

You're just trying to confuse me aren't you  Wink 18F2455 and 18F2550 have the same pin layout don't they?
Logged
threesixtyuser
Master Hacker
****
Posts: 115


View Profile
« Reply #570 on: January 13, 2010, 06:57:41 AM »

I'm confused Huh

Do I understand correctly that USB Bootloader jumper doesn't function atm?

If so, how do I complete the next step after programming the pic?:

Quote
Solder it together, plug it in by USB, it will be recognized as Custom USB device, use the
driver in "Driver for PDFSUSB".
Start PDFSUSB and flash PICFLASH.hex to it.
Unplug the flasher from the PC and plug it in again.
It will now be recognized as "Memory Access", this time use the driver in "Driver for the
Flasher", it will then be recognized as LibUSB...

Edit, I',m using this mini tut and files:


 you had like 12h time now, reading through the tread takes 20mins max...

Edit: mini tutorial:
http://docs.google.com/Doc?docid=0AXkkEcX2mtTjZHg5cGc0dF80Y3RkcmhqZjM&hl=en

« Last Edit: January 13, 2010, 07:01:07 AM by threesixtyuser » Logged
dak
Hacker
***
Posts: 81


View Profile
« Reply #571 on: January 13, 2010, 07:28:08 AM »

The tut is fine and the jumper works at least for me.
But after you progged the bootloader it will switch to Memory Acess anyway, as I described in the tut.
Only SpikedCola has a prob with it, but he tries something different (a switch to go into bootloader-mode)

@doveman 18F2550 works, same pins
« Last Edit: January 13, 2010, 07:41:20 AM by dak » Logged
maximilian0017
Xbox Hacker
*****
Posts: 684


View Profile
« Reply #572 on: January 13, 2010, 07:50:21 AM »

You're just trying to confuse me aren't you  Wink 18F2455 and 18F2550 have the same pin layout don't they?

No not trying to confuse you  Smiley , the quote from Cory stated 2 other chips that have a 40 pin configuration(18F4455 and 18F4550)

Pic 18F2455 and 18F2550 are both 28 pin with the same pin layout, the latter has more memory for programming.

The boot jumper works with the latest bootloader in the Plus2 package with a direct jumper from pin 17 to ground but i wanted to suggest a small change and would like to know what everyone else thinks of this.

The boot jumper probably wont even be needed if you only have the bootloader flashed, just when you want to update you have to place the jumper.
(will check this later, but is a bit of a best practices thing)



« Last Edit: January 13, 2010, 08:02:46 AM by maximilian0017 » Logged
doveman
Master Hacker
****
Posts: 186


View Profile
« Reply #573 on: January 13, 2010, 08:04:19 AM »

That's alright then. I'm not considering using the 40 pin chips as that would require far too much thought!
Logged
chaoz2
Member
**
Posts: 10


View Profile
« Reply #574 on: January 13, 2010, 08:38:26 AM »


my guess is you can choose 0,22uf to 10uf  for the 2 caps freely
Logged
threesixtyuser
Master Hacker
****
Posts: 115


View Profile
« Reply #575 on: January 13, 2010, 08:45:48 AM »


my guess is you can choose 0,22uf to 10uf  for the 2 caps freely
Just curious, but if that's the case where does the originally used 100nF come from? Too bad the datasheet of my PIC contains no info about the Vdd/Vbus capacitor at all.
Logged
Rescue Toaster
Newbie
*
Posts: 6


View Profile
« Reply #576 on: January 13, 2010, 10:00:40 AM »

0.1uF is pretty much the standard ceramic power-supply-decoupling cap. Almost everyone puts them on every chip ever. As some have said, in this case, given the long lines of the USB cable, it might make sense to go up a bit. If the cap gets too big the current spike that occurs when it charges can mess up the USB controller (MAYBE, I don't know of any case where it's actually happened, most controllers are extremely over-designed).
Logged
doveman
Master Hacker
****
Posts: 186


View Profile
« Reply #577 on: January 13, 2010, 10:17:06 AM »

I knocked up a layout on tri-pad in LochMaster to see if it would work and it looks like it should be OK and maybe a bit tidier on the bottom than pad board. It didn't have a 0.3in 28pin IC, so I had to improvise! I'll probably move R1 to the topside when I build it, it was just a bit easier to draw it this way.









Logged
chaoz2
Member
**
Posts: 10


View Profile
« Reply #578 on: January 13, 2010, 10:46:09 AM »


my guess is you can choose 0,22uf to 10uf  for the 2 caps freely
Just curious, but if that's the case where does the originally used 100nF come from? Too bad the datasheet of my PIC contains no info about the Vdd/Vbus capacitor at all.

100nf came from an older datasheet,

If we want to be super safe we can just  pick values from 0,22uf to 5uf so the sum will never be  more than usb 2.0 specs (12uf)
Logged
doveman
Master Hacker
****
Posts: 186


View Profile
« Reply #579 on: January 13, 2010, 10:50:24 AM »

Have I misread the USB socket pinout?

From the datasheet - http://www.farnell.com/datasheets/29091.pdf it looks to me like pin1 is top left and then it goes clockwise and pins 1 and 2 are the rear board pins and 3 and 4 the front ones.
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