Pages: [1]   Go Down
Author Topic: Newbie here, hoping for some help with a standalone ATMEGA328.  (Read 571 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Edison Member
*
Karma: 36
Posts: 1199
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 14
Posts: 574
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what about a photo ?
Logged

Sweden
Offline Offline
Sr. Member
****
Karma: 11
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?


* IMG_20130918_110559.jpg (625.38 KB, 1920x1631 - viewed 19 times.)
Logged

NSW Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 2293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
digitalWrite(pin, HIGH);

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

Logged

Offline Offline
God Member
*****
Karma: 14
Posts: 574
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4536
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No, I don't answer questions sent in private messages...

Offline Offline
Edison Member
*
Karma: 36
Posts: 1199
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Paul__B, the internal pullup resistor is these days set with this:
Code:
pinMode(pin, INPUT_PULLUP);
http://arduino.cc/en/Reference/pinMode
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

NSW Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 2293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Paul__B, the internal pullup resistor is these days set with this:
Code:
pinMode(pin, INPUT_PULLUP);
http://arduino.cc/en/Reference/pinMode

Not doubting you, but is it functionally different?
Logged

Offline Offline
Edison Member
*
Karma: 36
Posts: 1199
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

... 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  smiley-wink
Logged

Pages: [1]   Go Up
Jump to: