Editing Mer/Documentation/BME Protocol
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 188: | Line 188: | ||
It's said that register 3 shows whether charging is occurring: with value 0 meaning "not being charged", while "values 0xff and above" are an indication of the voltage being applied for charging. Matan adds (http://talk.maemo.org/showpost.php?p=259465&postcount=43) that values around 0x100 indicate charging, while values around 0x170 indicate that the power source is connected but we aren't charging. | It's said that register 3 shows whether charging is occurring: with value 0 meaning "not being charged", while "values 0xff and above" are an indication of the voltage being applied for charging. Matan adds (http://talk.maemo.org/showpost.php?p=259465&postcount=43) that values around 0x100 indicate charging, while values around 0x170 indicate that the power source is connected but we aren't charging. | ||
- | Register 8 apparently indicates battery voltage. | + | Register 8 apparently indicates battery voltage. Note that this value can fluctuate a lot when the device is in use, but when idle it gets a good fit to the curve adc#8 = 438.3 + exp(p0 + p1*t) - exp(n0 + n1*t) where t is time, and p0,p1,n0,n1 are constants. (I forget the values I found for them, but in any case it would be good to fit for them again once more data is on hand.) |
- | + | To invert this function to find idle time remaining (on assumption that the device was idle when the register was read), first see whether the adc#8 value is above or below 438.3, which tells you which exponential is dominant, and approximate the other exponential with a constant 3 (or a straight line if you like); can iterate and update this approximation for the neighbourhood of the solution found by the previous iteration. | |
- | + | ||
- | To invert this function to find idle time remaining (on assumption that the device was idle when the register was read), first see whether the adc#8 value is above or below 438.3, which tells you which exponential is dominant, and approximate the other exponential with a constant 3 (or a straight line if you like); can iterate and update this approximation for the neighbourhood of the solution found by the previous iteration. | + |
Learn more about Contributing to the wiki.