--- /dev/null
+Back in 2007 I [submitted a patch][submit] to [[Comedi]] to support
+triggering analog output off the analog input start signal. The patch
+was [accepted][], and is now old news, but I just ran across my notes
+from developing it, and thought I'd publish them for posterity (and as
+a reminder to myself in case I have to dig into the internals of
+Comedi or NI drivers in the future).
+
+Patch notes
+===========
+
+To understand the patch, you should understand some portion of
+National Instrument's Data Acquisition Systems Timing Controller (NI
+DAQ-STC, see “Understanding NI DAQ-STC” below and the [manual][] for
+more details).
+
+We are trying to set up the AO timing so it triggers off of the AI
+start signal. In NI terminology, that means we want `AI_START1` to be
+the source of `AO_START1`. The possible sources are listed in the
+DAQ-STC manual in table 5-2, p6-7 (380), where we see that
+`AO_START1`'s 19th input is `AI_START1`. To implement this, we need
+to write to the card's `AO_Trigger_Select` register (Appendix B,
+register 67, pB-21 (470)).
+
+Sounds fairly simple, we should just be able to set the appropriate
+`start_arg`. However, looking into source of
+`comedi/driver/ni_mio_common.c`, we see that no external triggering
+information is written to the `AO_Trigger_Select_register`. Looking
+back through the STC manual, we come across their AO trigger example
+(3.6.1.4, p3-23 (185)) which shows how to set up AO triggering.
+Comparing to `ni_mio_common.c`, we see that the AO triggering
+configuration in `ni_ao_cmd()` looks just like the “software
+triggered” case in NI's example. So it seems impossible to run
+externally triggered AO.
+
+The patch edits `ni_mio_common.c` to make it more like NI's example
+and `ni_mio_common.c`'s own AI code.
+
+Understanding NI DAQ-STC
+========================
+
+Consider the timing sequence shown in the Comedi manual. For output,
+all the same timings apply, but data is flowing the other way.
+
+Here is a translation table between NI's terminology and Comedi's (NI
+references from STC manual):
+
+<table>
+ <tr><th>Comedi AI</th> <th>NI AO</th> <th>Reference</th></tr>
+ <tr><td>seq_start</td> <td>AO_START1</td><td>Fig 3-10, p3-12 (174)</td></tr>
+ <tr><td>scan_begin</td><td>UPDATE</td> <td>Fig 3-2, p3-6 (168)</td></tr>
+ <tr><td>convert</td> <td>TMRDACWR</td> <td>Fig 3-2, p3-6 (168)</td></tr>
+</table>
+
+There are references to an `AO_START` as distinct from `AO_START1`,
+but it appears to be unsupported:
+
+* It does not show up in the manual's AO feature list (section 3.2,
+ p3-2 (164), compare to the AI feature list, section 2.2, p2-2 (31))
+* It shows up in some contexts as unsupported (e.g. section 3.6.5,
+ p3-36 (198))
+
+[submit]: http://groups.google.com/group/comedi_list/browse_thread/thread/cc2141e7cf23e7ca/
+[accepted]: http://www.comedi.org/cgi-bin/viewvc.cgi/comedi/comedi/drivers/ni_mio_common.c?r1=1.343&r2=1.344
+[manual]: http://digital.ni.com/manuals.nsf/websearch/E929838D7D0EE50986256728007FEADF
+
+[[!tag tags/linux]]
+[[!tag tags/programming]]
+[[!tag tags/hardware]]