 
   Returned value is 2s complemented 16 bit integer.
   */
-int16_t read_analog(uint8_t next_chan) {
+inline int16_t read_analog(uint8_t next_chan) {
 
   // select the channel for the next read
   digitalWrite(_A0, next_chan&0x1?HIGH:LOW);
   digitalWrite(_A1, next_chan&0x2?HIGH:LOW);
 
-  // we really don't need any interrupts messing the timings in here up
-  noInterrupts();
-  
   // begin a conversion
   digitalWrite(_RC, LOW);
 

  // use port manipulation to read the data pins. Note that our pinmapping
  // is such that port C maps exactly onto the parallel output from the
  // ADS7825.
  uint8_t hbyte = PINC;

  // now for the low byte
  digitalWrite(_BYTE, HIGH);
  __builtin_avr_delay_cycles(2);
  uint8_t lbyte = PINC;

  return (hbyte<<8 | lbyte);
}

volatile uint8_t trigcnt = 0;
void trig_ISR() {
  trigcnt += 1;
}

// buffer for 16bit values from the ADC
int16_t buf[_BUF_SIZE];
uint16_t writepos = 0;

void loop() {
  int c = Serial.read();

    Serial.print(read_analog(3));Serial.print(" ");
    Serial.print(read_analog(0));Serial.println();
  } else if (c == 's') {
    noInterrupts();
    // prime the first channel
    read_analog(0);
    trigcnt = 0;
    writepos = 0;
    interrupts();
  } else if (c == 'p') {
    for (int idx = 0; idx < writepos; idx += 4) {
      Serial.print(idx/4);Serial.print(" ");
