Does BBB have builtin counter

This is the “research” I have done on BBB:

  • There is no instruction about gpioset, gpioget. I came across one usage of gpioinfo in the “Cookbook”. That’s it.
  • There no instruction about iwctl to configure USB wifi dongle. All other documentations were talking about /etc/network/interfaces, /etc/wpa_supplicant/wpa_supplicant-wlan0.conf, and they don’t work.
  • I found connmanctl mentioned, but for non-BBB board. Yeah, it works, but it also takes over ethernet connection.
  • There is no instruction on builtin LED. Fortunately, the “Cookbook” mentions /sys/class/leds/beaglebone:green:usr[0123]/. So, this was easy.
  • There is no instruction on ADC, and I found /sys/bus/iio/devices/iio:device0/in_voltage0_raw mentioned in the “Cookbook”. Fortunately, it’s still relevant.
  • There is no instruction on PWM. I had to ask here, and only then, was told about BB-EHRPWM1-P9_14-P9_16.dtbo, BB-EHRPWM2-P8_13-P8_19.dtbo.
  • There is no instruction on eQEP. I am asking here.

Telling me to read AM335x specs, AM57xx specs, is not very helpful. It’s same as Odroid guys telling me to read “Amlogic” specs, “Rockchip” specs, and same as Raspberry guys telling me to read “Broadcom” specs. I just want to use what you’re selling.

I can follow instructions, though. I just want “add this to that file” instructions. I can take it from there.

Background:

I fell into this “rabbit hole”, because I want to make BBB, Odroid, and Raspberry into scriptable keyboard, mouse, and (touch) screen, for automated QA testing and other situations.

  • BeagleBone Black – success, and it’s still in production.
  • Odroid U3+ – success, but it’s discontinued.
  • Raspberry Pi B+ (model 1) – failed, it’s microUSB port is power only. Hopefully, Zero 2W works out better.

uname -r = 6.17.10-bone18
/etc/dogtag = BeagleBoard.org Debian Trixie Base Image 2025-11-18
image = am335x-debian-13.2-base-v6.17-armhf-2025-11-18-4gb.img.xz

Best iwctl docs are here: iwd - ArchWiki we switched to iwctl as it turned out no one understands wpa_supplicant! :wink:

connman was going EOL in debian, so I switched us to wpa_supplicant as RPI uses it, so everyone should understand it! (that was a big EGG on my FACE!!! so i switched us to IWD..)

connman worked for a few years, but after it was heading to EOL in debian, i had to switch to something, i think now it’s maintained again, but nope… burned once..

Edit: Yes it’s maintained now, the hole in support affect us from:

Last upload: Mon, 10 Feb 2014 19:40:38 -0800
New maintainer: Wed, 27 Apr 2016 19:40:29 +0200

So for BeagleBoard we lost a whole Debian Release cycle..

Honest, i really like iwd, it uses kernel crytpo functions so it’s more light weight then the massive wpa_supplicant stack and more maintainable in the long run..

Regards,

and pushed.. https://github.com/beagleboard/BeagleBoard-DeviceTrees/commit/490aed4a3aeac8692fdd0537e1d99717264139be

Please try:

cd /opt/source/dtb-6.17.x/
git pull

Then build:

./build_n_install.sh

Then in /boot/uEnv.txt add:

uboot_overlay_addr5=BB-EQEP0.dtbo

We want to see if the counter subsystem comes up..

with this i see..

voodoo@23-am335x-bbb:~$ tree /sys/bus/counter/devices/counter0/
/sys/bus/counter/devices/counter0/
├── count0
│   ├── ceiling
│   ├── ceiling_component_id
│   ├── count
│   ├── direction
│   ├── direction_component_id
│   ├── enable
│   ├── enable_component_id
│   ├── function
│   ├── function_available
│   ├── name
│   ├── signal0_action
│   ├── signal0_action_available
│   ├── signal0_action_component_id
│   ├── signal1_action
│   ├── signal1_action_available
│   └── signal1_action_component_id
├── dev
├── events_queue_size
├── name
├── num_counts
├── num_signals
├── of_node -> ../../../../../../../../../firmware/devicetree/base/ocp/interconnect@48000000/segment@300000/target-module@0/epwmss@0/counter@180
├── power
│   ├── async
│   ├── autosuspend_delay_ms
│   ├── control
│   ├── runtime_active_kids
│   ├── runtime_active_time
│   ├── runtime_enabled
│   ├── runtime_status
│   ├── runtime_suspended_time
│   └── runtime_usage
├── signal0
│   ├── name
│   └── signal
├── signal1
│   ├── name
│   └── signal
├── subsystem -> ../../../../../../../../../bus/counter
└── uevent

7 directories, 35 files

Docs: Making sure you're not a bot!

pushed all 4 variants to the git repo..

They are self contained, no need to load a pwm overlay..

Regards,

Yes! eQEP0 is working, and I can count pulses.

At first, I put “push button” directly, and it was counting all the key bounces. Good sign. Then, I connected to the GPIO pin that is turning on LED when I press a button, and it’s counting on both edges. So, count is 2x the input pulse.

Thank you.

1 Like