Pages: [1] 2   Go Down
Author Topic: Stand-Alone Arduino Help  (Read 1731 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone! This is my first topic here, so I am not sure if I am doing this correctly. But I want to ask 2 questions:

I already have 2 arduino, 1 Uno (Rev3 I gess) and a Arduino Nano V3.0 but I'm thinking about going to Stand-alone Arduino. And I have searched and found some things, but I am not sure if I get it correctly. I have seen this (http://arduino.cc/en/Tutorial/ArduinoToBreadboard) and I'm interessted in the Minimal Configuration Part. Can I connect the ATmega328 without any other component and program it like that (preferable using another arduino as ISP and a Bootloader Burner)? And to power the chip, can I use an Power Adapter with these caracteristics (Input: Ac 110V -240V 50160HZ; Output: DC 5V±0.2V DC 500mA±30mA) without a voltage regulator or is better another thing?

By the way, what I want to do in the end is to use a NRF24L01 2.4GHz Wireless Transceiver Module to talk between different boards to controll some lights, push buttons and motors. Can be done with that? (I gess after all this was 3 quesitons smiley)

Thank you in advance for your time and sorry for any mistake, english in not my native language.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8646
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

> Can I connect the ATmega328 without any other component and program it like that (preferable using another arduino as ISP and a Bootloader Burner)?

Yes.  Just like it shows on that page.

> And to power the chip, can I use an Power Adapter with these caracteristics (Input: Ac 110V -240V 50160HZ; Output: DC 5V±0.2V DC 500mA±30mA) without a voltage regulator or is better another thing?

Yes, the ATmega328P will run on 5V ±0.2V DC and 470 mA should be enough for most purposes.

I have not yet used the nRF24L01 modules for anything so I can't help with your third question.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Can I connect the ATmega328 without any other component and program it like that (preferable using another arduino as ISP and a Bootloader Burner)?

Yes.

Quote
And to power the chip, can I use an Power Adapter with these caracteristics (Input: Ac 110V -240V 50160HZ; Output: DC 5V±0.2V DC 500mA±30mA) without a voltage regulator or is better another thing?

Yes. The thing to watch out for is that many of the ac adapters output higher than they are specified so you may want to watch out for that.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33265
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Output: DC 5V±0.2V DC 500mA±30mA)
That sort of implies that the voltage is only 5V at the one current output. Check it does not go too high with a lower load current.
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As already said, just ensure that it is a regulated power supply and not an unregulated one, or you could exceeee the 6v maximum for the standalone chip, and possibly have issues with any measurements taken on the analogue pins as Vcc changes.

As for the nRF24L01, they will do what you want very nicely and inexpensively. One thing you MUST ensure though, is that you are using the nRF24L01+. That + is a big factor as the non + will not tolerate 5v power. The non + require 3.3v for power. The + model can take 5v.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
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

Can I connect the ATmega328 without any other component...

You need at least a 0.1uF ceramic capacitor conected between the Vcc and Gnd pins.

...and program it like that (preferable using another arduino as ISP and a Bootloader Burner)?

Yes, but you don't need a bootloader if you are programming the chip via ICSP.

As for the nRF24L01, they will do what you want very nicely and inexpensively. One thing you MUST ensure though, is that you are using the nRF24L01+. That + is a big factor as the non + will not tolerate 5v power. The non + require 3.3v for power. The + model can take 5v.

Alternatively, why not run the atmega328p at 3.3V instead of 5V?
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.

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The first question was about running from a 5v power supply that the OP has already, and 16Mhz @ 3.3v would be overclocking. Not everyone is comfortable with running out of spec as it could be at the cost of stability at a later date.

He could also use a 3.3 VR but, tbh, most of the nRF modules are the plus now even if they are not described as such.
« Last Edit: December 16, 2012, 07:51:20 am by tack » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
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

The first question was about running from a 5v power supply that the OP has already, and 16Mhz @ 3.3v would be overclocking. Not everyone is comfortable with running out of spec as it could be at the cost of stability at a later date.

It was also about running with no external components. So he must be using the internal oscillator, which means he's running at about 8MHz or less - well within spec @ 3.3V.
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.

Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino Uno R3 loaded with Arduino ISP behaves like an ordinary ISP programmer.
Read this tutorial: http://pdp11.byethost12.com/AVR/ArduinoAsProgrammer.htm

So, yes, with the help of an Arduino Uno you can program most stand alone AVRs with any code you want and without needing a bootloader.
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It was also about running with no external components. So he must be using the internal oscillator, which means he's running at about 8MHz or less - well within spec @ 3.3V.

Well spotted, I missed that bit. :-)

Either way, the plus units will be fine. It's just the non plus that you can fry if 5v is connected to power.

