Hi Sir, Sub : How to Use stand alone Atmega328P I am a Mechatronics/ Automation hobbyist and I have recently learnt little bit in 2 days workshop on Arduino –uno but yet to learn a lot more things from you experts. So my questions may look silly to you but I am sure that still you will be generous to answer. My question is that Can I insert a newly brought Atmega328P from local market ,place it on Arduino –uno (after removing UNO’s original Atmega328P ) Upload my own sketch on arduino uno, then remove it and fix on my own designed customized PCB and get same effect as from arduino uno? OR to put it simple words – can I use arduino uno as programmer for new ATmega328.? Kindly reply at the earliest please. Warm Regards, N.S SUBRAMANYA, Bangalore , India
Yes, you can use a newly brought Atmega328P but it have to have loaded the bootloader to be able upload sketches. Arduino uses serial programming and the bootloader is needed for it. It also should work in your own PCB. If it is programed in the Arduino and then placed ito your own board. You can also use the UNO as programmer for new ATmega. It is known as 'Arduino as ISP' and you will need it to upload the bootloader to the new ATmegas. Brand new ATmega need to be programmed via ISP because the bootloader is not present so serial programming doesn't work.
This is the schema I used in one of my system which run Arduino in standalone mode.
For bootloading a new chip I used the instructions from http://www.lydiard.plus.com/chapter9.htm
Here is my system which uses Arduino in standalone mode. The Arduino schematic I came up for the below system is here, which also uses a switching voltage regulator to step down, the 12v to 5v for my system.
Edit: In my schematic, there is an error, I showed only one 100mf caps at VCC/GND. Instead I placed two separate 100nf caps to VCC/GND and AVCC/GND.
Initial stages I used a breadboard and couple of wires to bootload using Arduino as ISP. It becomes a pain to bootload several chips. So i designed a shield
I used the revised one to bootload all my Atmega chips.
I’ll recommend you to check out MiniCore! It makes it really easy to run the ATmega328p standalone with additional settings
You do still need an ISP programmer. At the minimum, this means a second Arduino running Arduino as ISP sketch - however, I highly recommend the $3 USBAsp programmers available on ebay. Much less futzing with wires, and hence less opportunity for mistakes.