Go Down

Topic: Newbie here, hoping for some help with a standalone ATMEGA328. (Read 838 times) previous topic - next topic

kidkoopa

Hey everyone, I've done some Arduino programming in the past and am excited to work on some basic projects while I have some free time. I wanted to make some of my own breadboard Arduinos but I'm having some issues. I've looked at previous posts, but I'm still unsure as to what I'm doing wrong.
My current setup is following that of the one here: http://arduino.cc/en/Main/Standalone , however, I'm unable to get mine to blink. I've set up my circuit as shown in the pictures on the site, and have all the components in place. The blink sketch uploads and works perfectly in my Uno; however, I as soon as I pop it into the breadboard, it's unresponsive. I haven't been as careful as I should have been with handling the pins( I know static discharge will screw me over) but it works perfectly in the Uno. Any explanations or suggestions as to what I can do?

In case someone asks, I've done this:
Pin 1 - Reset/ switch
Pins 7, 20, 21 - 5v rails
Pins 8, 22 - GND rails
Pins 9, 10 - 16 MHz Crystal w/ 22pF caps on both ends leading to GND


I've remembered to extend my rails on my long breadboard, and I've tested all of my LED's directions and connections. I've also tested my voltages on the rails, and am getting a solid 4.98V, so I don't think that's the problem.

Thank you to anyone who is willing to spend the time to help me out.

Caltoa

Please don't connect Aref (ATmega328 pin 21) to 5V. Leave that pin not connected.
I know it is in the tutorial, but it is wrong.

This is very useful: http://arduino.cc/en/Hacking/PinMapping

Is a led and resistors connected, for example to Arduino pin 13 (ATmega328 pin 19).
Did you write a bootloader into it ? Do you upload the blink sketch via the serial port, or with a programmer ?

kidkoopa

Alright, I've removed the connection to the Aref, but still no dice.
I actually ordered mine pre-bootloaded, but I popped it into my Uno and programmed it with the IDE, then took it out and placed it back into my breadboard. The LED and resistor are connected to pin 19, yes.


baselsw

Put a 10K resistor between VCC and reset and try again..

kidkoopa

This is what I've got for my setup. Your suggestion was great baselsw, ot got me blinking! Thank you! Could you possibly explain why that works and if I have to continue doing that every time i make a standalone?

Paul__B

These devices are CMOS logic.  The input impedance is very high - hundreds of megohms.  If unconnected (and not programmed to have an internal pull-up), the logic level floats randomly.

If you have a random voltage on the reset pin, it will randomly hold the chip in reset or indeed, randomly revert to reset as your program tries to execute.  You need to pull it high - in all cases - to prevent this.

The Uno of course, contains such a resistor.

In any final design, it is sensible to set the pull-up

Code: [Select]
digitalWrite(pin, HIGH);

... on any I/O pin you do not propose to connect.


alnath

yes but, AFAIK, the RESET pin has no associated pin number, and I'm almost sure it has no internal pull-up resistor. Then a 10k external resistor is required.

@kidkoopa the atmega328 datasheet shows the reset logic (P.47) and a lot of useful informations, some parts are really worth reading thoroughly. And you can also have a look at the Uno schematic http://arduino.cc/en/Main/ArduinoBoardUno as an example  :)

fungus


yes but, AFAIK, the RESET pin has no associated pin number, and I'm almost sure it has no internal pull-up resistor.


Yes it does....see figure 10.1 in the datasheet.

The section "DC Characteristics" of the datasheet says it's between 30 and 60 kOhms.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Caltoa

Paul__B, the internal pullup resistor is these days set with this:
Code: [Select]

pinMode(pin, INPUT_PULLUP);

http://arduino.cc/en/Reference/pinMode

dc42

Missing from your design is a 0.1uF ceramic capacitor between Vcc and ground. Place it close to the chip (i.e. over the top of the chip), not on the breadboard power rails.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Paul__B


Paul__B, the internal pullup resistor is these days set with this:
Code: [Select]

pinMode(pin, INPUT_PULLUP);

http://arduino.cc/en/Reference/pinMode


Not doubting you, but is it functionally different?

Caltoa


... is it functionally different?


The function is that it is easier to understand for new Arduino users. That makes it very functional, if you ask me  ;)

Go Up