I love Arduino as a development board, but on a few projects I'm realizing I don't need all of the functionality that some chips have. I have messed around with AVR programmers, so I know that I don't technically need USB to program the Arduino, but now I'm wondering if I could also completely remove the chip itself?
I know the answer is yes, with the caveats that I lose the additional circuitry that the Arduino includes, i.e. an oscillator crystal, LEDs, as well as multiplexer for the analog inputs. What I'm also wondering though, is do I need to continue using Arduino IDE type code to program the AVR, or are there other options such as C++ by itself? I wouldn't want to have to code the chip in C, as that seems like a further abstraction from what I generally want to do.
So in other words, if you have any good guides on going from Arduino -> Atmel only chips, let me know... Trying to figure out the best was to make some projects smaller that might only need 2-3 Analog inputs for example.
You can always program atmel chips using Atmel Studio, but it's harder than doing it with Arduino IDE because you don't have access to easymode functions like digitalWrite(), and instead would be manipulating registers directly. You'd be writing in essentially the same language (C vs C++ are very similar), just without the helper functions that Arduino provides. Note that you can always manipulate registers from the Arduino IDE.
A lot of people use ATtiny AVR chips for shrinking their projects. (these can be programmed through the Arduino IDE after installing an appropriate core, like the ones linked in my sig).
An Arduino is just a breakout board for the Atmel chip with very little support circuitry. You can delete the power supply and just feed the chip regulated power, and you can delete the USB circuitry and program the chip via and external ISP programmer or FTDI adapter. So there's almost nothing else on the board but the bare chip and crystal. There is an internal oscillator on the Atmel chip, so you don't really need the crystal. You can keep using the IDE and all the libraries you are used to and program a bare chip. If you use one of the Atmel chips which is not part of a factory-produced Arduino board, you need to add a custom core and live with whatever limitations the chip has. Or you can just use ATmega328P and connect just the pins you need, and then you could program it just like you program an Arduino board. I don't think there is any waste or overkill in doing that. I think the best way to get a start in this direction is here:
Benefit of going the direction you are heading is you can develop using an Arduino, and then easily port your finished project to a bare chip.
If you are talking about hardware, it really isn't worth the bother.
A Pro Mini is a beautifully assembled "bare chip" or "bare minimum" module which is virtually as cheap as the chip itself - at least the Chinese knock-offs are and they seem to be eminently reliable.
Unless you contemplate serious production runs, why would you want to do all the groundwork of crystal and capacitor (and regulator) assembly and SMD chip mounting for no cost benefit?
As for the Hardware, I would recommend You build a board with a naked 328P and Crystal.
You should wire ISP, A2 or A3, D7 or D9 and D13. Its cheap, little and You can test allmost all functions.
Now, like dmjlambert told allready, go to the website of Nick Gammon and Learn
As for the Software... It's pretty nice way to use the Arduino IDE.
What is the reason You want to manipulate registers directly?
Take a look on a simply "LED Blink" code.
It's more "complex" than just digital.Write.
@Paul__B You can reduce the PCB Size on 1/10 if You make Your own Board.
I have got 2 of those Chinese Boards they are firing "Non Genuine Device" over Serial Out.
After looking more exactly I'm even not sure if the Atmel chip is genuine!?
It's not allways about the Money.
Maverick71:
You can reduce the PCB Size on 1/10 if You make Your own Board.
I have got 2 of those Chinese Boards they are firing "Non Genuine Device" over Serial Out.
I'm not sure what either of those two statements means in English.
"reduce the PCB Size on 1/10"?
"firing "Non Genuine Device" over Serial Out."?
aaddcc:
So in other words, if you have any good guides on going from Arduino -> Atmel only chips, let me know... Trying to figure out the best was to make some projects smaller that might only need 2-3 Analog inputs for example.
Thanks!
There is already a very basic explanation on how to do it on a breadboard and then use a programmed Arduino as the programmer...
Anybody who is serious should probably want to buy this...
You can program the IC with either Atmel Studio's C language (and libraries if you wish) or use Arduino. If you use Arduino what you do is take the ELF it creates (just search for it on your C: drive) and use the programmer plug in to write it to the microcontroller. If you write your program in Atmel Studio, you can use the debugger if the IC supports it. Note that this programmer supports almost every chip Atmel offers.. AVR, XMEGA, AVR32, and all the ARM stuff as well as just ATMEGA/ATTINY. It's a great way to make projects. Here is a ATMEGA328P-PU on a project board running a AD5310 serial DAC with a programming header and the older AVRISP programmer, a typical project for me:
The size of the original Arduino measures 55 * 70 mm = 3850 mm²
If one made his own Arduino it can be 15 * 25 mm = 375 mm²
The self made Arduino is ~10 Times smaller -> 1/10
Maybe You remember that China Clones often comes with non genuine FTDI Chip.
From one day to another all those cheap Arduino Clones stopped working.
On the Internet it's known as the "FTDIGate"
If You open serial port to such Chip You will get the message "non genuine device"
The serial port of this chip is practically blocked, while it's firing at "You" ...
A Pro Mini is 18x33mm. So for most applications it isn't worth doing this yourself from scratch. Unless you need it to be a few mm smaller or you want to include specific components on the board, what's the point?
I don't think you want to go there. Well maybe.
Are you trying for cheaper, or smaller?
I have sorta settled in with the Nano as my pick. It is pretty small, and pretty cheap.
Sometimes I think I could have made that with other components ( 555, opamp, nand gate, etc), but when I come back to my senses, I realize, it would have cost me more, related to time and money, unless I was going to mass produce the item.
Maverick71:
The size of the original Arduino measures 55 * 70 mm = 3850 mm²
"The original Arduino" is not the reference design. As jboyton points out, I was talking about the Pro Mini and as he echoes, it's just not worth replicating it. Almost all people here have had excellent results with the $2 Chinese Pro Minis.
Similarly, "Nano" knock-offs rather sensibly no longer use an "FTDI" chip at all, so even if people use Windoze, it is no problem.
I appreciate everyone's replies here. It has been helpful, especially the ones with links / some pictures.
I do agree that the Nano/Micro/Mini are pretty nice solutions, given how small they already are. My hope it generally to continue to use Arduino as a development platform, but I'd imagine as I get further in some projects, it would be advantageous to move beyond the Arduino and know how to just use the chip.
The main reasons I would want to move to just using the chip are due to IP issues as well as mass production. If I am developing a prototype for a company, for example, it is acceptable to use an Arduino. However, if they want to actually produce a device that works similarly, it would make sense to move to just using the chip itself and the specific circuitry needed.
By no means am I a hardware developer (i.e. I don't really program in C, more so C++, Java, Matlab). But I do love learning about circuits, and I think a great way to help me better understand the Arduino would be in part by learning how to use the chip it relies on without the underlying Arduino IDE. That might be pretty difficult though, but it could be a good learning activity for myself.
I did not realize Chinese Pro Mini knockoffs worked well. I was afraid of ordering them as I didn't know if they would be sketchy, but now I will consider them moving forward. I will note that in the past I mostly used the bigger boards (Uno, Mega), but have since moved towards the smaller Micro and Nano, so the space issue isn't as much there as it was in the past.
An AVR chip doesn't require much: power, ground and decoupling capacitors is sufficient and you're ready to go. Add an external crystal or resonator, a reset button, a regulator and an LED or two and you have a Pro Mini.