UBB pattern generator

Werner Almesberger werner at almesberger.net
Wed Jan 16 10:42:06 EST 2013


Let's make more interesting things with UBB, for example a pattern
generator. This uses the MMC controller and DMA to obtain precise
timing.

Characteristics:

- four digital channels

- pattern rate 41 kHz to 56 MHz (142 different rates selectable)

- maximum pattern length 8128 nibbles

- optional external trigger with sequence triggering, debouncing,
  and trigger delay (the implementation of the trigger is not very
  aggressive and the trigger can lag in the millisecond range)

- can also generate a continuous clock signal (instead of the
  arbitrary but finite pattern)

The code lives here:
http://projects.qi-hardware.com/index.php/p/ben-blinkenlights/source/tree/master/ubb-patgen

There's quite a lot of options. They're described in
http://projects.qi-hardware.com/index.php/p/ben-blinkenlights/source/tree/master/ubb-patgen/README

The external hardware is very simple. The only external circuit
the pattern generator needs is a resistor that pulls down CMD to
fake a response from the device.

http://downloads.qi-hardware.com/people/werner/ubb/patgen/ubb-patgen-adapter.jpg

Schematics and a sheet with cut-out labels are here:
http://projects.qi-hardware.com/index.php/p/ben-blinkenlights/source/tree/master/ubb-patgen/hw

The following picture shows the pattern generator at work:

http://downloads.qi-hardware.com/people/werner/ubb/patgen/ubb-patgen-demo.jpg

The Ben on the right runs the pattern generator. It is set to
output a pattern corresponding to the string "Hi!\r" in RS232
format. The pattern rate is set to nominally 115 kHz for which
ubb-patget selects a 114.13 kHz clock.

Channel 0 (DAT0) is connected to the Ben on the left that runs
"chat" from
http://projects.qi-hardware.com/index.php/p/ben-blinkenlights/source/tree/master/swuart-chat

TRIG/CLK is pulled up (by previously running "ubbctl clk=r")
and a button to ground is connected externally. The trigger is
set to "0" with 100 us debouncing.

The oscilloscope shows TRIG/CLK on top and DAT0 at the bottom.
One horizontal division is 100 us.

Here is a cheat sheet with the available clock frequencies:

http://downloads.qi-hardware.com/people/werner/ubb/ben-mmc-clk.png

- Werner




More information about the discussion mailing list


interactive