BlinkenBone setup - Testing the physical connections
The physical setup of a BlinkenBone installation consists of several components:
- a BlinkenBus driver is installed on the Angstrom distribution on the BeagleBone
- the BlinkenCape is plugged onto the BeagleBone
- the BlinkenBus cable is plugged into the BlinkenCape
- a BlinkenBoard is connected to the BlinkenBus flat cable
- the BlinkenBoard has power and is jumpered to a proper address
- high/side lowside drivers chips must be plugged into the driver sockets on the BlinkenBoard
- Panel switches and lamps must be connected to the driver chips.
See here for background information. Attached are schematics and the bus protocol.
All these components can be tested with the test program "blinkenbustest"
The test program blinkenbustest must run on the BeagleBone, so scp it to /home/root, then make an ssh connection (in the example, the BeagleBone has an hostname of "blinkenbone").
joerg@vmbeagle:~$ ssh root@blinkenboneroot@blinkenbone:~# ./blinkenbustest
*** BeagleBone BLINKENBUS test program ***
Compiled Aug 26 2013 16:34:18
Copyright (C) 2012-2013 Joerg Hoppe.
Opening /dev/blinkenbus ...
*** Main menu ***
s) test gpio signals
c) test single BLINKENBUS cycles
b) test BLINKENBUS block read/write
l) loop back test over I/O register interfaces
blinkenbustest is menu driven and pure ASCII art. Select a menu item by typing the marked letter, then <return>.
The menu items s, c ,b, and l perform main diagnostic functions.
Caution: Interfering with blinkenbusd
Before you proceed: it is very likely that the demon "blinkenlightd" is running in the background.
This demon may also controls the BlinkenBoard you want to test here ... depending on the "/etc/blinkenlightd.conf" file.
So best is to kill this demon after each restart of the BeagleBone Angstrom Linux.
root@blinkenbone:~# ps | grep blinken
79 root 2004 S /home/root/blinkenlightd -c /etc/blinkenlightd.conf -b
98 avahi 2936 S avahi-daemon: running [blinkenbone.local]
268 root 2116 S grep blinken
root@blinkenbone:~# kill 79
Caution: BlinkenBoard reset state
The BlinkenBoard has its own reset circuity. If you power it off independently from the BeagleBone, it will enter its reset state. Then all the output registers go tristate. REset state can be cleared by writing into the Baord Control Register, see below.
On normal BeagleBone startup this will be hidden from you, because the blinkenlightd demon will initialize the BlinkenBoards he controls.
Keep this in mind, if the BlinkenBoards seems to go dead suddently while testing !
Submenus of blinkenbustest
Each submenu of blinkenbustest allows to test one more level of functionality.
Normally, you will only need "test single BLINKENBUS cycle" ... but here the submenus are explained in logical order.
Menu "test gpio signals"
Here you can toggle all the BlinkenBus signal lines manually. This tests the driver, the BlinkenCape and the flat cable.
*** Set any BLINKENBUS signal ***
# Signal Dir Value Beaglebone header
- ------ ------ ------ -----------------
0) DATA INPUT 0xe3 P8.25, P8.24, P8.5, P8.6, P8.23, P8.22, P8.23, P8.4
1) ADDRESS07 INPUT 0x07 P8.45, P8.46, P8.43, P8.44, P8.41, P8.42, P8.39, P8.40
2) R/W* INPUT 0x00 P8.26
3) STROBE INPUT 0x01 P8.21
4) ADDRESS8 INPUT 0x00 P8.20
You can measure these signal levels directly on the BlinkenBus flat cable connector on the BlinkenBoard.
BlinkenBus signals on the BlinkenBoard
Menu "test single BLINKENBUS cycle"
Here you can read or write data to/from different input/output registers chips (74lvx244 or 74lvx573). This tests the CPLD, the DIP switch and your panel wiring.*** Initiate BLINKENBUS access cycles ***
cur cycle type = READ
cur addr ..... = 0x0
cur data value = 0x0
<hex addr> read <value> from <addr>
<hex addr> <hex value> write <value> into <addr>
r repeat last BLINKENBUS access cycle once
r <hex end_addr> repeat last BLINKENBUS access cycle multiple times
and increment address until <end_addr> reached
If <end_addr> < address>: start from 0
Since this is the main menu item for all your test work, board operation is explained here more in depth:
The further examples assume the board address is set to 0 (like in the image), so usable registers addresses are 0x000 to 0x00f.
Board Control Register
First try to access the "Board Control Register". It is located at address 0x00f and read/write. Its least significant bit 0 (mask 0x01) controls the tristate of the output drivers, so make sure this bit is 0. If it is "1", set it to "0":
cur cycle type = READ
cur addr ..... = 0xf
cur data value = 0x1
Choice: f 0
Performing BLINKENBUS WRITE cycle to address 0xf, value := 0x0
*** Initiate BLINKENBUS access cycles ***
cur cycle type = WRITE
cur addr ..... = 0xf
cur data value = 0x0
The unused DIP switches 1..3 are visible as bits 7 to 5 in the Board Control Register. So if you play with these, and read the Board control register, you can verify your BlinkenBoard is working, even without anything is connected.
The Input registers IN0-IN4 can be queried by reading address 0x000 to 0x004, the outputs OUT0 -OUT10 can be set by writing to 0x000 to 0x00a.
See previous page for details.
Menu "test BLINKENBUS block read/write"
This tests dynamic behaviour. A whole block of registers is read at once in highest speed. I needed this while developing the driver.
Menu "loop back test over I/O register interfaces"
This implements a loop-back test. You need a special 8-wire-adapter to connect one input register with one output register. The test then outputs values at highspeed and reads them back over the input. You repeat this test until every output and every input has been tested at least once.
*** Test BLINKENBUS loop back over register terminals ***
input low pass cutoff freq : 20000 Hz
input register addr ...... : 0x000
output register addr ..... : 0x000
test time ................ : 10 secs
f <freq> input low pass cutoff frequency in hz (decimal)
a automatic: scan for input&output reg
i <addr> change addr of input register (hex)
o <addr> change addr of output register (hex)
t <seconds> change test run time in seconds (decimal)
r run test
Input and Output register can reside on different BlinkenBoards. You can set address of the input and output register manually, but the "automatic scan" options scans all registers on all BlinkenBoards for any loop-back connection.
The test is run at max 20kHz (20000 read/write transactions per second), this will stress the low-pass filters on the inputs.
While testing, a mix of different test patterns is used: "walking zeros", "walking ones", "count up" and random values.
If every input and every output is tested this way, your BlinkenBoard truly works!