maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   N900 will not allow USB OTG! (https://talk.maemo.org/showthread.php?t=31921)

shadowjk 2010-04-07 18:11

Re: N900 will not allow USB OTG!
 
After reading bq24150 sheet last week I thought a bq24150 not under software control would start charging if there's power on vbus and OTG goes to 1.

blue_led 2010-04-07 18:19

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by shadowjk (Post 599758)
After reading bq24150 sheet last week I thought a bq24150 not under software control would start charging if there's power on vbus and OTG goes to 1.

i think you are wrong

OTG = Boost mode enable control or input current limiting selection pin. When OTG is in active status,
bq24150/1 is forced to operate in boost mode. It has higher priority over I2C control and can be OTG D4 I disabled through control register. The logic voltage level at OTG active status can also be controlled.
At POR, the OTG pin is default to be used as the input current limiting selection pin. When OTG = High, Iin – limit = 500mA and when OTG = Low, Iin – limit = 100mA, see the Control Register for details.


so
otg = chgr_det = 1 >> boost on charge , stupid
otg = chgr_det = 0 >> no power , no boost , no host ( 3N :mad: )
how hell actually charging is made ? probably isp1707 is disabled by software and through 100k ( R4281 ) resistor otg=low resulting charging is enabled
really, really stupid choice. quick and dirty and overall wrong

joerg_rw 2010-04-08 02:54

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by blue_led (Post 599776)
i think you are wrong

OTG = Boost mode enable control or input current limiting selection pin
...
At POR, the OTG pin is default to be used as the input current limiting selection pin. When OTG = High, Iin – limit = 500mA and when OTG = Low, Iin – limit = 100mA, see the Control Register for details.


so
otg = chgr_det = 1 >> boost on charge , stupid
otg = chgr_det = 0 >> no power , no boost , no host ( 3N :mad: )
how hell actually charging is made ? probably isp1707 is disabled by software and through 100k ( R4281 ) resistor otg=low resulting charging is enabled
really, really stupid choice. quick and dirty and overall wrong

My conclusions from these datasheet passages are same like shadowjk's, and I think you need to reread the bq24150 datasheet. Actually from what I remember boost mode will persist *only* if kept alive by cyclic refreshing of 32s I2C watchdog timer. There's no way it could start after PowerOnReset by simply asseting OTG.

BTW I'm not sure 1707 does assert CHRG_DET on sensing voltage on VBUS. For sure this would be kinda stupid, aiui the purpose of the CHRG_DET->OTG connection is like that: 1707 detects charger by sensing D+/- short, asserts CHRG_DET, 24150 switches to 500mA charge mode

blue_led 2010-04-08 16:14

Re: N900 will not allow USB OTG!
 
isp1707 & bq2415x marriage ...passing the original thought

isp1707 perform automatic charger detection if ( CHGR_det_EN_N is true ) and because this pin is tied to ground on n900 the isp1707 chip perform this detection and assert 1 to CHGR_DET pin
what BQ chip is doing with this ? well some things happen when an charger is connected
1) charger is connected and vbus rise to 5v
2) isp1707 perform charger detection and assert CHGR_DET = true AFTER t_chgr_det_dbnc time ( 25-113 ms )
bq asic start charging with initial current 100 mA
3) IF isp1707 detect low power charger ( hub 100/ 500 mA or computer 500 mA ) and will NOT assert CHGR_DET true leaving bq chip to charge battery with 100 mA. some reports are on forum saying charging from a hub take long time so here is the reason
( i can say more here )
IF isp1707 detect high power charger ( D+ and D- shorted ) will assert CHGR_DET = true and BQ chip switch high power mode ( 500 mA - 1250 mA )

until now all ok !
but ... if no charger is attached and sometimes we are blessed with host mode BQ chip start boost mode applyng 5v on vbus in two situation
1) otg pin function is activated but nobody is there to drive to true level
2) otg pin function is deactivated and (OPA_MODE=1 & HZ_Mode=0 ) is true
until now ok for me .

