Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20638

BASCOM-AVR : Xmega TcD0 configuration results : REPLY

$
0
0
JC, Thanks for the reply. Been reading the datasheet and APP Note #192 by MAK3. A lot of information to digest! What a powerful chip for $10. :) AVR1003 indicates that the clocks are 1%. With that said I am within spec. Not satisfied though. So I am pushing onward for a tighter solution. As far as the counts are concerned, they are off by more than one than you noted. All of my tests are showing that the overflow is occurring BEFORE the desired time. This would indicate that the internal osc is running faster. I will look into how to route the 32mhz internal osc to a pin and measure. I did change [code:1:8540c726b9] Config TcD0 = Normal , Prescale = 1 'for 1mS interval TcD0_per = 32000 '32MHz/1 = 32MHZ(31.25nS) for 1mS = 985uS actual read [/code:1:8540c726b9] With that setting I got to with in 15uS. With is not that bad but considering the tick is 31.25nS...alot of ticks off. Suspect is the main osc at this point. MAK3 makes reference to calibrating the DFLL via [code:1:8540c726b9] Osc_dfllctrl = &B00000000 'The internal 32.768 KHz Osc is used for calibration Set Dfllrc32m_ctrl.0 'Enable DFLL and autocalibration [/code:1:8540c726b9] Not much more said...Do you leave it on all the time? So it always is calibrating to within 1%? Manually calibrate see next paragraph. Not sure why you can't play with the calibration register and tune the osc to be perfect, Not 1%, but VERY close to desired target. Like other calibrated circuits that compensate for offset and gain, etc. I might try to read then inc/dec the values and see what the internal 32mhz osc does. This should have the same effect as if you had a variable cap. Been wrong before though. :) I am in a calibration lab and have access to all the standards. Temperature and humidity controlled. Over kill...probably but need / want to have an accurate timebase. I do understand the oven controlled xtals. Would like to see how stable the device is over time / temp when nulled out. Other method that I haven't figured out how to route yet, is to use the RTC with the external xtal on the Xplained board and generate on overflow interrupt on that at a 1mS or 10mS interval. Don't want to configure clock as I want a finer resolution than 1second for the INTR. I am updating a benchmark study that I did about a year ago, added to Glen's work that he did back in 2009. I added raw reads/writes to app and benchmarked AVR-DOS on the ATmega128. Now would like to move to the Xmega on the Xplained and perform the same tests. Guessing 1-2 second megareads. Thanks for the tips! Mark

Viewing all articles
Browse latest Browse all 20638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>