asebocourse.blogg.se

Read adc from xmega codevision
Read adc from xmega codevision







read adc from xmega codevision
  1. #Read adc from xmega codevision generator
  2. #Read adc from xmega codevision software
  3. #Read adc from xmega codevision code

My rationale for this is that I am interested in being able to observe the waveform well, and that I should be able to see this while the waveform is well oversampled. Continue increasing the frequency until things started looking weird. Is there another waveform or test that I could use that would be sensible? The most explicit way I could think of to test the system was with an externally applied sinusoid. My issue at this point is that I think I have way to many variables in here. However, if I fed in only a sinusoid signal from my signal generator, aliasing (other than noise) shouldn't be too big a factor? I agree that there is definitely the possibility of aliased noise.

#Read adc from xmega codevision software

Whoops! The x scale is incorrect! The plots that I have been doing have a bug on the software side. However, for all I know, I could have the peripheral clock wrong. Read sample, set flag for main loop to handleĪdcSample = ADC_ResultCh_GetWord_Signed(&ADCA.CH0, offset) Īny insights here? I don't think my issue is the number of samples required, but rather that the XMega ADC is failing to get that many. ADC Interrupt Service Routine for channel 0 *There is more to setting up the ADC, but this is the critical line*/ĪDC_Prescaler_Config(&ADCA,ADC_PRESCALER_DIV64_gc) Enable external 16 MHz crystal with medium startup time (1KCLK), then wait till it's stableĬLKSYS_XOSC_Config( OSC_FRQRANGE_12TO16_gc,ĭo while ( CLKSYS_IsReady( OSC_PLLRDY_bm ) = 0 ) ĬLKSYS_Main_ClockSource_Select( CLK_SCLKSEL_PLL_gc )

#Read adc from xmega codevision code

Just in case, I have re-printed the key portions of this code below: I know that #2 is true, but I don't know to what extent.įor #1, the code that I used is the code from the AVR app notes for the ADC and clocking system. Right now, I am looking at two major ideas as to what the problem might be: (I confirmed that the slew rate and other parameters did not affect the waveform.) This should buffer the signal, and provide low output impedance for the ADC. To null this concern, I placed an opamp running as a voltage follower.

#Read adc from xmega codevision generator

I thought the problem might be the output impedance of the waveform generator I was using.

read adc from xmega codevision

This, as you can easily tell, did not work well at all. I also tried the 1 KHz signal with the 2MSPS option. The above is a 20 KHz sinusoid with the ADC running at 500 KSPS. The above is a 1 KHz sinusoid with the ADC running at 500 KSPS.

read adc from xmega codevision

To better verify this, I performed the same test, but instead I tried waveforms that should be clearly visible and very much oversampled. I believe that the XMega ADC is *not* performing correctly.









Read adc from xmega codevision