Date:2013-01-15 23:34:58 (11 years 2 months ago)
Author:Werner Almesberger
Commit:d5ea5d9ae9e710dfb0a3dc30bba47992f349559b
Message:ubb-patgen/README: brief description how ubb-patgen works

Files: ubb-patgen/README (1 diff)

Change Details

ubb-patgen/README
1UBB pattern generator
2=====================
3
4ubb-patgen uses the MMC controller in the Ben Nanonote to send a
5digital pattern on the DATx lines of UBB. All four DATx lines can
6be used. The maximum output rate is 56 MHz, the maximum pattern
7size is 8128 nibbles.
8
9ubb-patgen can also output a clock of arbitrary duration on the
10CLK signal.
11
12The frequencies available for the pattern and the clock signal
13range from 41 kHz to 56 MHz. A map can be found here:
14http://downloads.qi-hardware.com/people/werner/ubb/ben-mmc-clk.png
15
16
17Frequency list
18--------------
19
20# ubb-patgen
21
22shows the available frequencies in ascending order and the
23corresponding MMC clock divider and bus clock tap settings.
24
25# ubb-patgen -q
26
27does the same but shows only the frequencies (in Hz) as
28floating-point numbers.
29
30
31Frequency selection
32-------------------
33
34# ubb-patgen -f 17000000
35# ubb-patgen -f 17M
36# ubb-patgen -f 17MHz
37
38all look for the available frequency closest to 17 MHz and print
39its value in Hz.
40
41Appending a + limits the search to frequencies greater than or
42equal to the specified value. Similarly, - searches for
43frequencies that don't exceed the specified value. Examples:
44
45# ubb-patgen -f 10MHz
469882352.941176
47# ubb-patgen -f 10MHz+
4810500000.000000
49
50# ubb-patgen -f 15M
5115272727.272727
52# ubb-patgen -f 15M-
5314000000.000000
54
55Note that this form of invocation only searches the frequency
56table but does not produce any output on UBB.
57
58
59Clock output
60------------
61
62# ubb-patgen -c
63
64outputs a clock on CLK. The default is 1 MHz and can be changed
65with the option -f.
66
67ubb-patgen exits and leaves the clock running. To wait for a
68while and clean up on exit, add the delay in seconds, e.g.:
69
70# ubb-patgen -f 500kHz -c 10
71
72To stop the MMC bus clock, run
73
74# ubb-patgen -c 0
75
76ubb-patgen warns if the selected frequency does not match the
77requested frequency, e.g.,
78
79# ubb-patgen -f 100kHz -c
80bus clk = 100.962 kHz (+0.96%)
81
82This warning can be suppressed with the option -q.
83
84
85Pattern output
86--------------
87
88# ubb-patgen 0110
89
90first sets the DATx lines to 0, then outputs a 1 bit on DAT0 for
91two clock cycles, and returns DAT0 to zero.
92
93Each digit is a nibble representing the four DATx lines, with DAT0
94having the value 1, DAT1 2, DAT2 4, and DAT3 8.
95
96The repetition of a nibble can also be expressed by following it
97with the number of repetitions in curly braces, e.g.,
98
99# ubb-patgen 01{2}0
100
101The options -f and -q work as usual.
102
103The clock is normally not output but can be activated with the
104option -C. Note that the clock output is not continuous in this
105case.
106
107The pattern can be read from a file. All whitespace is ignored
108and so are comments beginning with #:
109
110# cat <<EOF >pattern-file
1111 # idle state is high
112# send two characters in RS232 format
1130 00010010 1 # "H"
1140 10010110 1 # "i"
1151 # return to idle (high)
116EOF
117# ubb-patgen -f 115.2k pattern-file
118
119If a file with the same name as a pattern exists, ubb-patgen will
120try to load that file. This can be prevented with the option -p.
121
122If only some of the DATx lines should be used for pattern output,
123the option -m MASK can be used to leave the unused lines in their
124previous state. MASK is a value in C syntax. Only lines whose bit
125is set are used for pattern output.
126
127
128External trigger
129----------------
130
131ubb-patgen normally sends the pattern immediately. This can be
132delayed by waiting for an external trigger with the option -t.
133
134# ubb-patgen -t 0 0f0
135
136configures CLK as an input, waits for it to become zero, and then
137outputs the 010 pattern. If CLK is already zero, ubb-patgen will
138send the pattern immediately.
139
140Likewise, -t 1 waits for CLK to become 1. -t cannot be used with
141the -C option.
142
143ubb-patgen usually starts the pattern about 2 us after the
144trigger, but this can be delayed by other system activity.

Archive Download the corresponding diff file

Branches:
master



interactive