I am using an Arduino Decimalia on a project of mine that I would like to make permanent. Is there any way that I can remove the ATmega168 from the Arduino board, solder that onto my project board, and slap in a new ATmega168 into the full arduino board to continue using?
That's exactly how it works
Couple things to consider though,
You'll need an ISP Programmer($30 for a kit from Ladyada)
And if your sketch has anything to do with timings, then you'll need to add a 25mhz crystal to your circuit.
I'm not exactly sure of the exact process, but
http://www.ladyada.net/learn/avr/
Here's a good place to start.
Ok, a little bit more precisely, this means :
You'll need an AVR programmer anyway. The simplest way would be not to touch the Atmega on the Arduino, then use the programmer to just burn another µC with your program (the .hex file in the /applet/ subdir.
If you really want to remove the Arduino's atmega, you'll have anyway to program a new one with the Arduino bootloader before mounting it back on the Arduino.
For the oscillator issue, I must admit I don't know. AFAIK, the Atmega comes with an integrated clock, but I've always seen it used with an external oscillator, which I assume brings a better precision.
Just a tip : You should use a DIL socket instead of directly burning the atmega to a board. Leadless solder often takes longer to melt, and overheating a microcontroller could kill it. So play safe and solder only a socket, then mount the µC in it. Quite inexpensive and prevents funny stuff like "at least i've soldered all these pins... But why don't anything works ?"
Have fun ^^
I think people just don't want 8MHZ, I dunno why, they'd all rather use external and mess with getting timings right in the apps
You might be getting mislead a little here.
You can simply burn your final sketch with the chip in your Arduino, and put it in a home made board.
There are schematics for these boards on the Playground or something like the Really Bare Bones board already made up.
Also art364 / Standalone Arduino
In addition to a socket for the ATMega you just need a crystal (16MHz) and a few caps and resistors.
An ISP programmer is only necessary if you don't want to swap the chip between your board and the Arduino when you want to change the program. Even then, you can simply bring out the Rx Tx pins and reload sketches with a USB to TTL Serial cable.
A programmer is always needed if you want to continue to use the Arduino board, since you need to burn the arduino bootloader into the new atmega168. You don't need an ISP, but you need a programmer (and afaik, ISPs are the least expensive, but I might be wrong on that)
If you have a way to easily buy pre-programmed atmega168, you probably won't need the programmer at all. But I think it will be more expensive in the middle term than just getting yourself a programmer.
You don't need an ISP, but you need a programmer (and afaik, ISPs are the least expensive, but I might be wrong on that)
What is the distinction you are making between an "ISP" and a "programmer"?
Most of the common sources for the ATMega168 sell them with the bootloader. Unless you are buying them by the 100's there is very little difference in cost.
What is the distinction you are making between an "ISP" and a "programmer"?
Not any Have misread your answer, thinking we were referring to an ICP (in circuit), and thought you meant the person asking didn't specifically needed an in-circuit programmer. My mistake.
Most of the common sources for the ATMega168 sell them with the bootloader. Unless you are buying them by the 100's there is very little difference in cost.
I don't know where zerocle lives, and here in Paris (Fr), I don't know of any shop who sells pre-programmed Atmega168, or even Arduinos. As I'm more used to go into a shop when I need something, than ordering on the net and waiting a few days, this seemed to be the best option.
So my previous answer, I think, is still valid, and if expended to its full meaning, it would give : Depending on where you live, and on how you like to buy your electronics stuff, you might, or not, need an external programmer. The price issue may apply to some locations and not to some others, I don't really know.
Case closed ?
I think people just don't want 8MHZ, I dunno why, they'd all rather use external and mess with getting timings right in the apps
Could you please be more specific on the timing problems you're referring to ? I understand the target µC is configured at compile-time, and the Arduino library seems to recognizes both 16Mhz and 8Mhz speeds :
// wiring.c, starting at line 83 :
#else
// for the 8 MHz internal clock on the ATmega168
// for a one- or two-microsecond delay, simply return. the overhead of
// the function calls takes more than two microseconds. can't just
// subtract two, since us is unsigned; we'd overflow.
I understand a faster external oscillator can be recommended for some applications, but I think the most common Arduino program (wait until something happens – do something – go back waiting) could work very well on an 8Mhz controller.
I'm far from saying that external oscillators are evil, or just a loss of time, but I don't really understand if it's "always good" to put one, because the internal one is not-so-good, or if you can just go without them if your app doesn't require the speed gain.
Thanks.
And if your sketch has anything to do with timings, then you'll need to add a 25mhz crystal to your circuit.
FWIW 25MHz is not (officially) supported by the ATmega168 or ATmega8 chips. 20MHz is supported but the chips but not by the default Arduino core. AFAIK only 16MHz or 8 MHz are supported by the Arduino core.
--Phil.
I'm far from saying that external oscillators are evil, or just a loss of time, but I don't really understand if it's "always good" to put one, because the internal one is not-so-good, or if you can just go without them if your app doesn't require the speed gain.
An external oscillator/crystal will be more "stable" than using the internal oscillator on the chip. This has most impact on serial communications.
--Phil.
Adafruit(Ladyada) sells programmed ones for $6 + shipping.
As opposed to ~$4 for normal.
But either way, you can't go wrong with a programmer.
An external oscillator/crystal will be more "stable" than using the internal oscillator on the chip. This has most impact on serial communications.
Thanks !
Could you please be more specific on the timing problems you're referring to ? I understand the target µC is configured at compile-time, and the Arduino library seems to recognizes both 16Mhz and 8Mhz speeds :
OMG, I wrote THAT ? I meant the "target µC frequency", and it is the program which gets compiled for a given frequency, the controller itself isn't of course altered in any way. I should re-read my posts before sending. Hope no one got misleaded.
- slaps himself *
Whatever the company/people is that sell the RBBB arduino sells pre-programmed chips as well for I believe 4 bucks, although and ISP wouldnt be a bad idea either. crystal oscillators aren't bad, they're cheap, and although super reliable timings aren't necesary for my project, who would turn it down. Thanks for all the input guys! you've helped me out alot!
That's what forums are for
We should get a Rep/Karma/Thanks system on here.
Can I PLEASE be developer for the forum, I got tons of time, and it's not going anywhere anyways
Back to the OP, yes, you most certainly can get an extra atmega168 with a bootloader already on it and a crystal and a voltage regulator and a couple other bits and use an existing DIP style duino to program it by swapping chips. That is what I did for one of my proto-prototypes: