newbie, dumb question - have read - tried to find

really dumb question, can't find on my own, have looked for hours.
Is it possible to program a chip with the arduino, then disconnect the arduino and just have the chip run by itself?
Thanx for the help in advance.

totally depends on the "chip"

Is it possible to program a chip with the arduino, then disconnect the arduino and just have the chip run by itself?

I am going to make an assumption here, and assume by "chip" you meant the ATMega168/328 that is on the Arduino board, correct?

So, you are asking "is it possible to use the IDE to program the ATMega168/328 (with bootloader) on the Arduino board, then power down the board, remove the chip, then put it in something else, and have it run?".

The answer to that question is "yes" - there are a few extra parts needed if you want it to continue to run at 16 MHz (otherwise, you just need to supply 5V and ground, and the internal clock running at 1 MHz will be used - some timing related code will be affected, I believe); these parts are mainly the 16 MHz resonator/crystal and 18-22pf parallel loading capacitors (all of which are very cheap). If you want to continue to be able to program it (in-field programming), you can supply a set of header pins for rx/tx and use an FTDI cable, or you can supply an ISP header and use an ISP programmer to upload the .hex file of the compiled sketch.

Is this what you were asking?

:slight_smile:

yes, exactly. thank you, great. arduino is what i need then thanx a lot.

It's just going to take me awhile to review what you said, but yahoo! so now we can do embedded ourselves, what a great state the technology is at.

Here's the thing, though - inserting and removing the ATMega chip from the Arduino can be difficult (like all socketed DIPs); use a small flat-blade screwdriver (not the jeweler kind; you want one that looks like a regular flat flared-blade screwdriver, only tiny), slip it under one end, and twist it a little side to side, put it in a little more, twist a little, and keep doing this until is it fully loose, then you can pull it free fairly easily.

Putting in a new ATMega will require you to slightly bend the pins inward on a flat surface (they also make a tool for this) - this is because fresh from the factory the pins are spread out a bit, and are very difficult to insert into the DIP socket without potentially bending one or more pins.

If you plan on doing this kind of task more than a few times, you might want to consider building a ZIF socket shield for programming bootloaded ATMega's; examples of such a board can be found on the arduino.cc site (I think in the playground?); SparkFun also has an example of such a board.

Basically, it is a shield (a protoboard shield PCB should work perfectly; in many cases you also have a reset button and LEDs on the shield as well, which are both very useful to have) in which the pins brought up by the headers are connected to the appropriate pins on a 28-pin ZIF socket to match the ATMega8/168/328 pinout. You have to then supply your own 16 MHz resonator/crystal, plus the loading capacitors (18-22pf), because the crystal connector pins on-board the Arduino aren't brought up via the headers. Remove the ATMega from the Arduino board, install the custom ZIF shield, then install the ATMega into the ZIF socket; the board at that point should work as it normally did, but it will be much easier to swap out bootloaded ATMega ICs for programming at-will.

So far, I haven't found a vendor of such a shield anywhere, so it is currently still very much a DIY project...

:slight_smile:

It's just going to take me awhile to review what you said, but yahoo! so now we can do embedded ourselves, what a great state the technology is at.

It's always been possible for a long time for hobbyists to do embedded CPUs in their projects; it hasn't always been cheap, but it has been possible. For instance, a 6809 CPU board (or a Z-80 board, for that matter) is fairly easy to design and connect up, only a few support chips are required (typically the cpu, some memory, and some control logic for the bus; plus clock, eproms, etc).

What has always been difficult was programming the beast; early (mid/late 1970's thru early 1980s) embedded designs, like you saw on early hobbyist robotic designs (as presented in old TAB books), typically used toggle switches to hand-assemble hex codes for the assembly instructions into each memory location (basically this was the design of the Altair and other early S-100 bus computers of the 1970s).

There were other ways of getting code into these systems; typically involving EPROMs that only held a few K of code, and using a special programmer (which tended to be relatively expensive) to dump the code into the chips, then they were read by the CPU at boot time. Serial monitor software and BASIC interpretors were common.

When the 8051 came out, it was like a sea-change; there was finally a system cheap enough and could use standard C compilers to create code with; it opened up a lot of new ground. Then the PIC came along, which revolutionized the whole electronics scene (shifting it from using discrete components to blink an LED to using a small microcontroller to do the same thing, and more).

Mainly it was a cost vs ease-of-use thing; today we have very cheap microcontrollers that are more powerful (in some ways) than early personal computers, and cheap (free) tools to create code and easily upload to the chip (so no need for special programmers or such).

It really is a very interesting time to be alive and experiment with this technology! We've come a long way just in the past 15 years; the next 15 years may just prove to be amazing...

:slight_smile:

While the Arduino made things a little easier and cheaper. 8 bit AVRs have been around for a while and development for a small emmbedded has been fairly and easy on those systems as well. AVR Freaks has lots of hobbiest as well as professionals. AVRs have been about open source develpment. Arduino just takes it all a step further.

The answer to that question is "yes" - there are a few extra parts needed if you want it to continue to run at 16 MHz (otherwise, you just need to supply 5V and ground, and the internal clock running at 1 MHz will be used - some timing related code will be affected, I believe); these parts are mainly the 16 MHz resonator/crystal and 18-22pf parallel loading capacitors (all of which are very cheap).

You have to be careful running the Arduino code at a different clock speed - firstly millis() will be wrong, but more importantly if you run at a very different clock rate the A/D conversion will be clocked at the wrong speed which could mean spurious values (and v. slow conversions) - fixing this means hacking the Arduino library.

So I'd strongly recommend getting the same crystal (presumable 16MHz since I think all the 8MHz boards are surface-mount) as suggested.

So it will run almost by itself - needs appropriate supply voltage and crystal/resonator. Probably a good idea to use a DIL socket so you can transfer it back to reprogram(!)