a unwanted situation can be achieved when otg pin function is activated and a charger is attached: BQ chip start boost and depending wich source have higher voltage some current flow to other ( vbus > vcharger 200mA flow or vcharger > vbus nothing happen, Bq chip stop injecting power ), disconecting charger will lead to a looked loop BQ chip power the bus and isp chip detect vbus and asserting CHGR_DET sustain boost by BQ chip until battery is exhausted, because otg pin take precedence over i2c, there is no way to stop this situation. some hardware logic missing here.

this can be the reason why nokia not implement host mode ?
there is no need to get vbus from isp chip or twl5030 and all configs of asics seems it can be made by software i think we can get host mode sometimes.

We can check if BQ can drive vbus to 5V by writing an driver and using i2c bus we can activate boost function. anybody already started programming ? :D

late edit:
don't shoot me joerg_rw ! now, finally, I read what you wrote better. ( non english speaker here :o )

joerg_rw 2010-04-08 16:41

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by blue_led (Post 601165)
isp1707 & bq2415x marriage ...
until now ok for me .

fine :-)
Quote:

Originally Posted by blue_led (Post 601165)
a unwanted situation can be achieved when otg pin function is activated and a charger is attached: BQ chip start boost and depending wich source have higher voltage some current flow to other ( vbus > vcharger 200mA flow or vcharger > vbus nothing happen, Bq chip stop injecting power ), disconecting charger will lead to a looked loop BQ chip power the bus and isp chip detect vbus and asserting CHGR_DET sustain boost by BQ chip until battery is exhausted, because otg pin take precedence over i2c, there is no way to stop this situation. some hardware logic missing here.

Nope, we don't want to do this. From bq24150 manual:
In 32 second mode, when the OTG pin is in active status or the bit of operation mode (OPA_MODE) at control
register is set to 1, the bq24150/1 operates in boost mode and delivers the power to VBUS from the battery.

and
At the beginning of boost operation, the bq24150/1 starts a 32-second timer that can be reset by host through
I2C interface. Writing "1" to reset bit of TMR_RST in the control register resets the 32-second timer and
TMR_RST is automatically set to "0" after the 32-second timer is reset. To keep in boost mode, the host must
reset the 32-second timer repeatedly. Once the 32-second timer expires, the bq24150/1 turns off the boost
converter
, enunciate the fault pulse in STAT pin and set fault status bits in status register. Fault condition is
cleared by POR or host control.

Quote:

Originally Posted by blue_led (Post 601165)
this can be the reason why nokia not implement host mode ?
there is no need to get vbus from isp chip or twl5030 and all configs of asics seems it can be made by software i think we can get host mode sometimes.

There's nothing I can find about OTG taking any precedence over this timer shutdown. So even if there *were* no better ways to stop VBUS boost, software always can stop updating the timer whenever we detect a hostmode USB detach, and of course also if we possibly read out chrg_det state (D+/- short) from 1707

So I don't yet see any reason beyond OTG compliance issues with USB-cert-authority for Nokia to not offer HOST MODE

blue_led 2010-04-08 16:54

Re: N900 will not allow USB OTG!
 
shame on me i forgot the timer
it is so hard tickling this timer for not implement host mode ? i don't think so .

ali.harmouch 2010-04-13 11:28

USB to N900
 
Can I connect USB or external hard directly to the N900?

MohammadAG 2010-04-13 11:32

Re: USB to N900
 
http://talk.maemo.org/showthread.php?t=31921

cashclientel 2010-04-13 11:56

Re: USB to N900
 
"No"watch out for your peeeeople

sjgadsby 2010-04-13 12:43

Re: N900 will not allow USB OTG!
 
The thread "USB to N900" with three posts has been merged into this thread.


All times are GMT. The time now is 07:28.

vBulletin® Version 3.8.8