This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10344 - AMSSansa Dynamically adjust core voltage to extend playtime
Attached to Project:
Rockbox
Opened by Jack Halpin (FlynDice) - Wednesday, 17 June 2009, 02:05 GMT+2
Last edited by Jack Halpin (FlynDice) - Tuesday, 30 June 2009, 19:59 GMT+2
Opened by Jack Halpin (FlynDice) - Wednesday, 17 June 2009, 02:05 GMT+2
Last edited by Jack Halpin (FlynDice) - Tuesday, 30 June 2009, 19:59 GMT+2
|
DetailsThis patch reduces the core voltage CVDDp setting from the default 1.2 V to 1.05 V when the processor is running at less than 200 MHz. There are several notes in the as3525 datasheet which address lowering to 1.1 volts when running at less than 200 MHz and we spend the majority of our processor time down in the 65 MHz range (at least with music) so I thought I would try that and see how it worked and have had no problems yet. If you select a maximum processor speed above 200 MHz the adjustment happens during the boost/unboost function. If you select a maximum processor speed below 200 MHz it simply makes the adjustment during system_init and leaves it there. I also added an item on the View HW info page. Right beside the mmu indication there is a CVDDp indication that will show "high" or "low". I ran a battery bench on this with current svn default of 248/62/62 and got just under 18 hours on an e280v2. Bench and graph attached also.
|
This task depends upon
Closed by Jack Halpin (FlynDice)
Tuesday, 30 June 2009, 19:59 GMT+2
Reason for closing: Accepted
Additional comments about closing: r21577
Tuesday, 30 June 2009, 19:59 GMT+2
Reason for closing: Accepted
Additional comments about closing: r21577
you could read TIMER2_VALUE before and after, and make the difference (1500000 decrements per second)
BUT I'm not sure how long it takes for the voltage to be really adapted. Boosting without waiting for the volts to reach its maximum might be dangerous.
I cannot offer any better claim besides the fact that this patch has handled everything I have tried it with including mpegplayer and timestretch without hiccupping at all.
kugel if the voltage is not changed rapidly enough the frequency is incorrect ?
saratoga said he could do measurements on his e200v2 if needed : I think it's is the CVDD pin which is bottom right on the bga
Also the datasheet says below 200MHz the VDD_CORE can be at 1.10V, but we set it at 1.05V (1.10V is "typical operation")
Note on page 119 there is the power up timings and they mention 10ms for "charge pump (50mA) enable unlock, enable via I2C setting" but i'm not sure if that applies to changes when the system is already up
Regarding CVDD, "7.4.20 10-Bit ADC" says that the ADC can measure CVDD (source 0x0100). Perhaps it would be enough to start the voltage change and then immediately read CVDD?
I have verified that I am reading CVDD and constructing the value correctly by displaying it and observing the expected changes while operating. I wonder if the ascodec_read function significantly impacts the value of the difference though.
Blocking would be 100% safe, waiting with a small delay could break anytime so I'm definitely for blocking as well.
The datasheet isn't clear about that. I find a mention of a 1.10V (page 12), a mention of 1.08V (page 12) and a mention of 1.05V (page 181 und 188.
It definitely says the CVDD can be programmed for 1.05V (page 181), so I think we should go with that one. Maybe the hardware doesn't exactly hit the 1.05V. It actually seems to me that both 1.05V and 1.10V result in 1.08V.
Page 180 (of datasheet v1.13) I see "K1 vdd_core P P 1.2V core power supply"
Page 12 quotes:
"For normal operation with fclk (CPU ARM-922T clock) frequencies
below 200 MHz, CVDD (supply of VDD_CORE) can be set to a lower value of 1.10 V. Only for setting
fclk of the CPU to clock frequencies above 200 MHz, the VDD_CORE supply voltage must be set to
1.20 V typical conditions."
So to respect the requirements we should not use a voltage lower than 1.10V
You can see page 13 the minimum/typical/maximal voltage for each setting, i believe the requirement is "1.10V setting", not the actual exact voltage output.
So, yes, we should stick to 1.10V (although I don't think it would be a problem, too low voltage generally isn't, especially not harmful).
FlynDice could you measure again battery life with 1.15V setting, because the maximal voltage is 1.30V (superior to 1.24V) ?
Note (1) is the one you mentioned at 15:38 GMT+1
Of course all this so far ignores the 1.05v setting. My opinion is that the processor will run just fine at 65MHz at 1.05v but I have nothing to back that up with besides the parallel logic that it needs 1.20v to run at 250MHz but only 1.10v to run at 200 MHz. No, it does not explicitly state that it's "safe" to use 1.05v but the setting is there is it not? We're looking at running 1/3 of the frequency while using .05 less volts. But, once again, I understand the desire to respect what is allowed by the datasheet.
Maybe someone with more of an electrical engineering/ hardware background could give an opinion on this. Bertrik? Saratoga?
"How much time exactly does it take to read the voltage?"
I think it takes 212 µs to read the voltage and the change happens faster than that. I will try to find the number of ascodec_reads it takes before the voltage reads high enough but right now I believe it is 1...
And Re the above: The problem with leaving specification is that you enter a state where it may or may not work. The success rate is depending on the quality of the manufactoring process (for example). As we're going to release a software that runs on this devices, we basically can't risk that our software doesn't run because of the very few, unlucky people, that got a sansa which cannot manage 1.05V.
We can't guarantee Rockbox will run on any Fuze, e200v2 etc, because AMS can't guarantee their hardware can take the volts.
But on the other hand, undervolting such a common praxis. I have undervolted all my computers at home. They're much cooler, and obviously use much less energy. Hence I'm curious as to what the OF does.
I really doubt there will be problems, I would like go with the "Typ: 1.10V" setting (which is the third one, and also not "allowed"). But we should respect the specifications, really.
So CVDD is set to 10b = 1.10V.
I have not seen other modifications of this ascodec register, but I may have missed some. I assume the OF doesn't use a fclk higher than 200MHz, but here also I am not sure.
But if it uses 1.10V setting for < 200MHz then we could use it as well.
kugel: we need to use ascodec_read() at least to read the other bits of CVDD/DCDC3 register, and then to wait until the voltage has been set successfully.
FlynDice can you update the patch with voltage reading after setting switch ? I believe we only need to block before switching to a fclk > 200MHz
We need to use ascodec_read to read the voltage from the ADC. To read the actual voltage we need to read both ADC_0 and ADC_1 but to just see if the voltage has gone from 1.05 to 1.20 we can get away with just reading the 8 bits from ADC_1.
During the actual voltage changing I guess you could do it without the ascodec_read but then you're assuming that nothing else is manipulating the other 6 bits in this register and you _know_ what those bits should be set to. I think you could make that work in this case.
re the datasheet: I think 1.10 volts is "allowed" at less than 200 MHz. I think it is not "allowed" at > 200 MHz.
1.10 _typical_ setting is not allowed because it has a small "See Note (1)" on page 13, but the OF uses it anyway..
"kugel: we need to use ascodec_read() at least to read the other bits of CVDD/DCDC3 register, and then to wait until the voltage has been set successfully."
-- alright, I missed the DCDC3 bit :/
I think it would be better to move the new defines next to the code using them, and also perhaps give better names (prefix with AS3514_CVDD_DCDC3_ for example)
Also if 224 is written in hex, it would make it more obvious that it's the 8LSB of the read voltage
I actually started out using some AS3514_XXXXX_XXX names but when I was done and tried to read it I started getting confused myself so I changed them to what is there now. I will be more than happy to rename them to whatever makes the most sense though. I was hoping to use FLYNDICES_FANTASTIK_OSCILLATING_MAGIC_PLASMA_ELECTRON_GENERATING_GIZMODIC_OPTIMUM_SETTINGS but decided against it as it did not respect the 80 column limit and I just couldn't decide what to leave out.... ;P
On a serious note though I was thinking that instead of moving the defines closer to the code using them that it would make more sense to move them into a .h file like powermgmt-target.h as they are really related to the power management settings of the chip. What are your thoughts?
I have tried to use your input to make it better see what you think.
I have changed the CVDDp high/low readout on the viewhw page to display the actual voltage being read from the ADC. I guess you still need to figure out where the decimal point goes on your own but we're all clever folks here , right?
I'd move the #defines to ascodec-target.h, actually, as we use them for ascodec.
For the debug menu, I just made up a quick switch case where a string like "1.20V" assigned to a variable which was printed in _DEBUG_PRINTF. But I'm not sure what the best way here is.
Or we could create as3525/a/special/directory/where/flyndice/can/feel/free/to/ignore/the/80/columns/limit/ ? :P
EDIT: the patch is fine so commit asap so we can all save the planet (and move towards a releasable state if we aren't already at it ..)