Rockbox Development > New Ports
Cowon D2
shotofadds:
I'm aware we can read the voltage from the PCF chip. But I think the same value may also be available direct from the TCC7801 ADCs. That way there's less overhead as there is no I2C read/write involved. A few tests will confirm whether this is true...
Remember that DAPs have no floating point hardware, so Rockbox has not been written to handle floats particularly well. It's probably best print the raw value and caculate it manually. ;D
saratoga:
--- Quote from: shotofadds on April 11, 2008, 12:36:13 PM ---
--- Quote from: cybergrind on April 11, 2008, 07:25:59 AM ---I read datasheet (something understand =) and test some functions. I could try to implement LCD and Battery driver (both or one of them - choose from you) at this weekend.
--- End quote ---
I assume you mean "touchscreen" when you say LCD? The actual LCD driver already works... ;)
I think the battery level can be read using ADC1 (see Debug>Hw Info screen). It is just a matter of working out how to translate this value to an actual voltage.
--- End quote ---
Full charge it and the battery should be at 4.2 v. Take the value it gives then and divide by 4.2 to get the voltage constant.
cybergrind:
1 brick in original firmware ~3.65V (if I correct count current value=)
what mean voltage constant? charge in percents (we should subtract minLow voltage, near ?2.7V)?
hacky code for voltage:
--- Code: --- int batStatus;
int voltage;
pcf50606_write(PCF5060X_ADCC2, 0x1); //0b00000001
pcf50606_read_multiple(PCF5060X_ADCS1, outStr, 2);
batStatus = (outStr[0]
shotofadds:
Reading the BATVOLT value from the PCF chip (using the simple formula in the datasheet) gives a reading of ~4.6v when charging from the AC adapter, ~4.1 with nothing connected, and ~3.8 when USB is connected. The battery is almost fully charged (full 4 bars in the OF). Can that be correct?
The value read from TCC7801 ADC1 is not affected by charger insertion, but does seem to rise and fall proportionally with the 'not charging' BATVOLT value. Any ideas what that might indicate?
wahamir:
Just to be sure. I think you don't understand all.
We cannot calculate the level of the battery with volt, because the volt value will always be the same. If you want to calculate the amount of electricity left in a battery, you need to use ampere.
Hope that will help you still I can't help with the code and good job. I can't wait to have a rockbox firmware for my d2.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version