AIN7 readout on BB with 4.1.10-bone16

Hello, I have installed 4.1.10-bone16 from RCN’s git on my custom board. All digital I/Os have been configured via device tree, but I cannot access AIN7 as I used to with pre-dtb kernels. All suggestions about going through /sys/devices/bone_capemgr.*/slots seem to not apply, as there is no such path on my installation. Any ideas on what I might be missing?

Thanks

This is because unless I’m mistaken AIN7 is configured as a touchscreen PIN by default. Either way only AIN0-AIN6 are configured as general purpose ADC’s. Passed that, I’, not sure of the ramifications of setting AIN7 as a general purpose ADC either. Read the AM335x TRM before jumping in. http://elinux.org/images/6/65/Spruh73c.pdf

debian@beaglebone:~$ sudo cp /lib/firmware/BB-ADC-00A0.dtbo .
debian@beaglebone:~$ dtc -I dtb -O dts BB-ADC-00A0.dtbo > BB-ADC-00A0.dts
debian@beaglebone:~$ nano BB-ADC-00A0.dts
/dts-v1/;

/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”, “ti,beaglebone-green”;
part-number = “BB-ADC”;
version = “00A0”;
exclusive-use = “P9.31”, “P9.40”, “P9.37”, “P9.38”, “P9.33”, “P9.36”, “P9.35”, “tscadc”;

fragment@0 {
target = <0xdeadbeef>;

overlay {
status = “okay”;

adc {
ti,adc-channels = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
};
};
};

fixups {
tscadc = “/fragment@0:target:0”;
};
};

OK, so this is what I think the deal is, but you should double check yourself ( always ) before taking someone else’s word. For anything important.

Important: read everything

First: exclusive-use = “P9.31”, “P9.40”, “P9.37”, “P9.38”, “P9.33”, “P9.36”, “P9.35”, “tscadc”; P9.32 seems to be missing. It is my assumption if you replace “tscadc” with “P9.32” that should fix one configuration piece for your purposes.

Second:
ti,adc-channels = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
I would assume should be
ti,adc-channels = <0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7>;

For all 8 pins to be configured as general purpose ADC pins With all of the above said. I have not done this myself. So you should double check everything. I do recall reading in the TRM where it was mentioned that they ADC module can be configured as all channels running in general purpose mode. I have not however checked the schematics to see if P.32 is in fact exposed to the P9 header, or if that PIN is in fact connected to channel 7 of the ADC module. You need to check that for yourself.

One last thing of note. If you use an LCD screen that has to use AIN7 as a touchscreen ADC channel, then you will have problems with that device tree file as well. You will either have to set the PIN back to how it was, or modify the touchscreen device tree file.

I thought this had no actual bearing on the configuration of things, but was just there to warn you if any other overlay also claimed those same strings (e.g. claiming "p9-31" is not the same as "p9.31").

I thought this had no actual bearing on the configuration of things, but was just there to warn you if any other overlay also claimed those same strings (e.g. claiming “p9-31” is not the same as “p9.31”).

I’m not a device tree expert. But it does make sense to me that the PIN connected to the AIN7 channel of the ADC module should be explicit.

Whatever the case, I noticed the same behavior as Nikos. When attempting to use AIN7 through sysfs, the system complains loudly - Something to the effect that the device is busy, or some such related error.