Author Topic: ATTINY841 with a TCXO  (Read 5159 times)

0 Members and 1 Guest are viewing this topic.

Offline Dragon88Topic starter

  • Regular Contributor
  • *
  • Posts: 88
ATTINY841 with a TCXO
« on: June 13, 2015, 11:56:43 pm »
Several months ago I picked up some ATTINY841s. It's a very capable chip considering the tiny size and price. Despite poor documentation at the time (hasn't gotten much better since) I was able to get them programmed with avrdude, but I didn't end up using them for anything serious.

I decided to revisit the chip for a project I am working on. I have some stiff requirements for my timing, so I wanted something better and more stable than the internal oscillator or a regular crystal. I found some reasonably priced 16MHz TCXOs on Digikey and decided to build a little breakout board for the chip to use them. The board looks quite nice I think (below). I hid all of the passives on the underside so it's clean and compact. I will transplant this layout directly into a larger project now that I have tested it.

Most importantly, performance (of this one sample) of the TCXO I used is outstanding. Reading the clock frequency from PB2 shows that it is less than 0.5 PPM out. (The part is rated +/-2.5PPM stability though, and +/-1.5ppm initial. Still quite good) About 6 Hz out at 16 MHz and very stable. A half hour in the fridge caused no noticeable change. I'm satisfied, and this will work great in my project.

EDIT: I removed the part about my Hello World sketch, because some people have such a visceral reaction to certain items of code. ;)

I highly recommend trying a TCXO some time with your microcontroller project.
« Last Edit: June 17, 2015, 01:30:59 am by Dragon88 »
 

Offline oilburner

  • Contributor
  • Posts: 42
Re: ATTINY841 with a TCXO
« Reply #1 on: June 14, 2015, 01:46:35 am »
Nice!  Thanks for the tip :-+   What TCXO caught your eye on Digikey?  That is  some good numbers, both in and out of the 'fridge.  How did you check, with GPS?
 

Offline con-f-use

  • Supporter
  • ****
  • Posts: 807
  • Country: at
Re: ATTINY841 with a TCXO
« Reply #2 on: June 14, 2015, 08:15:37 am »
I'm also interested in the oscillator you used...

