-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTCD1304.help
More file actions
281 lines (177 loc) · 9.61 KB
/
TCD1304.help
File metadata and controls
281 lines (177 loc) · 9.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
TCD1304 CLI: TCD1304 CLI: help
Report device, version and configuration
version - report software version
configuration - report device configuration and data structure
pins - report digital i/o functions and pin numbers
stop - stop everything
Coefficients for pixel number to wavelength
store coefficients <a0> <a1> <a2> <a3> (need 4 numbers)
erase coefficients
coefficients - report
store units <string> (upto 6 characters, c.f. nm, um, mm)
units - report
Identifier string (63 bytes)
store identifier <identifier>
identifier - list identifier string
Data format
set ascii - set data format to ascii
set binary - set data format to binary
format - report data form
set async - data is sent asynchronously
set synchronous - READY DATA is sent, host responds send data
enable|disable crc - precede each data transfer with crc
enable|disable sum - precede each data transfer with sum
crc | send crc - send 8 bit crc calculated on the binary data
sum | send sum - send 32 bit sum calculated on the binary data
send test - send test data
send - (re)send last data
Microcontroller functions
temperature - report microcontroller temperature
reboot - reboots the entire board
ADCs Read and average analog inputs
adcs <navgs> - read analog inputs and report
set adcs <navgs> - read ADCs at frame completion
set adcs off
LCCD commands:
1) High level read and trigger commands
read <exposure> (secs) - read single frame
read <nframes> <exposure> - read contiquous frames
read <nframes> <exposure> <interval> - read fast frame sequence
read ... nostart - setup read without start
start read
wait read
trigger <exposure> (secs) - triggered read, single frame
trigger <nframes> <exposure> - trigger read, contiquous frames
trigger <nframes> <exposure> <interval> - trigger read, fast frame sequence
trigger ... nostart - setup triggered read, without start
start trigger
wait trigger
gate frame <n>
configure trigger pin <n> | pullup | pulldown | nopull | rising | falling | change
============================================================================
Middle level commands for optional manual setup and operation
2) Single pulse setup (time syntax: 1E-6, 0.000001 or 1u)
setup pulse [<clk_period> <sh_width> <sh_offset> <icg_width> <icg>_offset> [nframes [nframesets]]] (in secs)
defaults to 0.5u 1u 0.6u 2.6u 0.5u 1 1
Generally this command will be followed by "setup timer" or "setup trigger"
start pulse - launches a single pulse with readout
stop pulse - stops ongoing pulse
arm pulse - re-arm for the next pulse, see set nframes and nframesets
init pulse - re-arms and sets frame counter to 0
configure clearing pulses [n] - power-up default is 0
(SH is pulsed before the start of the next exposure to clear residual charge)
3) Frameset setup - provides short exposure time (time syntax: 1E-6, 0.000001 or 1u)
setup frameset <exposure> <interval> <nframes> [<clk_period> <sh_width> <sh_offset> <icg_width> <icg>_offset> [nframes [nframesets]]] (in secs)
defaults to 100u 5E-3 10 0.5u 1u 0.6u 2.6u 0.5u
Generally this command will be followed by "start frameset" or "setup trigger"
start frameset - launches a single frameset with readout
stop frameset - stops ongoing frameset
arm frameset - re-arm for the next frameset, see set nframes and nframesets
init frameset - re-arms and sets frame counter to 0
4) Timer setup, clocks pulses, implemented in the flexpwm, rounded to multiple of 5,10 or 20 msecs depending on readout time
setup timer <exposure> [<nframes> [<offset>]] - nframes defaults to previous setup, offset to 0
Generally this command will be followed by "start timer" or "setup trigger"
start timer - launches the timer
stop timer - stops the timer
5) External trigger setup - triggers pulse, timer or frameset per setup (see section 1 above)
setup trigger [ncounts]
Generally this command will be followed by "start trigger"
start trigger - arms the interrupt
stop trigger - disables the trigger
configure trigger [args ....]
args: pin <n>, pullup | pulldown | nopull, rising | falling | change
============================================================================
More commands
set sync on | off - enable or disable sync pin output
set frame counts nframes [nframesets]
set frame counts nframesets
print pulse counters
System timer - Clocks the pulse start function using standard timer calls (see setup pulse)
setup clock <period> [n] - defaults to number required by the tcd1304 setup
start clock
stop clock
This is the obsoleted frameset setup:
setup old frameset <clkbase (64|128)> <exposure> <pulsewidth> <frame interval> <nframes> [add] (in secs)
start old tcd1304
stop old tcd1304
Low level TCD1304 submodule setup, refer to flexpwm section of the processor manual
setup submodule <name> [arg val ...] [commands ....]
names: clk sh icg cnvst timer
args: prescale <n>, period <n>, onA|B <n>, offA|B <n>, [no]invertA|B, ctrl2 <n>
master, slave, sync, print, list, check, load
============================================================================
Low level TCD1304 FlexPWM Commands, refer to flexpwm section of the processor manual
All of the submodules:
flexpwm dump - dump all of the flexpwm registers
flexpwm stop - stop all of the flexpwm submodules
Single or group commands (submodule 0-3 or mask 0x1 - 0xF
flexpwm <submodule|mask> clear load ok (cldok in mcu reference manual)
flexpwm <submodule|mask> set load ok (ldok in mcu ref manual)
flexpwm <submodule|mask> clear run - stops the clock
flexpwm <submodule|mask> set run - starts the clock
Single submodule commands
flexpwm <submodule> set clock master - clock runs independently
flexpwm <submodule> set clock slave - clock syncs and starts with 0
flexpwm <submodule> set clock sync - clock syncs with 0, starts independently
flexpwm <submodule> force - force counter to reload to init
Single submodule counters
flexpwm <submodule> set prescale <value> - prescale, 0 to 7 for divider 1<<p
flexpwm <submodule> set init <value> - set counter init register to value (16 bits)
flexpwm <submodule> set val<n> <value> - set comparison register 0 to 5, to value
============================================================================
Processor reference manual:
i.MX RT1060 Processor Reference Manual
https://www.nxp.com/products/i.MX-RT1060
Chapter 55 Enhanced Flex Pulse Width Modulator (eFlexPWM) page 3091
============================================================================
Pin controls - <pin> = sync | busy trigger | <n>
read pin <pin>
set pin <pin> hi|low|input|pullup|pulldown|output
pulse pin <pin> [usecs]
toggle pin <pin>
============================================================================
Preconfigured pins
Trigger(input)2 Busy 1 Sync 0 ~OverCurrent 23
============================================================================
Help subcommands
help [all | report | coefficients | data | microcontroller | adcs
lccd | pulse | frameset | trigger | help]
============================================================================
Commands implemented in the CLI/host computer:
h|help - produces this help text
Process frames from the data queue
add all - adds and leaves one frame for save
add frameset - adds and leaves one frameset for save
clear - empty the data and text queues
save fileprefix comments... - save contents of data queue to diskfile
Wait for data collection
wait - wait for "complete" message from sensor
wait read | trigger - for the tcd1304 firmware wait functions
wait - wait for "complete" message from sensor
Pass command explicitly to the TCD1304 firmware
tcd1304 .... - pass command to the tcd1304
Pass command to operation system shell
!command - execute shell command
Pass instruction to python intepretor
a = 3 - '=' causes evaluation as python
= python statement - pass to python interprator
these commands have access to local() and class name spaces
Execute commands from text file, parameters appear as a list, batchpars
@filespec [parameter list] - read and execute commands from a file
Example
@testscrpt 1 2
testscript:
=print(batchpars)
output:
['testscript', '1', '2']
Loops and string substitution, by example
for a_ in [0,.1,.2]: @testscript "%.2f"%(a_)
for a_ in [0,.1,.2]: for b_ in [ .3,.4,.5]: @testscript "%.2f"%(a_) "%.2f"%(b_)
testscript:
=print(batchpars)
output:
['testscript', '0.00', '0.30']
['testscript', '0.00', '0.40']
etc
Exit the program
q[uit] - exit the cli program