go away spammer

Author Topic: 50$ robot external crystal oscillator  (Read 6819 times)

0 Members and 1 Guest are viewing this topic.

Offline claesson92Topic starter

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
  • EARP.co.nr
    • Project EARP
50$ robot external crystal oscillator
« on: October 29, 2007, 10:17:32 AM »
Hi, if it doesn't cost to much. I'm planning to buy an external crystal oscillator for my ATmega168 (for the 50$ robot). Where/How should i connect it. And wich type of external crystal oscillator can i use? How many Mhz? Anything else?
Why solder? Let's just glue it all together!
Free Samples, anyone? http://www.societyofrobots.com/robotforum/index.php?topic=2197.0
My Project: http://earp.co.nr/

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: 50$ robot external crystal oscillator
« Reply #1 on: October 29, 2007, 11:21:57 AM »
its a bit tricky at first . . .
http://www.societyofrobots.com/robotforum/index.php?topic=595.0

Double check me on this, but I think you can get a 20Mhz crystal for the ATmega8.

Then go to mouser.com and look up the datasheet of the crystal and it will tell you what capacitor values to get. Chances are it will be 22pF ceramic.

Then hook it all up like you see on the left side of this schematic:


(note that this schematic is for a different AVR)

Note that you will have to change the servo timing in my $50 robot code.

Offline Killtacularmods

  • Jr. Member
  • **
  • Posts: 28
  • Helpful? 0
Re: 50$ robot external crystal oscillator
« Reply #2 on: October 30, 2007, 06:09:14 PM »
OK, here is another diagram, its a lttile more easy to understand. Note: crystal diagram is shown for the ATMEGA8 but as you can see from the ATMEGA168 pin out, they have the same pin outs. From what iv read your supposed to use 4mhz crystal with 2 22pF decoupling capacitors.
« Last Edit: October 30, 2007, 06:11:14 PM by Killtacularmods »

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 335
  • Helpful? 3
Re: 50$ robot external crystal oscillator
« Reply #3 on: October 30, 2007, 06:19:04 PM »
If you're running at 5 V, the mega168 can support up to a 20 MHz external oscillator.

From the front page of the mega168 datasheet:
Quote
Speed Grade:
- ATmega48/88/168: 0 - 10 MHz @ 2.7 - 5.5V, 0 - 20 MHz @ 4.5 - 5.5 V

Offline bukowski

  • Robot Overlord
  • ****
  • Posts: 219
  • Helpful? 0
Re: 50$ robot external crystal oscillator
« Reply #4 on: November 16, 2007, 10:49:34 AM »
Unrelated noob question (sorry to interrupt):

Admin, on your schematic you have pin one reset connected to the VCC, making it normally high, and going to the reset pin on the programmer header.

Killtacularmods has it going just to the reset pin on the programmer header, making it normally low (?).

Im making the $50 robot, should I connect pin 1 to the regulated power or not?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: 50$ robot external crystal oscillator
« Reply #5 on: November 16, 2007, 11:07:50 AM »
That above schematic isn't mine, found it on the web . . .

So for the $50 robot, just use the schematic on my tutorial and you will be fine. I've had no problems with the way I did it . . . nor on the ATmega644 either . . .

I haven't read the datasheet about the reset pin, but have a look if you want more info . . . I'm definitely not an expert on it . . .

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 335
  • Helpful? 3
Re: 50$ robot external crystal oscillator
« Reply #6 on: November 16, 2007, 12:18:48 PM »
From the mega168/mega644 datasheets, it looks like the reset pin has an internal pullup resistor, meaning that you'd be ok leaving the pin connected to nothing but the programming header.

Offline bukowski

  • Robot Overlord
  • ****
  • Posts: 219
  • Helpful? 0
Re: 50$ robot external crystal oscillator
« Reply #7 on: November 16, 2007, 12:25:52 PM »
OK, Thanks!

Offline hazardousracerx

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: 50$ robot external crystal oscillator
« Reply #8 on: April 11, 2009, 01:32:08 PM »
Im adding an external oscillator to my "$50" Robot... actually so far it has cost about $130 but I am taking the Admin's advice and buying good quality parts because I am planing on this being more than just a hobby at some point.   Anyway beside the point... I found the datasheet for the oscillator I bought and don't know If I am reading it correctly.  It says

"Load Capacitance (CL)   |   10 pF ~ Series (Customer Specified)"

I am taking that to mean that I need 2-10 pf caps or does that mean that the total capacitance for the portion of the circuit involving the oscillator should be 10 pF (2-5pF caps), if i use the 2nd schematic above?  Also linking the actual PDF datasheet so all info is available.  PDF attached in case link is invalid for som reason.


http://www.foxonline.com/pdfs/hc49slf.pdf

I have the FOXSLF/200-20  model of Oscillator.

Other than that I would just like to say that the $50 Robot Tutorial is a great guide for beginners.  Im not new to electronics, I'm an electronics tech for the US Army, but I am new to robotics even though I have been interested in them for as long as I can remember.  It has really helped me get started with my first robot and it definitely will not be my last.  Thanks.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: 50$ robot external crystal oscillator
« Reply #9 on: April 12, 2009, 09:43:45 PM »
Hi,

Please don't wake up that old threads, start a new one instead.

What you have is an X-tal, not an oscillator, which is a complete device with X-tal, oscillator and buffer in the same 4-pin module, outputting TTL-like clean pulses.

You should allways go with the lowest value caps that gives you a 100% stable startup of the oscillator (to get it as precise as possible) and since your PCB will have some capacitance, you need to find it empirically.
Usually you'll end up with between 12pF and 22pF.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline hazardousracerx

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: 50$ robot external crystal oscillator
« Reply #10 on: April 13, 2009, 12:46:54 AM »
Sorry for waking up an old thread.  In other forums that I have been on, people get "flamed" for starting new threads when there are already threads pertaining to the question that is being asked.

I only have a crystal oscillator.  Its only a 2 pin module, and unless X-tals are really cheap (< $0.53 ea.) its probably not an X-tal.  I am going to o with the 2-22pF caps according to the 2nd schematic above.  I found references to that using different brands of crystals and it seems to be what the ATmega168 uses.

Thanks.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: 50$ robot external crystal oscillator
« Reply #11 on: April 13, 2009, 07:46:30 AM »
Hi,


No, you have an X-tal (crystal), which is a thin slice of quartz crystal suspended between two electrodes/holders.

An X-tal oscillator is a unit containing both an X-tal, an oscillator circuit and an output buffer.

Here is what an oscillator look like:


Found at:
http://www.wellgainelectronics.com/index.asp?PageAction=VIEWPROD&ProdID=6182


I know that discrete X-tals are often called oscillators but that's incorrect, as they have no means to oscillate without further circuitry.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here