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.
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…
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.
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.
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!
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...
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
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.
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