Standalone microcontroller

Hi,

I've read a lot of how-to's and tutorials on how to load a bootloader onto a new chip, program second chip, etc. But can't seem to find an answer to a simpler question: can I just take out working and programmed chip on my Arduino Uno, and put together a working standalone product?

My sketch is really simple: virtual wall for Roomba. It's just one IR LED. Ideally I'd want to hook up +5V power, and a transistor to drive the LED. From what I understand, I'd need to switch to 8MHz internal clock, and it should work with this minimal config. But I can't find a guide how to do it on the prototype board itself, so that I can then just move the chip to a finalized "product."

My plan is then to just buy a replacement Atmega328P chip with pre-loaded Arduino Uno bootloader, and use it for future projects.

It's got to be possible :slight_smile: Where can I find a guide on how to implement this?

Thanks!

sergesyrota:
Hi,

I've read a lot of how-to's and tutorials on how to load a bootloader onto a new chip, program second chip, etc. But can't seem to find an answer to a simpler question: can I just take out working and programmed chip on my Arduino Uno, and put together a working standalone product?

My sketch is really simple: virtual wall for Roomba. It's just one IR LED. Ideally I'd want to hook up +5V power, and a transistor to drive the LED. From what I understand, I'd need to switch to 8MHz internal clock, and it should work with this minimal config. But I can't find a guide how to do it on the prototype board itself, so that I can then just move the chip to a finalized "product."

My plan is then to just buy a replacement Atmega328P chip with pre-loaded Arduino Uno bootloader, and use it for future projects.

It's got to be possible :slight_smile: Where can I find a guide on how to implement this?

Thanks!

Yes what you want to do is very simple really. Once you remove your programmed chip you install it into an external circuit. That circuit must have a 16 Mhz crystal resonator and provide +5vdc power and ground to the chips pins from a suitable voltage source. Also a few bypass caps and a pull-up resistor for the reset pin is highly recommended. I think if you search on the term arduino standalone you should be able to find many examples of how to accomplish your goals.

Good luck
Lefty

You can do as lefty says (add a 16MHz crystal + caps to your standalone design). Or you can make a standalone design without the crystal, using a blank atmega328p (no bootloader installed, no crystal needed if you don't need accurate timing), and program it via ICSP. You can use your Arduino as the ICSP. See Prototyping small embedded projects with Arduino | David Crocker's Solutions blog for more about the second approach.

Thanks for the replies.
I've seen those tutorials, and understand both approaches. But I wanted to go even more minimal than that :slight_smile: Ditch both crystal and ICSP programming :slight_smile:

Also, you mentioned "if you don't need accurate timing" - how do you define "accurate?" I need 38Khz LED pulse with 1ms on/off cycles. Is it considered "accurate required," or "good enough?"

how do you define "accurate?"

Within 1%

Ditch both crystal

Then you have to use the internal oscillator at 8MHz

You can either ditch the crystal, or you can ditch the ICSP programming. If you ditch both, then you are trusting to luck (that the 8MHz internal oscillator is accurate enough to support serial comms for the bootloader).

Something to keep in mind: Don't do a lot of swapping or plugging/unplugging the microcontroller from the socket on the Ardunio; these sockets were not designed for a ton of cycles, and the spring terminals in them will eventually lose their "springiness" and fail to make good contact (leading to all sorts of grief and frustration as you can possibly imagine). Furthermore, insertion and removal of chips from the sockets is something that must be done with some good care (especially a new IC; their legs are slightly "splayed out" and won't easily fit, so you need to carefully "bend" each side inward slightly, which isn't an easy operation itself - do it on a flat surface, one whole side at a time, and be very careful about it - one slip, and you can snap the pins or bend them too much, etc).

If you find yourself needing to do this kind of operation often, invest in a ZIF socket shield or something similar to program the ATMega (or do it off-board using ICSP).