Stand-alone breadboard not working

Hello all

I recently got my first Arduino Duemilanove to play with, but for my next project, I have to make it working without the Duemilanove.

First, I tried to make a diode flash in a rather low freqency, but that does not work! Note, this works perfectly fine when I move the ATMega back to the duemilanove board again.

Followed 20+ articles from google and this site, but nothing can help me out.

What I have done:

Pin 1 (RESET) through a 10k resistor to Vcc (5 volts) Pin 2 (RX) through 10k to ground (This doesnt make a difference anyways) Pin 7 (Vcc) to Vcc Pin 8 (GND) to Ground Pin 9 & 10 (OSC) to each side of a ceramic resonator (with middle leg to gnd) Pin 13 through 300 ohm and a diode to ground (Duemilanove pin 7) Pin 20 & 21 (AD) to Vcc (Even though A/D will not be used) Pin 22 (GND) to Ground.

After wiring this up, following program was put on the ATMega:

int ledPin =  7;    // LED connected to digital pin 13

void setup()   {                
  // initialize the digital pin as an output:
  pinMode(ledPin, OUTPUT);     
}

void loop() {
  digitalWrite(ledPin, HIGH);
  delay(500);
  digitalWrite(ledPin, LOW);
  delay(100);
}

As said, this works perfectly on the Duemilanove board, but when I move the ATMega chip to my breadboard, the diode flashes at random frequencies, like there is no timing at all. If I only turn the diode on (another program) it works fine, but there is no timing either. Resonator I use is 16MHz FYI.

Can anyone give me a direction on, what to do now? Im running out of ideas :-(

Thanks, -Allan

Your breadboard circuit is probably wrong. If you need a safe breadboard arduino version look at this:

http://arduinofun.com/blog/2009/10/15/breadboard-arduino/

It sounds like it is the resonator that is not working properly. I notice you don't have any supply decoupling on it. Put a 100nF across the supply as close to the pins as possible. In fact use two, one across pins 7 & 8 and the other across pins 20 & 22.

Pin 13 through 300 ohm and a diode to ground (Duemilanove pin 7)

Duemilanove pin 7 is VCC (power).

So, how do you have the LED wired?The resistor should be from pin 13 (atmega pin 19) to the long led of the LED(light emitting diode), then the short end of the LED, which is Ground, should be to, well, ground! Pin8 on the Atmega or just the ground of your breadboard, assuming that's part of the circuit.

But yeah, you just explained it wrong, I'd have to say Grumpy_Mike is probably right, the crystal isn't working properly. (all though, with a resonator, you shouldn't need decoupling, as they have 2 caps from each pin to the GND)

Here's another example of a breadboard setup: http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard

(all though, with a resonator, you shouldn't need decoupling, as they have 2 caps from each pin to the GND)

The caps on a crystal are not decoupling caps but loading caps. Decoupling is needed irrespective of if you are using a crystal or a resonator.

Pin 13 through 300 ohm and a diode to ground (Duemilanove pin 7)

Will actually work even though pin 7 is Vcc not ground. providing the LED is the correct way round it will work by sinking the current rather than sourcing it.

Interesting.. I know it's probably not "right" then, but I've used a resonator without the extra caps numerous times.. never noticed an issue, works with all the sketches I've tried.

And I thought that VCC would be "sourcing" since it's the higher potential, seeing as the voltage after the resistor for the led would be like 3.X volts wouldn't it? (I've only read some comments.. so it's more of a question than a statement! I have no formal education:D)

But regardless, that's not a way to learn how to hook leds up!:D

I know it's probably not "right" then, but I've used a resonator without the extra caps numerous times.. never noticed an issue, works with all the sketches I've tried.

Actually it is "right". A 3 pin ceramic resonator has loading caps built into it's package, so one just needs to ground the center pin and the other two pins wire to the processors oscillator pins. Two terminal quartz crystals require external loading caps but 3 terminal ceramic resonators do not.

Lefty

I learn something new everyday! :D I went from using the Resonators to using the Crystals (20 crystals for $8, can't say no lol)

I think I need to research a little bit more on the "loading" and "decoupling" I thought I had the jidst of decoupling, I think I thought wrong!:)

"loading" and "decoupling"

Capacitors can peform many different functions in a given circuit. Terms like, decoupling, loading, filtering, L/C, timing, signal coupling, etc are what any given capacitor is doing in a specific circuit. To understand the specific circuit is to understand what and why the individual components are being used.

So you really can’t learn all about the uses of caps without learning about the various circuits they are used in.
Lefty

What kind of breadboard? I've heard that the solderless kind can give all kinds of troubles at higher frequencies. Also be sure the resonator is as close as possible to the micro.

--Rich

I've heard that the solderless kind can give all kinds of troubles at higher frequencies.

Yes, for RF circuitry at VHF frequencies and above they probably suck, but for Arduino stuff at under 16mhz they seem to work fine.

Lefty