Subject: Interpreting battery charge values
To: None <port-hpcarm@NetBSD.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: port-hpcarm
Date: 01/06/2005 19:00:01
--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

FYI/FWIW.  From linux jornada mailing list.  See the part about
interpreting battery charge values.

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen

--LZvS9be/3tNcYl/X
Content-Type: message/rfc822
Content-Disposition: inline

Path: main.gmane.org!not-for-mail
From: Jacek Lipkowski <sq5bpf@acid.ch.pw.edu.pl>
Newsgroups: gmane.comp.handhelds.linux.jornada
Subject: Re: a kernel for the 720 with irda working
Date: Thu, 6 Jan 2005 11:42:40 +0100 (CET)
Approved: news@gmane.org
Message-ID: <Pine.LNX.4.58.0501061056520.28357@acid.ch.pw.edu.pl>
References: <Pine.LNX.4.58.0412131925160.28704@acid.ch.pw.edu.pl>
	<41D2C642.8030903@pin9.de>
NNTP-Posting-Host: deer.gmane.org
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
NNTP-Posting-Date: Thu, 6 Jan 2005 10:49:00 +0000 (UTC)
Cc: jornada@handhelds.org
Original-X-From: jornada-bounces@handhelds.org Thu Jan 06 11:48:50 2005
Return-path: <jornada-bounces@handhelds.org>
Original-Received: from h1.handhelds.org ([192.58.209.91] helo=handhelds.org)
	by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian))
	id 1CmVCE-0006cY-00
	for <hand-jornada@m.gmane.org>; Thu, 06 Jan 2005 11:48:50 +0100
Original-Received: from h1.handhelds.org (h1.handhelds.org [127.0.0.1])
	by handhelds.org (Postfix) with ESMTP id D0CCE12131F;
	Thu,  6 Jan 2005 05:49:34 -0500 (EST)
Original-Received: from chemix.ch.pw.edu.pl (unknown [194.29.156.5])
	by handhelds.org (Postfix) with SMTP id 9D01CF13E6
	for <jornada@handhelds.org>; Thu,  6 Jan 2005 05:49:19 -0500 (EST)
Original-Received: from localhost (localhost [127.0.0.1])
	by chemix.ch.pw.edu.pl (Postfix) with ESMTP
	id 422176A80C1; Thu,  6 Jan 2005 11:48:28 +0100 (CET)
Original-Received: from chemix.ch.pw.edu.pl ([127.0.0.1])
	by localhost (chemix [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
	id 00275-09; Thu,  6 Jan 2005 11:48:27 +0100 (CET)
Original-Received: from acid.ch.pw.edu.pl (acid.ch.pw.edu.pl [194.29.156.2])
	by chemix.ch.pw.edu.pl (Postfix) with ESMTP
	id 093B46A8044; Thu,  6 Jan 2005 11:48:27 +0100 (CET)
Original-To: Kye Connect <kye@pin9.de>
In-Reply-To: <41D2C642.8030903@pin9.de>
List-Id: "Discussions about linux on the jornada 720/728 hpc."
	<jornada.handhelds.org>
List-Unsubscribe: <https://handhelds.org/mailman/listinfo/jornada>,
	<mailto:jornada-request@handhelds.org?subject=unsubscribe>
List-Archive: <http://www.handhelds.org/hypermail/jornada/current>
List-Post: <mailto:jornada@handhelds.org>
List-Help: <mailto:jornada-request@handhelds.org?subject=help>
List-Subscribe: <https://handhelds.org/mailman/listinfo/jornada>,
	<mailto:jornada-request@handhelds.org?subject=subscribe>
Original-Sender: jornada-bounces@handhelds.org
Errors-To: jornada-bounces@handhelds.org
Xref: main.gmane.org gmane.comp.handhelds.linux.jornada:992

On Wed, 29 Dec 2004, Kye Connect wrote:

>  i tried your source and it is compiling and booting (native compiling
> on the j720 with a gcc-2.95 :-)).

congratulations :) could you put the toolchain binaries up for download?

> a cat on the battery file brings up some values (i just will have to
> figure out what they actually stand for but this will have to wait, no
> time in the moment) that are changing and a change of the powersupply is
> recognised

these values are probably voltage

for the main battery values about 0x200 are the low battery threshold, and
the battery charges to around 0x298. during the charging process i've seen
as high as 0x366

i don't have the backup battery installed, so it's usually 0 (sometimes
1, probably the adc offset is not set very well, or there is some trickle
current)

the battery state is takes from the following gpios (found out by using
haret in wince):
gpio 4:
1 - jornada is running from battery
0 - jornada is running from ac power

gpio 26:
1 - the battery is fully charged
0 - the battery is charging


you look at the netbsd sources (they are interpreting the battery values
incorrectly, since they only interpret 8 bits, not 10):
sys/arch/hpcarm/dev/j720ssp.c (pmdata[0] is the main_battery&0xff,
main_battery-XX where XX is around 0x1f0 would probably be wiser):

api->minutes_left = (pmdata[0] * 840) / 170;
api->battery_life = (pmdata[0] * 100) / 170;

> an echo "XX" > brightness does not change the brightness

130-255 is usable on my jornada (255 is still readable)

> an echo "XX" > contrast does change the contrast, but just one time.

70-180 is usable on my jornada

the brightness and contrast settings are 255 - low 0 - high, you probably
used a low number, and didn't see any change.

you can turn the screen off with ldd 0-2.

i usually use 250 for brightness and 140 for contrast (the screen is dark
but readable)

jacek

--LZvS9be/3tNcYl/X--