Out of interest myself, what is the consequences of the internal clock and using SPI? The internal isn't very accurate is it, so will that affect timing and speeds available over SPI?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8646
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Out of interest myself, what is the consequences of the internal clock and using SPI? The internal isn't very accurate is it, so will that affect timing and speeds available over SPI?

The SPI speeds are derived from the system clock speed so the choices will all be half the speed of what you would get with a 16 MHz clock.

Since SPI has separate data and clock there isn't the same sensitivity to clock speed that asynchronous serial communication has.  It should work even with wildly varying clock speeds.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

I want to thank everyone for answering me to these questions, I 'm kind of new in this microcontroller things smiley you have motivated me to go through in this project, thank you  smiley
Logged

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

Yes, but you don't need a bootloader if you are programming the chip via ICSP.

I had already thing about that, but I didn't find many things on that programming method and I don't know practically anything about that programming language smiley-sad


Yes, but you don't need a bootloader if you are programming the chip via ICSP.

Alternatively, why not run the atmega328p at 3.3V instead of 5V?

Because I didn't find any 3.3V power source, and I've read somewere (don't remember where exactly) that the ATmega chip must be at 5V to work correctly. It isn't true?


The SPI speeds are derived from the system clock speed so the choices will all be half the speed of what you would get with a 16 MHz clock.

Since SPI has separate data and clock there isn't the same sensitivity to clock speed that asynchronous serial communication has.  It should work even with wildly varying clock speeds.

I knew that running the ATmega without the 16mhz crystal it would be slower, but it also means that the Delay time will be different?
By the way, I have 3 of that crystals, they are really needed, I mean, I should use them or for this specific case I can leave the ATmega without it?


As for the nRF24L01, they will do what you want very nicely and inexpensively. One thing you MUST ensure though, is that you are using the nRF24L01+. That + is a big factor as the non + will not tolerate 5v power. The non + require 3.3v for power. The + model can take 5v.

Mine are the + model by the way smiley when I bought them I didn't notice that. In fact, I thought it was a part of the name, and it doesn't matter for anything x)
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
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

Yes, but you don't need a bootloader if you are programming the chip via ICSP.

I had already thing about that, but I didn't find many things on that programming method and I don't know practically anything about that programming language smiley-sad

Writing the program is the same whether you use a bootloader or program the chip directly through ICSP. To use ICSP, you connect your programmer and use the "Upload using programmer" function in the Arduino IDE instead of plain "Upload".

Alternatively, why not run the atmega328p at 3.3V instead of 5V?

Because I didn't find any 3.3V power source, and I've read somewere (don't remember where exactly) that the ATmega chip must be at 5V to work correctly. It isn't true?

The atmega328p can use anything between 1.8V and 5V. The maximum clock speed that is guaranteed to work varies with voltage, from 4MHz @ 1.8V to 20MHz @ 4.5V and higher. But if your peripherals can run from 5V, then you may as well use 5V.

I knew that running the ATmega without the 16mhz crystal it would be slower, but it also means that the Delay time will be different?

You can set up the value F_CPU in the board definition for your chip to specify the clock speed, then the delay times will still be correct, subject to the accuracy of the clock (see below).

By the way, I have 3 of that crystals, they are really needed, I mean, I should use them or for this specific case I can leave the ATmega without it?

If you need accurate timing, use the crystal. If you can accept some variation (e.g. +/-10% if you don't calibrate the internal oscillator, better if you are prepared to calibrate it), then you don't need to use a crystal. If you decide to use a bootloader, then you will either need a crystal or ceramic resonator, or you will have to calibrate the internal clock (unless you are lucky).
« Last Edit: December 19, 2012, 09:43:35 am by dc42 » 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.

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

If you need accurate timing, use the crystal. If you can accept some variation (e.g. +/-10% if you don't calibrate the internal oscillator, better if you are prepared to calibrate it), then you don't need to use a crystal. If you decide to use a bootloader, then you will either need a crystal or ceramic resonator, or you will have to calibrate the internal clock (unless you are lucky).

I don't have any idea how to calibrate the internal clock :o you said that is the same programming with or without the bootloader, so if I use ICSP, I will not need to calibrate the internal clock, since I do not need accurate time , is that it?


The atmega328p can use anything between 1.8V and 5V. The maximum clock speed that is guaranteed to work varies with voltage, from 4MHz @ 1.8V to 20MHz @ 4.5V and higher. But if your peripherals can run from 5V, then you may as well use 5V.

So I should look for a power supply with less voltage, or use a voltage regulator to bring down the 5V to 3.3V?
And I can use the nRF24L01+ with only 3.3, or it must be the one that doesn't have the "+"?
Logged

Pages: [1] 2   Go Up
Jump to: