Stand-Alone Arduino Help

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 :))

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

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.

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.

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.

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.

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.

iamfilipe:
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.

iamfilipe:
...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.

tack:
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?

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.

tack:
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.

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.

dc42:
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. :slight_smile:

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?

tack:
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.

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

dc42:
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 :frowning:

dc42:
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?

johnwasser:
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?

tack:
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 :slight_smile: 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)

iamfilipe:

dc42:
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 :frowning:

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

iamfilipe:

dc42:
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.

iamfilipe:
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).

iamfilipe:
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).

dc42:
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?

dc42:
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 "+"?

iamfilipe:
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?

Yes, as long as you don't need the clock to be accurate then you can leave it uncalibrated. The bootloader uses the serial interface, and serial comms needs the clocks at each end to agree to within 4% or so, which is why the bootloader may not work if you use the internal clock and don't calibrate it.

dc42:
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.

iamfilipe:
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 "+"?

I'm not familiar with the nRF24L01+ so I can't answer the second part. If you decide to run from 3.3V, then I suggest you use a 5V supply and a 3.3V regulator, since 5V supplies are easy to get hold of (e.g. USB chargers).

Just to clear up a bit of misinformation in this thread about the voltage requirements for the nRF24L01 and the newer nRF24L01+ -- while both are 5V tolerant on their signal input pins, both must be powered by no more than 3.6V at Vcc. Trying to power either variant at 5V will destroy them instantly.

So an Arduino running at 5V can safely connect to the SPI interface of an nRF24L01 without requiring any level shifting, however the nRF24L01 and nRF24L01+ will need a separate power rail.

See the datasheets for reference (you will certainly need them if you intend to program these in any case.)

pico:
Just to clear up a bit of misinformation in this thread about the voltage requirements for the nRF24L01 and the newer nRF24L01+ -- while both are 5V tolerant on their signal input pins, both must be powered by no more than 3.6V at Vcc. Trying to power either variant at 5V will destroy them instantly.

So an Arduino running at 5V can safely connect to the SPI interface of an nRF24L01 without requiring any level shifting, however the nRF24L01 and nRF24L01+ will need a separate power rail.

See the datasheets for reference (you will certainly need them if you intend to program these in any case.)

Thank you, I will take a look at that for sure. :wink: