Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: ItsJustMe on February 08, 2007, 04:38:41 PM

Title: iRiver iHP-120/140 USB charge with BQ24022
Post by: ItsJustMe on February 08, 2007, 04:38:41 PM
I would like to charge my player via USB (or at least stop it from discharging while plugged). The Li-Ion charger IC is a Texas Instruments BQ24022 which is capable of USB charge but this function is unused.

A look at http://focus.ti.com/lit/ds/symlink/bq24022.pdf tells me that I need to wire:

USB VBUS <-> BQ24022 pin 2 (USB)
USB VBUS <-> Ground, over capacitor (value?)
BQ24022 pin 7 (ISET2) <-> Ground, over resistor (value for low charge rate?)
Some sort of over voltage protection?

At the moment i use the old mod (USB VBUS <-> DC In +) already described in this forum but that does not look very elegant. For example charges are always interrupted on disk access.

Do you think it's possible to implement that?  ??? Help would be appreciated  :)
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: roolku on February 08, 2007, 05:14:36 PM
I looked at this some time ago and abandoned the idea. Unfortunately I can't remember why. Maybe it will come back to me. If it works out I think this would be a cool mod.

Roolku
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: LinusN on February 09, 2007, 02:19:42 AM
It should be possible. You need to lift the USB pin on the BQ24022 because it is currently connected to the DC-in, and then connect it to VBUS.

Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on February 09, 2007, 12:31:16 PM
I posted a link to this thread in the RTC mod thread so that maybe one of the hardware geniuses over there might be of some assistance. This would be a righteous mod!
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: roolku on February 09, 2007, 05:41:27 PM
I looked at this some time ago and abandoned the idea. Unfortunately I can't remember why.

I now remember what put me off. The 0.5 mm pitch! That will take some courage to solder a couple of wires on.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: ItsJustMe on February 09, 2007, 08:20:57 PM
@LinusN
Are you shure? I thought the USB pin (pin 2) is just unused. Hm, that does not make sense to me.

@Davide-NYC
Thank you. I just ordered a DS3231 because I would like to do both modifications. :D

@roolku
You are right. That would be a challenge. ;D
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: LinusN on February 10, 2007, 05:50:26 AM
@LinusN
Are you shure? I thought the USB pin (pin 2) is just unused. Hm, that does not make sense to me.
I saw this when I traced the PCB in the beginning of the project, and I was equally confused. I just traced it again, and now they aren't connected...!!! I guess I was tired that day.

So, the good news is that they are *not* connected. Sorry for the confusion.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: syrou on February 21, 2007, 04:52:27 PM
I find this mod very interesting (as much as the RTC one). I'm not sure, but maybe making a bridge between USB conn pin 1 and pin 2 of BQ chip, and grounding pin 4 of USB conn (if it isn't already) works. Is BQ pin 7 important?
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on March 01, 2007, 03:19:13 PM
Guys any news on this?

I have a broken H120 I will be trying to fix in the next couple of weeks (need to find time) and would be willing to "try stuff" on it if I get the unit working.

In other words: If I can get it to work I'm willing to risk breaking it again. :)

Lemme know.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: ItsJustMe on March 04, 2007, 03:10:48 PM
I'm not sure, but maybe making a bridge between USB conn pin 1 and pin 2 of BQ chip, and grounding pin 4 of USB conn (if it isn't already) works.

Pin1 is DC in, pin 2 is USB in. A bridge does not make sense to me. USB in is limited to 500mAh and could be destroyed. I don't know what would happen if both USB and DC are connected. USB pin 4 (Ground) should be grounded anyway.

Is BQ pin 7 important?

As long as pin 7 is in "high-z" state, USB charge function of BQ is disabled. A pull up gives 500mAh charge current, pulled down we have 100mAh. A resistor between 10k and 100k should be fine (i am not shure).

My DS3231 arrived, perhaps i will try both mods soon but i'm afraid of the 0.5mm pitch.  :o
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on March 26, 2007, 01:12:53 AM
My DS3231 arrived, perhaps i will try both mods soon but i'm afraid of the 0.5mm pitch.  :o

Hey ItsJustMe, if you give me detailed instruction (with pictures or diagrams) and I am able to repair my broken iriver I am more than willing to attempt this mod.

Your instructions will have to be idiot-proof. (I am that idiot)
On the other hand I did successfully install the RTC chip so I'm not that bad.  ;D

Looking forward to hearing from you!  :)
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: GaardenZwerch on March 28, 2007, 09:59:18 AM
I use a Y cable that a mini USB plug and a charger tip at one end and male USB plug on the other end. This works nicely for chargin on my Desktop. However, one day I had both USB and power plugged into my IHP 120. When I plugged the other end into my laptop, it just switched off.  I haven't really tried to reproduce this since, because I'm not too keen on frying the USB port in my laptop, or even the laptop itself.

So I would rather not have this mod inside my Iriver... with the cable I can either 'just charge' or 'just plug USB' if I'm not sure the USB port can handle the current that is drawn. Additionnally, I wouldn't want to be charging each time I plug in... I like to let my batteries come 'close to empty' before charging them. I still believe this enhances their overall lifetime a bit...

Hope this helps you decide wether you want to try this mod

Have a nice day,

Frank
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on March 30, 2007, 05:17:35 PM
If I could charge from the USB cable I'd be willing to even remove the DC in jack, although I don't really understand why this would be necessary. As long as I didn't plugin both USB and DC in at the same time it should be OK right?

Am I missing something? (it wouldn't be the first time)
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: roolku on April 03, 2007, 06:55:58 AM
The point of this mod is to use the built-in USB charging functionality of the BQ24022 which for some reason is not utilised on the h1x0. The chip takes care of how much current is drawn from the USB port and is perfectly save to use.

It is not comparable to the cable 'hack' GaardenZwerch uses.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on April 03, 2007, 11:09:13 AM
That's what I suspected but didn't want to presume anything since I have little expertise in this particular field.

@ anyone that knows their stuff:: Post instructions and I'll attempt this on one of my H1x0s in the name of Rockbox!
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Sando on April 04, 2007, 09:53:33 PM
As long as I didn't plugin both USB and DC in at the same time it should be OK right?

If I read the data sheet correctly, the BQ24022 will just charge from DC in if both are plugged in so I believe it'll handle it fine.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on April 05, 2007, 09:43:02 PM
OK, I've located the chip in question on the MoBo.
 :o (those are some very tiny legs to solder)

I believe I've understood what needs to be connected where and I've generated a little drawing.

(http://img206.imageshack.us/img206/8220/firstattemptfh9.jpg)

Question 1: Is this drawing correct? (I know I could route the wires better)
Question 2: What would the R and C values be?
Question 3: Are there better (more convenient) grounding points?
Question 4: Would any software modification be necessary or is this a 100% pure HW mod?
Question 5: Where can I purchase the worlds tiniest soldering iron?  :)
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: roolku on April 06, 2007, 05:11:09 PM
Hi Davide-NYC,

the following is to the best of my knowledge, but might well be wrong, so please don't blame me...

Question 1: Is this drawing correct? (I know I could route the wires better)

Looks okay to me.

Question 2: What would the R and C values be?

R you don't need (i.e. connect to ground directly).
C is to suppress spikes and should probably be as close to the IC as possible. Personally I would put it where you drew it though (or even omit it). I guess a value of 47nF would be fine.

Question 3: Are there better (more convenient) grounding points?

I couldn't really find any - possibly the battery connector as it is on the same board and close by.

Question 4: Would any software modification be necessary or is this a 100% pure HW mod?

With just the hardware mod, the player would charge, but be connected in USB mode.

If you want to charge while playing music, you need a software mod as well. It should be straight forward (e.g. enable the defines HAVE_USB_POWER, USBPOWER_BTN_IGNORE and USBPOWER_BUTTON in the right places). I have a patch for that for you if you want.

Question 5: Where can I purchase the worlds tiniest soldering iron?  :)

My approach will probably be:

1) get thin stranded wire
2) remove about 3mm insulation
3) cut all but one strand back to 2mm
4) cover expose strands in solder
5) place in such a way that the 1execess strand is above the pin
6) fixate wire with glue to hold it in place and provide strain relieve
7) carefully dip a soldering iron on the single strand above the pin
8) hope it only connects to the one pin it is supposed to connect to

but maybe you have a better idea?

Other comments:

This is the minimal mod. Variations would be:

- connect pin 7 to UCC (3.3V) instead of GND to enable charging with 500mA. Strictly speaking USB needs to negotioate with the host if it can supply 500mA, but most USB ports will provide it by default and I believe other targets do it

- connect pin 7 to a GPO pin of the CPU to switch between charging modes by software. This would obviously require a patch to be able to switch between the modes.



Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: bluebrother on April 06, 2007, 05:50:44 PM
1) get thin stranded wire
I would suggest wrap wire like this (correct me if there is a more appropriate english term for this): http://export.farnell.com/jsp/Cable/Single+Wire/ROADRUNNER/RRP-P-105/displayProduct.jsp?sku=146184
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: roolku on April 06, 2007, 06:06:51 PM
1) get thin stranded wire
I would suggest wrap wire like this (correct me if there is a more appropriate english term for this):

If I understand the listing correctly this is a single strand coated in Polyurethane?

The problem I have is the diameter - on one hand you want it thin (so it is easier to connect) but on the other hand you want it thick for the 100-500mA. (the example is only rated for 82mA - which is probably enough for 100mA, but 500?). Therefore my idea with the stranded wire where only the tip is thin (but covered in solder so hopefully sufficient).

I still can't understand why the pins in a charging IC are that small (the mains charger can deliver up to 2A!).

Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on April 07, 2007, 01:50:51 AM
bluebrother:  the link you posted didn't work for me so I have no idea what you are referring to.

Roolku:
Quote
R you don't need (i.e. connect to ground directly).
C is to suppress spikes and should probably be as close to the IC as possible. Personally I would put it where you drew it though (or even omit it). I guess a value of 47nF would be fine.

As a first attempt I could forgo both the resistor and the cap?
That would make this all a little bit easier.

Quote
7) carefully dip a soldering iron on the single strand above the pin
8) hope it only connects to the one pin it is supposed to connect to

but maybe you have a better idea?

If your method proves difficult I may try conducting heat with a needle to a tinned wire glued in place. (or something)

Tomorrow I will attempt the repair of my dead player according to the repair post on misticriver. If that goes well I will attempt the USB mod *before* I do the RTC mod. If it goes badly I can practice on the dead unit and reconsider modding my good one.  :o

Wish me luck!  ;D
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: roolku on April 07, 2007, 05:11:24 AM
bluebrother:  the link you posted didn't work for me so I have no idea what you are referring to.

You need to select a country first. Then the second time you click the link it will direct you to the right page.

Quote
As a first attempt I could forgo both the resistor and the cap?
That would make this all a little bit easier.

I don't know where the idea for a for the resistor came from (Can't see anything in the data sheet suggesting to have one).

The cap is 'good practice', it has no functional meaning.

Quote
Wish me luck!  ;D

Good luck.

Here is the patch: http://www.rockbox.org/tracker/task/6990

It uses the same key as the h300 (i.e. record). You can try it without the mod: hold record while the player is on and insert the USB cable. It should not enter USB mode, but instead show the little USB icon in the statusbar.

Once you have done the mod successfully the charging light will come on. (this is your indicator even without the patch, as it is controlled by hardware)

Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: bluebrother on April 07, 2007, 05:16:04 AM
bluebrother:  the link you posted didn't work for me so I have no idea what you are referring to.
Damn. It worked when I tried it yesterday ... search for article number 146184 at farnell.com.

roolku: right, overlooked that. There are thicker versions available, but when I look at those tiny pins I don't think it should be that much of a problem. Just imagine the bonding wires inside of the chip ;-)
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: roelieboelie on April 07, 2007, 01:32:21 PM
Very intresting topic! *bookmarked!*
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on April 09, 2007, 01:46:21 PM
Weekend came and went. I didn't touch any of my irivers.... No time!
Stayed tuned I'll try to put in some time and effort tonight.  :-\
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on April 14, 2007, 11:28:06 PM
OK, I poked around, shorting the appropriate pins on the appropriate chips (according to the MR thread) and I get no response from my fried iRiver. I think I have multiple problems instead of just one.

So, due to the tinyness of the BQ24022 pins I am unwilling to try this on my good unit.
So my progress on this front has halted for now.

Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: XavierGr on July 19, 2007, 03:43:11 PM
Ok, I have a spare iHP-115 and I might try to mod it.

I am already trying to mod my iHP-140 with the RTC mod and before that I checked to do the USB charge on it. On a second thought I ditched the  idea to do it on my 140, because the pins of the BQ24022 are so tiny that I don't think I have the skills to make it through. (I have major problems with the RTC mod that has bigger pins)

As soon as I finish the RTC mod I will open the 115 and try to see if I can solder those small pins. It seems very difficult, I can't imagine how I will pass the soldering iron through there.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: XavierGr on July 23, 2007, 11:47:52 AM
Bad news, it seems that it won't work on my iHP-115.

Strange thing is that instead of the chip that is shown on the picture that Davide-NYC provided, my unit has a slightly different chip that says "LTLX" on it. Also it doesn't have the side pins that the picture shows.

The player still operates normally, but when I insert the USB cable the player just doesn't charge (no green led, normal USB mode).

Any advice or someone that has confirmed that this mod works? I will leave the player wired for a little bit and then remove the mod if I don't find a way to make it work.

Update: Ok more bad news, the player won't even charge from the adapter. I removed the wires and fortunately now all seems to work fine.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: XavierGr on July 25, 2007, 05:37:55 AM
OK on a second thought I think that the wirings that Davide-NYC provided seem wrong to me.

Pin 2 according to Davide is connected to Pin 5 of the USB jack which is ground from what I read in the USB minB spec.

Please correct me if I am wrong but isn't supposed that we need Pin2 on USB Vcc (Pin1)?

Also does anyone know of a GPIO pin available (and where) for setting pin7 high, low?

Update: Ok this is getting very weird...

I managed to make it partially work.
First, Davide-NYC is wrong for at least pin2 of the BQ chip. pin2 must be connected to pin1 of the USB miniB which is the first from the left. (not pin5 as the picture shows)

Pin7 is very weird. When I insert the USB miniB jack; if pin7 is connected either to battery ground or battery Vcc then the player will work normally without charging from USB or even the AC adapter. (Green light will never come on on both occasions)

When I leave Pin7 alone then the player will charge from USB (at unknown amperage, haven't measured it) but as soon as I turn on the player, the Green light will turn off after a second or 2.

Also another interesting finding is that when the player is off and charging from USB; If I connect pin7 to Battery ground then the Green light will turn off even if in the mean time I disconnect the wire. To turn the Green light on (without reinserting the USB cable) I have to connect and then disconnect pin7 to  Battery Vcc.
Note that Green light will stay off while pin7 is connected to Battery Vcc  and it will only come on again if I remove the connection between them. (wire of pin7 in the air)

I am totally confused with it, what the hell is going on? Any ideas or advice?

Update 2: Ok good news, the reason why the green light turned off while the player was on seems to be that my hub USB port couldn't deliver enough amperes to the device for both operation and green light charging.

Now the only thing that is missing is to find a way to solder the wire on a GPIO port from the CPU and pin7 (or something like that I don't know), to control the charging with software too.

For the moment if you don't want software controlled charging (always on while on USB) then leave pin7 on the BQ chip alone.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: pabouk on July 25, 2007, 11:22:44 AM
I am totally confused with it, what the hell is going on? Any ideas or advice?

Just a quick idea: try to assert logic 1 or 0 to pin 7 over a resistor (around 3k).
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Davide-NYC on July 27, 2007, 11:47:51 PM
Is this image correct?

[attachment deleted by admin for age]
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: XavierGr on August 01, 2007, 08:20:55 PM
Unfortunately this mod has another sad shortcoming. When I plug in the AC adapter and turn the unit on it will automatically try to go in USB mode.

I think that a simpler mod without even touching the BQ24022 will be to use a simple "switch transistor" along with a GPIO pin to control USB charging by software while the player is on.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Multiplex on August 02, 2007, 08:18:05 AM
Noting your status as a Rockbox developer I hesitate to ask this question ... but is that what *does* happen, or are you suggestion that this is what you think might happen?

It's just that I looked at doing this mod a while ago but lost my nerve (also I obtained an H320) and I saw nothing in the DataSheet that made me thing that what you describe would occur.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: XavierGr on August 04, 2007, 01:20:54 PM
Noting your status as a Rockbox developer I hesitate to ask this question ... but is that what *does* happen, or are you suggestion that this is what you think might happen?

It's just that I looked at doing this mod a while ago but lost my nerve (also I obtained an H320) and I saw nothing in the DataSheet that made me thing that what you describe would occur.

I just report my experience after trying to do the following mod.
Of course I "might" have done something wrong (I doubt it) but this is what I get with the following wirings on my H115 (not H120/H140).

For me it works, but currently you won't have any software control over it plus you will have to press a button if you want the unit to not go on USB mode while you charge it (either from USB or AC).

Also the size of the BQ chip pins make it very hard and risky. After I removed the wirings some excess solder short-circuited 2 pins on the BQ chip and the unit wouldn't charge at all. I had to battle with it for 2 hours until I manage to remove the excess solder from those small pins.

Until someone finds a way to control it with a GPIO pin I don't think it deserves the effort. You can have the same effect just by connecting USB pin1 with (+) from the AC adapter jack.
Title: Re: iRiver iHP-120/140 USB charge with BQ24022
Post by: Multiplex on August 06, 2007, 04:39:48 AM
Thanks
someties it pays to be too cautions ;-) I'd hate to have done that minute soldering with the concern of trashing the player then found that side effect.