Skip to content

Commit dac2f30

Browse files
committed
Added Tutorials 1 and 2 from PandaBlocks-FPGA repo
1 parent 7c4ec5e commit dac2f30

12 files changed

+3360
-0
lines changed

docs/images/tutorial1_bits.png

95.3 KB
Loading

docs/images/tutorial1_layout.png

127 KB
Loading

docs/images/tutorial1_pulse.png

37.3 KB
Loading

docs/images/tutorial2_layout.png

99.6 KB
Loading

docs/images/tutorial2_pcap.png

43.5 KB
Loading

docs/images/tutorial2_positions.png

83 KB
Loading

docs/user/tutorials/template_tutorial1_leds.json

Lines changed: 1351 additions & 0 deletions
Large diffs are not rendered by default.

docs/user/tutorials/template_tutorial2_pcap.json

Lines changed: 1363 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
.. _blinking_leds_tutorial:
2+
3+
Blinking LEDs Tutorial
4+
======================
5+
6+
This tutorial will introduce you to the basics of PandABlocks, how to wire
7+
Blocks together to make different LEDs flash at different rates
8+
9+
10+
Opening the GUI
11+
---------------
12+
13+
Point your web browser at the ip address or hostname of the PandA and you will
14+
be greeted with a welcome page. At the bottom of this page will be links for
15+
Docs, Control and Admin. You can use the Control link to open the Web Control
16+
page that we will use in these tutorials. For more information on the Web
17+
Control, see its entry in the Docs section.
18+
19+
20+
Loading the tutorial design
21+
---------------------------
22+
23+
The Design dropdown box allows you to select from saved designs stored on the
24+
PandA. Selecting an item from this list will load the saved design over the
25+
current Block settings. You can use the Save method to save your current
26+
design if you wish to keep it.
27+
28+
Select "template_tutorial1_leds" from the box and the settings and wiring of
29+
the Blocks in the PandA will be changed to the following:
30+
31+
.. image:: ../../images/tutorial1_layout.png
32+
33+
If you now look at the front panel of the PandA you should see the first 4
34+
TTL output LEDs turn on sequentially, then turn off in the opposite order.
35+
36+
37+
How the design works
38+
--------------------
39+
40+
The CLOCKS Block is creating a 50% duty cycle pulse train with a period of 1s.
41+
PULSE1..4 are taking this as an input trigger, and producing a different width
42+
pulse with a different delay for each PULSE Block. These PULSE Blocks work as a
43+
delay line, queuing a series of pulses up to be sent out when the delay expires.
44+
45+
If you click on one of them you can see its settings:
46+
47+
.. image:: ../../images/tutorial1_pulse.png
48+
49+
If you increase the delay beyond the 1s period you will notice that the
50+
``Queued`` field will increase, but the PULSE Block will still continue
51+
outputting pulses after the desired delay. However if you increase the width
52+
beyond the pulse period the Block will drop the pulse, reporting it via the
53+
``Dropped`` field. This is so it avoids merging them together.
54+
55+
You can also try clicking on the CLOCKS Block to modify the period of the input
56+
pulse train.
57+
58+
You can also try wiring these outputs to different TTLOUT Blocks by clicking
59+
the Palette icon, dragging a TTLOUT Block onto the canvas, and connecting it
60+
up by dragging the PULSE out port to the TTLOUT val port.
61+
62+
63+
The Bit Bus
64+
-----------
65+
66+
All ports on the visible Blocks are blue. They represent bits, single boolean
67+
values that can propagate through the system by connecting Blocks together.
68+
These outputs can be viewed on their respective Blocks by clicking them on the
69+
design, or all together by clicking the Bits field in the left hand pane:
70+
71+
.. image:: ../../images/tutorial1_bits.png
72+
73+
If you scroll down to the section with the Pulse blocks you will see the
74+
same pattern of flashing lights as on the front of the PandA
75+
76+
.. note::
77+
78+
The web GUI polls the PandA at 10Hz, receiving the current value of each bit
79+
and whether it has changed. The web GUI uses this information to reflect the
80+
current value of each bit if pulsing at less than 5Hz, and displaying a 5Hz
81+
pulsing value if faster than 5Hz. This means that you will see even short
82+
pulses reflected on the web GUI. The front panel LEDs have a similar
83+
behaviour but with a maximum rate of 10Hz.
84+
85+
86+
Conclusion
87+
----------
88+
89+
This tutorial has shown how to load a saved design and modify some parameters.
90+
It has also introduced the PULSE delay block that is useful for delaying and
91+
stretching trigger signals. It has introduced bit outputs and shown how they
92+
can be connected to the outside world using the TTLOUT Blocks. In the next
93+
tutorial we will read about position outputs, how they can be set and how they
94+
can be captured.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
[.]
2+
description: Timing diagrams for tutorial 2
3+
4+
[Trigger Only]
5+
1000 : PCAP.ACTIVE=1
6+
1002 : CLOCK1.OUT=1, CLOCK2.OUT=1
7+
1004 : COUNTER1.OUT=1
8+
1502 : CLOCK1.OUT=0, CLOCK2.OUT=0
9+
1505 : PCAP.TRIG=1
10+
1506 : PCAP.TRIG=0
11+
2002 : CLOCK1.OUT=1, CLOCK2.OUT=1
12+
2004 : COUNTER1.OUT=2
13+
2502 : CLOCK1.OUT=0, CLOCK2.OUT=0
14+
2505 : PCAP.TRIG=1
15+
2506 : PCAP.TRIG=0
16+
3002 : CLOCK1.OUT=1, CLOCK2.OUT=1
17+
3004 : COUNTER1.OUT=3
18+
3502 : CLOCK1.OUT=0, CLOCK2.OUT=0
19+
3505 : PCAP.TRIG=1
20+
3506 : PCAP.TRIG=0
21+
4002 : CLOCK1.OUT=1, CLOCK2.OUT=1
22+
4004 : COUNTER1.OUT=4
23+
4502 : CLOCK1.OUT=0, CLOCK2.OUT=0
24+
4505 : PCAP.TRIG=1
25+
4506 : PCAP.TRIG=0
26+
4690 : PCAP.ACTIVE=0
27+
5000 :
28+
29+
[Trigger Counter 5x faster]
30+
1000 : PCAP.ACTIVE=1
31+
1002 : CLOCK1.OUT=1, CLOCK2.OUT=1
32+
1004 : COUNTER1.OUT=1
33+
1102 : CLOCK2.OUT=0
34+
1202 : CLOCK2.OUT=1
35+
1204 : COUNTER1.OUT=2
36+
1302 : CLOCK2.OUT=0
37+
1402 : CLOCK2.OUT=1
38+
1404 : COUNTER1.OUT=3
39+
1502 : CLOCK1.OUT=0, CLOCK2.OUT=0
40+
1505 : PCAP.TRIG=1
41+
1506 : PCAP.TRIG=0
42+
1602 : CLOCK2.OUT=1
43+
1604 : COUNTER1.OUT=4
44+
1702 : CLOCK2.OUT=0
45+
1802 : CLOCK2.OUT=1
46+
1804 : COUNTER1.OUT=5
47+
1902 : CLOCK2.OUT=0
48+
2002 : CLOCK1.OUT=1, CLOCK2.OUT=1
49+
2004 : COUNTER1.OUT=6
50+
2102 : CLOCK2.OUT=0
51+
2202 : CLOCK2.OUT=1
52+
2204 : COUNTER1.OUT=7
53+
2302 : CLOCK2.OUT=0
54+
2402 : CLOCK2.OUT=1
55+
2404 : COUNTER1.OUT=8
56+
2502 : CLOCK1.OUT=0, CLOCK2.OUT=0
57+
2505 : PCAP.TRIG=1
58+
2506 : PCAP.TRIG=0
59+
2602 : CLOCK2.OUT=1
60+
2604 : COUNTER1.OUT=9
61+
2702 : CLOCK2.OUT=0
62+
2802 : CLOCK2.OUT=1
63+
2804 : COUNTER1.OUT=10
64+
2902 : CLOCK2.OUT=0
65+
3002 : CLOCK1.OUT=1, CLOCK2.OUT=1
66+
3004 : COUNTER1.OUT=11
67+
3102 : CLOCK2.OUT=0
68+
3202 : CLOCK2.OUT=1
69+
3204 : COUNTER1.OUT=12
70+
3302 : CLOCK2.OUT=0
71+
3402 : CLOCK2.OUT=1
72+
3404 : COUNTER1.OUT=13
73+
3502 : CLOCK1.OUT=0, CLOCK2.OUT=0
74+
3505 : PCAP.TRIG=1
75+
3506 : PCAP.TRIG=0
76+
3602 : CLOCK2.OUT=1
77+
3604 : COUNTER1.OUT=14
78+
3702 : CLOCK2.OUT=0
79+
3802 : CLOCK2.OUT=1
80+
3804 : COUNTER1.OUT=15
81+
3902 : CLOCK2.OUT=0
82+
4002 : CLOCK1.OUT=1, CLOCK2.OUT=1
83+
4004 : COUNTER1.OUT=16
84+
4102 : CLOCK2.OUT=0
85+
4202 : CLOCK2.OUT=1
86+
4204 : COUNTER1.OUT=17
87+
4302 : CLOCK2.OUT=0
88+
4402 : CLOCK2.OUT=1
89+
4404 : COUNTER1.OUT=18
90+
4502 : CLOCK1.OUT=0, CLOCK2.OUT=0
91+
4505 : PCAP.TRIG=1
92+
4506 : PCAP.TRIG=0
93+
4602 : CLOCK2.OUT=1
94+
4604 : COUNTER1.OUT=19
95+
4690 : PCAP.ACTIVE=0
96+
4691 : CLOCK2.OUT=0
97+
5000 :

0 commit comments

Comments
 (0)