Sunday, 8 October 2017

Digital DI Box 02 - ADC

Digital DI Box 02 - ADC

ATXmega ADC

ATXmega32A4U has a 12bit ADC with the ability to perform up to 1M conversions per second. Since audio signal is signed, I will only get 11 bits, but with such fast rate I can oversample (I hope). Below is the initial buffered sample (approximately 1000 readings). Drawn in canvas, captured via serial port at 2Mbs Baud.

Due to the amount of data being transferred I could not send the bulk of data and at the same time perform the conversion. My calculations show that in order to send reasonable amount of data to put into more or less pleasant visible form will require at least 10us of CPU time. That means I will have to scan the ADC channel once in 10us. ATXmega datasheet is quiet about the ADC maximum clock (I assumed 2us, but at what CPU clock?). Anyway 2us supposed to give me almost 50KHz sampling rate. 10us for sending data over serial line will reduce the sampling rate down to 10KHz, unless I can oversample. This will have to wait, I need to get the continuous flow of data first - both for analysis purpose and to create a cool waveform on the computer screen :).

No comments:

Post a Comment

Is low level programming still relevant these days?

The levels of abstraction have made the application programming much easier and faster. But everything comes at a price. This is a new ...