|
1 | | -# =========================================================================== |
2 | 1 | # Adafruit_BBIO.Encoder Class |
3 | | -# =========================================================================== |
4 | | -# refers to graycatlabs/PyBBIO/bbio/libraries/RotaryEncoder/rotary_encoder.py |
5 | | - |
6 | | -# BeagleBone must boot with cape-universal enabled |
7 | | -# and load the cape-universala overlay in order to |
8 | | -# use all the eQEP pins |
9 | | -# |
10 | | -# Install the latest Device Tree overlays: |
11 | | -# ======================================== |
12 | | -# sudo apt-get upgrade bb-cape-overlays |
13 | | -# |
14 | | -# File: /boot/uEnv.txt |
15 | | -# ==================== |
16 | | -# uname_r=4.4.62-ti-r99 |
17 | | -# cmdline=coherent_pool=1M quiet cape_universal=enable |
18 | | -# cape_enable=bone_capemgr.enable_partno=cape-universala |
19 | | -# |
20 | | -# File: /sys/devices/platform/bone_capemgr/slots |
21 | | -# ============================================== |
22 | | -# 0: PF---- -1 |
23 | | -# 1: PF---- -1 |
24 | | -# 2: PF---- -1 |
25 | | -# 3: PF---- -1 |
26 | | -# 4: P-O-L- 0 Override Board Name,00A0,Override Manuf,cape-universala |
27 | | -# |
28 | | -# eqep0: P9_27, P9_92 |
29 | | -# =================== |
30 | | -# config-pin P9_27 qep |
31 | | -# config-pin P9_92 qep # alias for P9_42.1 |
32 | | -# cat /sys/devices/platform/ocp/48300000.epwmss/48300180.eqep/position |
33 | | -# |
34 | | -# eqep1: P8.33, P8.35 |
35 | | -# =================== |
36 | | -# config-pin P8.33 qep |
37 | | -# config-pin P8.35 qep |
38 | | -# cat /sys/devices/platform/ocp/48302000.epwmss/48302180.eqep/position |
39 | | -# |
40 | | -# eqep2: P8.11, P8.12 |
41 | | -# =================== |
42 | | -# config-pin P8.11 qep |
43 | | -# config-pin P8.12 qep |
44 | | -# cat /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position |
45 | | -# |
46 | | -# alternate pins for eqep2 (mutually exclusive) |
47 | | -# eqep2b: P8.41, P8.42 |
48 | | -# ==================== |
49 | | -# config-pin P8.41 qep |
50 | | -# config-pin P8.42 qep |
51 | | -# cat /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position |
| 2 | + |
| 3 | +Initially based on the [PyBBIO](https://github.com/graycatlabs/PyBBIO/bbio/libraries/RotaryEncoder/rotary_encoder.py) rotary encoder code. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +These instructions are based on a 4.4.x Linux kernel. |
| 8 | + |
| 9 | +In order to use all eQEP pins the BeagleBone must: |
| 10 | + |
| 11 | +- boot with cape-universal enabled, and |
| 12 | +- load the cape-universala overlay |
| 13 | + |
| 14 | + |
| 15 | +### Install/upgrade the latest Device Tree overlays |
| 16 | + |
| 17 | +``` |
| 18 | +sudo apt-get upgrade bb-cape-overlays |
| 19 | +``` |
| 20 | + |
| 21 | +### Load the universal cape |
| 22 | + |
| 23 | +Modify the `/boot/uEnv.txt` file to contain these two lines: |
| 24 | + |
| 25 | +``` |
| 26 | +cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable |
| 27 | +``` |
| 28 | + |
| 29 | +``` |
| 30 | +cape_enable=bone_capemgr.enable_partno=cape-universala |
| 31 | +``` |
| 32 | + |
| 33 | +### Check slots |
| 34 | + |
| 35 | +TBD |
| 36 | + |
| 37 | +## eQEP configuraton |
| 38 | + |
| 39 | +### eQEP0 |
| 40 | + |
| 41 | +Pins: `P9_27`, `P9_92` |
| 42 | + |
| 43 | +``` |
| 44 | +$ config-pin P9_27 qep |
| 45 | +$ config-pin P9_92 qep # alias for P9_42.1 |
| 46 | +$ cat /sys/devices/platform/ocp/48300000.epwmss/48300180.eqep/position |
| 47 | +``` |
| 48 | + |
| 49 | +### eQEP1 |
| 50 | + |
| 51 | +Pins: `P8.33`, `P8.35` |
| 52 | + |
| 53 | +``` |
| 54 | +$ config-pin P8.33 qep |
| 55 | +$ config-pin P8.35 qep |
| 56 | +$ cat /sys/devices/platform/ocp/48302000.epwmss/48302180.eqep/position |
| 57 | +``` |
| 58 | + |
| 59 | +### eQEP2 |
| 60 | + |
| 61 | +Pins: `P8.11, P8.12 |
| 62 | + |
| 63 | +``` |
| 64 | +$ config-pin P8.11 qep |
| 65 | +$ config-pin P8.12 qep |
| 66 | +$ cat /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position |
| 67 | +``` |
| 68 | + |
| 69 | +### eQEP2b |
| 70 | + |
| 71 | +Note: alternate pins for eQEP2 (mutually exclusive) |
| 72 | +Pins: `P8.11, P8.12 |
| 73 | + |
| 74 | +``` |
| 75 | +$ config-pin P8.41 qep |
| 76 | +$ config-pin P8.42 qep |
| 77 | +$ cat /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position |
| 78 | +``` |
0 commit comments