 //   than a handful of waveforms are required. If that becomes an issue, it
 //   might make sense to read waveforms from an SD card via SPI. The SPI
 //   interface of an SD (MMC) card can be clocked at 25 MHz, so it is probably
-//   fast enough for may applications.
+//   fast enough for many applications.
+
+
+//
+// Hardware requirements
+//
+
+// The two AD660s are assumed to be configured in serial data mode, with the
+// DAC for channel 0 connected to the MCU and the channel 1 DAC daisy-chained
+// from the serial output of the channel 0 DAC.
+//
+// The following connections between the MCU board (Arduino Due) and the DACs
+// are assumed:
+// - SPI header MOSI (PA26) -> SIN (DAC 0)
+// - SPI header SCK (PA27) -> nCS (all DACs)
+// - Digital pin 10 (PA28 (and PA29)) -> LDAC (all DACs)
+// - Digital pin 2 (PB25) -> nCLR (all DACs)
 
 
 //
 // Serial communication protocol
 //
 
-// Commands are terminated with LF
+// Commands are terminated with LF. Extra spaces are not allowed.
 //
 // ID - identify the device
 // ID\n

// On the timer interrupt, we determine the current waveform bank and start
// sending the sample for channel 0.
void TC_Sampler_Handler() {
  // Access the TC to deassert the IRQ
  TC_GetStatus(TC_SAMPLER, TC_SAMPLER_CHANNEL);

  g_current_sample_bank = g_current_bank;

  SPI_DAC->SPI_IDR = ~SPI_IDR_TDRE;
  SPI_DAC->SPI_IER = SPI_IER_TDRE;
  
  // We do not enable the IRQ line itself here; we only want TDRE interrupts
  // when we are actully sending someting words.
}


