Oscillator for arduino standalone

Hey,

i want to implement an arduino standalone application with an ATmega 328 (So arduino UNO). I bought all the parts I need, but i accidently ordered a 4-pin Oscillator (IQXO-22 C). Is there a possibilty that I can run my arduino with this oscillator??

Thanks in advance

Tobias

Probably, the fuses will need to be set for an external oscillator. I'm having trouble finding that part number, do you have a link?

Hey
this is the link to the datasheet
www?.farnell.com/datasheets/79703.pdf

lg tobi

Looks pretty standard, it should work. Did you get 16MHz?

i got the 16mhz version how do i connect the pibs?? i can find only information about 2pin oscillators.

lg tobi

The pins are numbered 1,4,5,8. 1 is No connect 4 is Gnd. 5 is the output to the '328 8 is power.

Connect 5 to '328 pin XTAL1

Connect it as the datasheet shows, pin 8 to +5V, pin 4 to ground, pin 5 to the XTAL1 pin on the ATmega328P (PB6, DIP pin 9). Put a 100nF ceramic capacitor from pin 8 on the oscillator to ground. Program the MCU's low fuse byte to 0xE0.

The pinout of the clock module is right there on the first page of the datasheet you gave.

  1. N/C or Enable/Disable.
  2. GND
  3. Output
  4. +Vs

To find information on this, I used "external clock atmega328".

http://www.atmel.com/images/doc7810.pdf

Look on page 26 under "8.2 Clock Sources" for configuration of CKSEL and then page 33 under "8.8 External Clock" for hookup info. Basically, CKSEL is set to 0000, XTAL2 is NC, and XTAL1 is connected to the external clock source. -- corrected as per dc42 --

Looking back to page 2, pin 6 is XTAL1 and pin 7 is XTAL2.

ok thsnk you

so with out changing the fuses, i cannot you this part??

No - but changing fuses is just a matter of changing one line in the boards.txt file. Jack provided the value earlier.

ok i think i should read more about it i have no clue how to change that file...

You can use a Uno to program the fuses of a standalone chip:

http://www.gammon.com.au/forum/?id=11638

Here is a fuse calculator:

http://www.engbedded.com/fusecalc

I edit boards.txt and other Arduino/C related files with notepad++, a free program editor.

http://notepad-plus-plus.org/download/v6.5.html

All my coding is done in the IDE.

For a bare chip you’ll always need to set the fuses when using an external crystal. New chips are always shipped with fuses set for the internal oscillator.

OK, do i get this right?

I change in the boards.txt just the value of my high, low and extend fuses to my desired values, then i upload my program to the atmega and everything should work well .

LG tobi

The fuses are only set when you program the bootloader, not upload a sketch.

Did you buy an atmega328p chip with the bootloader already installed? If so, you should be able to use it without changing the fuses, by feeding the clock signal to pin XTAL1. Likewise, if the chip you have doesn't already have the bootloader installed, then you can burn the bootloader with the standard fuse settings.

btw I believe polymorph's post is incorrect. The diagram on my copy of the datasheet shows that the external clock should be fed to pin XTAL1, not XTAL2.

dc42 is correct, I can only plead that I was misled by the datasheet having XTAL2 above XTAL1. I have corrected my post on the subject in case of future readers of this topic.

Wait wait...

Unless this thread advanced further enough..

You said it's a 4 pin crystal... which means 1 is a clock pin? and the other pin is the inverted clock? (and negative/positive 2 pins power) the Atmega requires a standard 2 pin crystal of 16mhz or 20mhz , along with a couple something in the region of 22-38 or so pf... it's a Gate Oscillator circuit..

How exactly would you convert that 1 pin/pulse frequency to adapt to work with a gate oscillator?

Thinking about it, if the 2 pins are simply clock and the inverted (not) clock signal, then you could apply them or even tie, i have no clue..

it just sounds like this can't work to me...

Did you read replies 5 & 7 that have the Oscillator pinout? You set the fuses to use its full swing (0-5V) output.