added ADC and DMA code; not yet tested