Despite poor documentation at the time (hasn't gotten much better since) I was able to get them programmed with avrdude, but I didn't end up using them for anything serious.
Seriously? I mean the data sheet isn't great, but I've seen a lot worse. It's good average.
 

Offline Dragon88Topic starter

  • Regular Contributor
  • *
  • Posts: 88
Re: ATTINY841 with a TCXO
« Reply #3 on: June 14, 2015, 11:55:16 am »
This is the oscillator:
http://www.digikey.com/product-detail/en/FOX924B-16.000/631-1071-1-ND/1024776

All measurements made with a calibrated HP 5334B, spot checked against my GPSDOs.

Seriously? I mean the data sheet isn't great, but I've seen a lot worse. It's good average.

The data sheet it fine, but other community support is still lacking, and that limits accessibility of the chip to general hobbyists.
 

Offline con-f-use

  • Supporter
  • ****
  • Posts: 807
  • Country: at
Re: ATTINY841 with a TCXO
« Reply #4 on: June 14, 2015, 12:42:22 pm »
Thank you! Its remarkable how much cheaper digikey is for this part when compared to mouser. Over all quantities less than halve the price.

Well it's the same architecture as the ATMegaXX8 that is used in the Arduinos and MIT has written a tutoral on howto use the Arduino IDE with ATTiny-uC. You basically can't get any more community support than that.
« Last Edit: June 14, 2015, 12:49:27 pm by con-f-use »
 

Offline Moondeck

  • Regular Contributor
  • *
  • Posts: 142
  • Country: dk
  • i really like compilers
Re: ATTINY841 with a TCXO
« Reply #5 on: June 15, 2015, 07:41:15 am »
The data sheet it fine, but other community support is still lacking, and that limits accessibility of the chip to general hobbyists.
How does lack of community limit accessibility  :wtf:  :bullshit:
I'm selling 100ml bottles of free energy, PM me for pricing.
 

Offline Dragon88Topic starter

  • Regular Contributor
  • *
  • Posts: 88
Re: ATTINY841 with a TCXO
« Reply #6 on: June 15, 2015, 10:51:22 pm »
Probably because it's wrong  ;)

No, it's not.

The frequency of the output was measured externally using a counter, and the resolution I stated above is correct. If I had stated more resolution, then the execution time of the other instructions in the loop would have become an issue.
« Last Edit: June 15, 2015, 10:59:47 pm by Dragon88 »
 

Online Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: ATTINY841 with a TCXO
« Reply #7 on: June 16, 2015, 07:11:53 pm »
Heh, you can achieve 10ppm accuracy with almost any bog standard quartz crystal. You don't need to shell out for a TCXO to do that. ::)
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline Dragon88Topic starter

  • Regular Contributor
  • *
  • Posts: 88
Re: ATTINY841 with a TCXO
« Reply #8 on: June 16, 2015, 10:09:10 pm »
Heh, you can achieve 10ppm accuracy with almost any bog standard quartz crystal. You don't need to shell out for a TCXO to do that. ::)
I don't have 10ppm accuracy in my clock signal. Try re-reading the original post.
 

Online Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: ATTINY841 with a TCXO
« Reply #9 on: June 16, 2015, 11:54:19 pm »
You're measuring your 1Hz signal with 10ppm resolution and saying it's bang on.

The frequency of the output was measured externally using a counter, and the resolution I stated above is correct. If I had stated more resolution, then the execution time of the other instructions in the loop would have become an issue.
Based on this statement, I would assume the lower digits were not bang on anymore, so you decided to limit the number of digits.

You know, writing good code that actually uses the internal counters for the clock division isn't that bloody difficult.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline Dragon88Topic starter

  • Regular Contributor
  • *
  • Posts: 88
Re: ATTINY841 with a TCXO
« Reply #10 on: June 17, 2015, 12:42:05 am »
No, I am using a 9 digit counter. I also have a 12 digit counter which verified the measurement. There was an additional zero I left off, because I intentionally avoided overstating performance of this part. The TCXOs I purchased have a claimed initial frequency accuracy of +/- 2.5ppm, so even though my one sample performed much better, I would not claim that applies across the board for this part.

I could have stated 1.0000001 Hz for this measurement and been well within the capabilities of my equipment and their calibration.

I would also never claim that a 1 ms delay plus additional instruction executions is still exactly 1ms. Thus I used the resolutions I used.

And it is correct that better code than the delay_ms routine is required for precise timing. Once again, if you re-read the original post, you will see I stated this was a hello world sketch uploaded to the device. No where did I say that I intended to use that in the project, as the requirements are much more stringent than a generic hello world.

Also, I would love to see your measurement data to support the claim that bog standard 50-100 ppm crystals are actually 10 ppm.  :-+
 

Offline Dragon88Topic starter

  • Regular Contributor
  • *
  • Posts: 88
Re: ATTINY841 with a TCXO
« Reply #11 on: June 17, 2015, 01:29:26 am »
Ah, stability is 2.5ppm, initial tolerance is 1.5ppm.

I edited out the part about my hello world sketch in the initial post. Since some people have such a negative reaction to delay_ms.  :) But please continue to make assumptions about my intelligence based on that.  :) I also tried to clarify that the measurement is on this one part only. I'll have to test more to see how well they perform beyond the one sample.
 

Offline jwm_

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
    • Not A Number
Re: ATTINY841 with a TCXO
« Reply #12 on: June 17, 2015, 02:40:40 am »
Nice.  Roman's algorithm can be pretty easily adapted to the attiny and you have a pretty nice arbitrary frequency synthesizer
http://www.romanblack.com/one_sec.htm

I wrote a variant that can do arbitrary rational periods on the same timer for the attiny, so you can have  OSC0A be 3/2 Hz and OSC0B be 1/7Hz and they will be an actual perfect 3 cycles every 2 seconds and one cycle every seven seconds. (jitter being determined by your timer rate) Seems like your boards would be a handy thing to pair it with.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf