Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  New Ports
| | |-+  Cowon D2
« previous next »
  • Print
Pages: 1 ... 18 19 [20] 21 22 ... 65

Author Topic: Cowon D2  (Read 636487 times)

Offline shotofadds

  • Developer
  • Member
  • *
  • Posts: 368
Re: Cowon D2
« Reply #285 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.
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.
Quote
I think that NAND driver is more important now.
Yes, it certainly is. You are more than welcome to take a look at that! ;D
Logged

Offline Yeeze

  • Member
  • *
  • Posts: 40
Re: Cowon D2
« Reply #286 on: April 11, 2008, 01:07:06 PM »
Quote from: gnu on April 11, 2008, 11:36:35 AM
I don't know how you can only complile one plugin, but you can skip the 'make install' when you write something like this:
Code: [Select]
cp apps/plugin/myplugin.rock archos/.rockbox/rocks/demos/myplugin.rock
With this code you only copy your plugin and not all the 'unchanged' pars of rockbox.

Yeah, copying really saves some time..

But the "make rocks" command does not seem to have much effect on what is compiled... E.g. Codecs are still compiled... now it takes up to 5 minutes to build the simulator..

Well I think I will try to setup a faster environment....

First I need some free space on my disk...
Logged

Offline cybergrind

  • Member
  • *
  • Posts: 23
Re: Cowon D2
« Reply #287 on: April 11, 2008, 01:31:17 PM »
Quote from: shotofadds on April 11, 2008, 12:36:13 PM
I assume you mean "touchscreen" when you say LCD? The actual LCD driver already works... ;)
you are right - touchscreen =)
Quote
Yes, it certainly is. You are more than welcome to take a look at that! ;D
I didn't view NAND datasheet yet =) I sure that i could write some code for pcf50606, but if you want write it - write=)
 cowond2 firmaware require a lot of code and i sure that find place for me ;)
Logged

Offline shotofadds

  • Developer
  • Member
  • *
  • Posts: 368
Re: Cowon D2
« Reply #288 on: April 11, 2008, 01:46:03 PM »
Quote from: cybergrind on April 11, 2008, 01:31:17 PM
I didn't view NAND datasheet yet =)
The NAND datasheet won't help, as it describes the physical hardware only. The problem is understanding the low-level format (ie. the mapping from physical to logical blocks), which is proprietary and undocumented. The existing code is based on guess-work and magic, which is why it is not 100% reliable. :(
« Last Edit: April 11, 2008, 01:59:11 PM by shotofadds »
Logged

Offline cybergrind

  • Member
  • *
  • Posts: 23
Re: Cowon D2
« Reply #289 on: April 11, 2008, 03:11:16 PM »
Quote from: shotofadds on April 11, 2008, 12:36:13 PM
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.

page 73 of pcf datasheet =)

Code: [Select]
int batStatus;
float voltage;
pcf50606_write(PCF5060X_ADCC2, 0x1); //0b00000001
pcf50606_read_multiple(PCF5060X_ADCS1, outStr, 2);
batStatus = (outStr[0]<<2 | outStr[1]& 3); //ADCDAT1H+ADCDAT1L
voltage = batStatus/1024.0*6.0;
snprintf(buf, sizeof(buf), "Battary voltage: %f", voltage);
lcd_puts(0, line++, buf);
But I can't write float, %f is not supports?
Logged

Offline shotofadds

  • Developer
  • Member
  • *
  • Posts: 368
Re: Cowon D2
« Reply #290 on: April 11, 2008, 03:19:29 PM »
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
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Cowon D2
« Reply #291 on: April 11, 2008, 03:38:44 PM »
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.
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.

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.
Logged

Offline cybergrind

  • Member
  • *
  • Posts: 23
Re: Cowon D2
« Reply #292 on: April 11, 2008, 04:00:14 PM »
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: [Select]
	int batStatus;
int voltage;
pcf50606_write(PCF5060X_ADCC2, 0x1); //0b00000001
pcf50606_read_multiple(PCF5060X_ADCS1, outStr, 2);
batStatus = (outStr[0]<<2 | outStr[1]& 3); //ADCDAT1H+ADCDAT1L
voltage = batStatus*6000/1024;
int rest = voltage%1000;
snprintf(buf, sizeof(buf), "Battary voltage: %d.%d", voltage/1000, rest);
        lcd_puts(0, line++, buf);

I try to test
Quote from: shotofadds on April 11, 2008, 03:19:29 PM
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...
it seems that we cannot read voltage wothout start ADC :\
« Last Edit: April 11, 2008, 04:03:08 PM by cybergrind »
Logged

Offline shotofadds

  • Developer
  • Member
  • *
  • Posts: 368
Re: Cowon D2
« Reply #293 on: April 11, 2008, 05:19:38 PM »
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?
Logged

Offline wahamir

  • Member
  • *
  • Posts: 2
Re: Cowon D2
« Reply #294 on: April 11, 2008, 05:33:06 PM »
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.

Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: Cowon D2
« Reply #295 on: April 11, 2008, 07:23:43 PM »
Quote from: wahamir on April 11, 2008, 05:33:06 PM
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.



That is true for an ideal voltage source.  Initially, the voltage of the battery will change very little since it can source enough current to maintain the voltage.  As a battery runs down it will not be able to produce enough electrons to maintain the potential difference for a given load. 

Surely you will agree that as a battery runs down the potential difference across its electrodes approaches zero.

---

I'm not terribly familiar with how the battery state gets characterized here.  I'm only pointing out that a battery is not an ideal voltage source.
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

Offline martink

  • Member
  • *
  • Posts: 3
Re: Cowon D2
« Reply #296 on: April 12, 2008, 05:00:48 AM »
I think, because the battery is not an ideal voltage source, we can use it for measurement, and we don't have to measure electric current (ampere):

the voltage becomes lower and lower, when the battery turns empty.
Logged

Offline cybergrind

  • Member
  • *
  • Posts: 23
Re: Cowon D2
« Reply #297 on: April 12, 2008, 10:59:34 AM »
blinking battery has voltage near 3.500V.

2 wahamir: that opinion not correct, because we use battery input through power supply chip, that controls voltage in player (pcf50606 need only 2.7V for work), and controls battery state using resistive divider (fig 57 in datasheet).

you can view battery voltage in HWinfo with this patch  FS#8878 (http://www.rockbox.org/tracker/task/8878).
I used formula two at page 73, maybe this more precise method. Message your max and min values for more accurate results.

NB! results not correct with usb-cable pluged.
« Last Edit: April 12, 2008, 11:01:51 AM by cybergrind »
Logged

Offline shotofadds

  • Developer
  • Member
  • *
  • Posts: 368
Re: Cowon D2
« Reply #298 on: April 12, 2008, 12:28:13 PM »
I've updated SVN to read the battery status (you can see the voltage in Debug > View battery, and then press +). It's not calibrated yet, so the battery icon may well show incorrect information (and the "estimated runtime" is certainly wrong).

Inserting a USB cable or the AC-adapter will affect the voltage reading. I'm not sure what is the best way to compensate for this.
Logged

Offline cybergrind

  • Member
  • *
  • Posts: 23
Re: Cowon D2
« Reply #299 on: April 12, 2008, 12:45:18 PM »
since results of two measurements is too different, we should use average value, for more precise values.

and, maybe, measure in such way:
Code: [Select]
pcf50606_write(PCF5060X_ADCC2, 0x3); //0b00000011 read subtractor
....
current_voltage = adc_val*2400/1024+3000; //with this formula we can't use BATTERY_SCALE_FACTOR

and I didn't sure, that we should get battery voltage, when plugged USB or DC
« Last Edit: April 12, 2008, 12:46:55 PM by cybergrind »
Logged

  • Print
Pages: 1 ... 18 19 [20] 21 22 ... 65
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  New Ports
| | |-+  Cowon D2
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.116 seconds with 14 queries.