Go Down

Topic: Quartz crystal (Read 1 time) previous topic - next topic

Arduino99

Is a quartz crystal required for the Atmel Atmega328 for it to work when its not in the arduino?

CrossRoads

If it was programmed & running as a standard Arduino board, yes.
16 MHz crystal, 22pf caps, 100nF caps, 10K pullup resistor, can be purchased quite inexpensively from
www.dipmicro.com and www.taydaelectronics.com.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Arduino99

im not doing an arduino breadboard im doing a project that doesn't want to work all the pins are soldered to the right places(using headers of course) but when i give power to the atmel atmega 328 nothing happens just a blank LCD.
Do i still need all the component's you listed for it to work or just the crystal?

CrossRoads

Some will claim it will work fine with less than what I listed - I have Never had a board not reliaby work when it had that minimal set of parts installed.
My Arduino project designs start from this, and I add more parts as needed.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

dhenry

Quote
Is a quartz crystal required for the Atmel Atmega328 for it to work when its not in the arduino?


No.

dhenry

Quote
Do i still need all the component's you listed for it to work or just the crystal?


The minimum part to get a mcu to work is the mcu itself.

CrossRoads

dhenry,
Can you explain the process for Arduino99 for re-burning the fuses for '328 operation without an external crystal once the uC has been removed from the Arduino board?  I know many do it with avrdude commands, I've not had luck with that myself.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

billroy

While it is true that a crystal is not required, the '328p must be correctly configured using what is known as the 'fuse bits' to operate without a crystal.   When you do that, there are several choices for which internal oscillator speed to use.  All of this has to line up with the build settings or you get clocks running at the wrong rate, if they run at all.  None of it is setup for what you want to do "out of the box" on a raw '328p, sorry to say.

If you put a '328p that is fuse-configured to expect a crystal oscillator into a breadboard that doesn't have one, it won't work because it isn't getting the clock it expects.  This is one possible explanation for your system appearing dead.

It would be helpful to know where you got the '328, whether it has a bootloader on it and what the fuse settings are.  Do you have an Arduino board or an AVR programmer to set fuses with?

Also, have you checked the voltages at the +VCC and GND pins on the '328p with a voltmeter (or even an LED) to make sure they're about right?

Finally, it makes sense to put at least a 10uF electrolytic decoupling capacitor on the power input to the arduino.  It may run without it, but will die at the first glitch, leaving you wondering what happened.  Bad practice.


-br

dhenry

Quote
just a blank LCD.


There could be many other reasons why that's the case.

The simplest test to see if your mcu is working (or if you can burn a piece of code into the mcu) is to flip pins.


Arduino99


While it is true that a crystal is not required, the '328p must be correctly configured using what is known as the 'fuse bits' to operate without a crystal.   When you do that, there are several choices for which internal oscillator speed to use.  All of this has to line up with the build settings or you get clocks running at the wrong rate, if they run at all.  None of it is setup for what you want to do "out of the box" on a raw '328p, sorry to say.

If you put a '328p that is fuse-configured to expect a crystal oscillator into a breadboard that doesn't have one, it won't work because it isn't getting the clock it expects.  This is one possible explanation for your system appearing dead.

It would be helpful to know where you got the '328, whether it has a bootloader on it and what the fuse settings are.  Do you have an Arduino board or an AVR programmer to set fuses with?

Also, have you checked the voltages at the +VCC and GND pins on the '328p with a voltmeter (or even an LED) to make sure they're about right?

Finally, it makes sense to put at least a 10uF electrolytic decoupling capacitor on the power input to the arduino.  It may run without it, but will die at the first glitch, leaving you wondering what happened.  Bad practice.


-br


Its from the arduino uno it does have bootloader burned onto it

billroy

If it's from a commercial Arduino, it's fused to expect a crystal.  You'll need a crystal and two decoupling caps to get it running as fused, or you could re-fuse it to run without.

Cheers,

-br

CrossRoads

So, back to reply #3 then.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Arduino99

I have acquired and installed a quartz crystal and now the lcd screen flashes violently how do i fix this?

CrossRoads

Violently? That's a new one on me. Does anything else work normally? Like a message sent to the serial monitor?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Arduino99

Never mind It was the battery it was flat lol

Go Up