Beaglebone - power consumption minimization and measurements...

Friends,

On pg 32 of BONESRM there is reference to current measurement. It
appears that by setting a register in the TPS65217 chip, we can route
either SYS_5V or SYS_VOLT (which are voltages on either side of a
current-sense resistor) to AIN7 of the processor. Then, by doing some
math, measure the current draw...

1. Any hints or pointers on setting the register (looking at the
schematic, it looks like there is a I2C connection from the processor
to the TPS, and looking at the TPS data sheet, the register is
MUXCTL). I'm new to the Beaglebone, so pointers on HOW to write to
this I2C and WHAT to write to the TPS would be appreciated.

2. Any hints or pointers on reading the AIN7. The SRM is terse: "7 A/
D converters are available..." (sec 6.3.7) but no details.

A separate, but related question: The table of current draw by the
board states that the draw is 170mA under "Kernel Idle". Is it
possible to put the board into a lower power state... from which the
board could wake up on an external signal, or that it would wake up
from periodically - in order of decreasing attractiveness:
- a software "sleep" mode that could be interrupted by a GPIO line
going high
- an external signal to the TPS to go to low power
- an external "light switch" that controls the 5v supply and boots the
board and shuts it down.

Thanks for you help. This is a really cool board, and one that could
be the heart of a network of sensors for seismic and GPS measurements
on glaciers that we are working on... if I can convince myself that it
can be low power enough by controlling the duty cycle.

Thanks!
Sridhar

Friends,

On pg 32 of BONESRM there is reference to current measurement. It
appears that by setting a register in the TPS65217 chip, we can route
either SYS_5V or SYS_VOLT (which are voltages on either side of a
current-sense resistor) to AIN7 of the processor. Then, by doing some
math, measure the current draw…

  1. Any hints or pointers on setting the register (looking at the
    schematic, it looks like there is a I2C connection from the processor
    to the TPS, and looking at the TPS data sheet, the register is
    MUXCTL). I’m new to the Beaglebone, so pointers on HOW to write to
    this I2C and WHAT to write to the TPS would be appreciated.

The how to write is easy and Google will tell you. I’m still trying to find out from the TPS people the what to write. :frowning:

  1. Any hints or pointers on reading the AIN7. The SRM is terse: “7 A/
    D converters are available…” (sec 6.3.7) but no details.

This is the easy part for which Google would help you:
http://dominion.thruhere.net/koen/cms/using-the-analog-pins-on-a-beaglebone

Here’s what I get:

root@beaglebone:/var/lib/cloud9# for adc in /sys/devices/platform/tsc/ain* ; do echo “$(basename $adc): $(cat $adc)” ; done
ain1: 3999
ain2: 3863
ain3: 3977
ain4: 2113
ain5: 2251
ain6: 3796
ain7: 3850
ain8: 13

I think the indexes are off by 1 in the kernel vs. the hardware guides.

A separate, but related question: The table of current draw by the
board states that the draw is 170mA under “Kernel Idle”. Is it
possible to put the board into a lower power state… from which the
board could wake up on an external signal, or that it would wake up
from periodically - in order of decreasing attractiveness:

  • a software “sleep” mode that could be interrupted by a GPIO line
    going high
  • an external signal to the TPS to go to low power
  • an external “light switch” that controls the 5v supply and boots the
    board and shuts it down.

The hardware certainly allows lower power states for which various wake-up signals could be applied. The software to support these lower-power modes is still a work in progress. I think cpufreq may have already been introduced on the mailing lists (not 100% sure), but some of the cpuidle modes likely have not.

Thanks for you help. This is a really cool board, and one that could
be the heart of a network of sensors for seismic and GPS measurements
on glaciers that we are working on… if I can convince myself that it
can be low power enough by controlling the duty cycle.

Stay tuned! Your contributions to getting it there are certainly welcome!

There are some clues in here (at least the register addresses are listed):

https://lkml.org/lkml/2012/1/4/67

I'm surprised the information doesn't seem to be more readily available. Or more likely, it is, and I should be surprised I haven't looked in the right place...

Steve

Sure enough somehow I had an incomplete datasheet. This one is pretty comprehensive:
http://www.ti.com/lit/ds/slvsb64a/slvsb64a.pdf

They are off by 1 for pretty much every peripheral. Usually the docs start at 1 and the kernel at 0 (e.g. i2c), but for the ADCs it's the other way around :slight_smile:

regards,

Koen

Friends,

Thanks for your help. Here is where I stand:

1. setting the TPS for SYS_VOLT:
root@beaglebone:~# i2cset -y 1 0x24 9 5
root@beaglebone:~# cat /sys/devices/platform/tsc/ain8; echo ""
1557

1557/4096 * 1.8 = 0.684V
Scaling this by 7.08 (2x for the voltage divider at the output of the
TPS, and 3.54 for R1/R1+R2)
SYS_VOLT=4.87

2. setting the TPS for SYS_5V:
root@beaglebone:~# i2cset -y 1 0x24 9 2
root@beaglebone:~# cat /sys/devices/platform/tsc/ain8; echo ""
1858

1858/4096 * 1.8V = 0.82V
Scaling this by 6 (2x for the voltage divider at the output of the
TPS, and 3x for internal divider)
SYS_5V=4.90

3. The voltage difference across the 0.1ohm resistor (R3) is 0.03V, so
the current is 0.3A or 300mA.

I am running this off USB so I can't measure the current draw
directly, but this is in line with Table 3.

Thanks for your help so far..
Sincerely,
Sridhar

Any update? Even I get the “Device or resource busy” message!

Thanks and Regards,
Abhijeet

I haven’t seen any updates. I suspect that the answer is write a kernel module to measure it, or at least expose the mux in the TPS.

I’m using 11 BeagleBones as a program and test station for a consumer electronics device. One BB handles the serial number assignment/reporting and the rest do the actual programming and testing. Originally we planned to measure the current consumption to make sure our device was pulling enough to charge the battery, but not too much. Instead the contract manufacturer is manually testing the current draw.

– David

If anyone is still working on this, I have had success by forcing the i2cset (-f option):
root@beaglebone:~# i2cset -f -y 1 0x24 9 5
Then for Linux beaglebone 3.2.34 our ain’s are in:
/sys/devices/platform/omap/tsc/

So this has worked for me:
root@beaglebone:~# uname -a
Linux beaglebone 3.2.34 #1 Wed Nov 21 14:17:11 CET 2012 armv7l GNU/Linux
root@beaglebone:~# i2cset -f -y 1 0x24 9 5
root@beaglebone:~# cat /sys/devices/platform/omap/tsc/ain8; echo “”
1546