loading

Arduino is nowadays an easy tool for e-hobbyists .As an open platform and a "ready to use" circuit, everyone follows various arduino boards for realization of embedded designs. But sometimes it is difficult and unaesthetic to use such large board as the basic circuit of our project or product, such as making a home automation system using an arduino board'll not be professional . Any arduino board consists of two basic blocks namely the programmer and the microcontroller . The microcontroller is nothing but a standalone microcontroller (Atmega328 in arduino uno) and the programmer is the programming circuit which do the programming of our microcontroller.

When we are making an application level electronic product, we don't need the entire arduino in the design. Only we need the microcontroller programmed as per our application and we don't need the programming circuit of the arduino board. So, in this instructable we gonna program a 328 microcontroller for led flashing and using the microcontroller alone on a breadboard.

Step 1: Bill of Materials

1. Arduino Uno.

2. Breadboard.

3. USB A to B cable.

4. ATmega328 microcontroller.

5. LEDs.

6. 22 pF capacitors.

7. 16 Mhz crystal.

8. 9V battery.

9. Jumper wires.

Step 2: Bootloading the Microcontroller

In non technical words, bootloading is nothing but making a bridge of communication between the arduino board and the microcontroller. The microcontroller 328 that we buy in market may or may not be bootloaded. I it is already bootloaded, then we can directly use it with the arduino otherwise we have to bootload it first. Bootloading can be done with the same arduino uno.

1. Fix the 328 on a breadboard.

2. Connect the crystal to the 9th and 10th pins of the 328.

3. Connect two 22 pF capacitors to each of the two legs of crystal and ground them.

4. Connect pin no: 7 and 20 to a 5V pin of arduino.

5. Connect pin no: 8 and 22 to ground of arduino.

6.Connect pin no:10 of arduino to the pin no:1 (reset) of 328.

7. Connect pin no:11 of arduino to the pin no:17 of 328.

8. Connect pin no:12 of arduino to the pin no:18 of 328.

9. Connect pin no:13 of arduino to the pin no:19 of 328.

Now connect the arduino board to the computer

The arduino in powered up also the 328 on breadboard is powered up.

The circuit is ready and we have to bootload , open the arduino IDE for that.

From MENU select Tools>Programmer>arduino as ISP

Then select Tools>Burn bootloader

After a few seconds, the 328'll be bootloaded and we can easily program it with the arduino board.

Step 3: Programming

Remove all the connections from arduino board to the breadboard we've done for bootloading.

We need some new and a few connections for programming 328.

The new connection steps are as below,

1. Connect Vcc and Gnd from the arduino board to the breadboard microcontroller.

2. Connect the RESET pin of arduino board to the pin number 1 of ATmega 328.

3. Connect the Rx pin of arduino to the pin number 2 of 328.

3. Connect the Tx pin of arduino to the pin number 3 of 328.

Now we've to make some changes in the IDE also , as follows,

1. From MENU , select Tools >Board > "Arduino Duemilanove or Diecimila"

2. now select ,Tools > Processor > ATmega328

Now the entire programming setup is ready

write the program as usual, click "upload"

The program'll be uploaded to the microcontroller.

Remove all the arduino connections, provide a separate 5 VDC power supply to the breadboard and we've an independent 328 microcontroller in action.

Step 4: An Important Pitfall

In the arduino IDE , pin number 5 means the fifth pin of the arduino board not the fifth pin of 328 microcontroller.

It is actually 11th pin of the 328.

Since we are coding for a standalone 328, we've to put keen attention in accessing the I/O pins.

So, access 11th pin of the 328, we've to write in the code "5" instead of 11.

All the 18 I/O pins of 328 can be accessed like this.

So I'm attaching a table which describes everything about coding the I/O pins.

Step 5: Demo Video of Blinking Led on Breadboard

Have Funnnnnn........<3

<p>Hi, what about the AtMega 16 A ? Can i program it like that ? Thanks</p>
<p>Of course you can . I think this link may help you:</p><p> <a href="http://hardwarefun.com/tutorials/use-arduino-as-an-isp-programmer-to-program-non-arduino-avr-microcontrollers">http://hardwarefun.com/tutorials/use-arduino-as-an...</a></p>
<p>Hello !<br><br>Thanks a lot for this brilliant howto !<br><br>I have questions, though.<br><br>1. Other howtos advise the use of an ATmega328-PU microcontroller. What variation of the ATmega328 do you advise ? Why ?<br><br>2. In the following video &lt;https://www.youtube.com/watch?v=30rPt802n1k&gt; &quot;How-To: Shrinkify Your Arduino Projects&quot;, an Arduino is used as an ISP to program an ATtiny85. No bootloader install is mentioned. Is it really necessary to burn a bootloader to do the same with an ATmega328 ? Why ?<br><br>3. My board is a Genuino Uno R3. I would like my standalone microcontroller to be as close to my Uno R3 as possible. Your step 3 advises to choose &quot;Arduino Duemilanove or Diecimila&quot; board. Should I switch to &quot;Arduino/Genuino Uno&quot;, or stick to your howto ? Why ?<br><br>Again, thanks a lot !<br><br>Cobus.</p>
<p>1. The ATmega 328, P and PU only differ in their package and power consumption. The PU type is a low power consuming one which you can use in some portable applications .</p><p>2. You should burn the bootloader for programming the 328 with arduino. But in the case of ATtiny microcontrollers, what only you need is installing the ATtiny support files with the arduino IDE and you can directly program the ATtiny.</p><p>3. For programming 328 using arduino Uno board, one should select Duemilanove or Diecimila instead of Genuino uno even though the board is Uno .</p><p>Sorry for the late reply....... :)</p>
<p>Hello,</p><p>Thank you for your answers.</p><p>Concerning my question #2, I found an interesting website.</p><p>&lt;<a href="http://www.notesandvolts.com/2013/01/fun-with-arduino-arduino-as-isp.html" rel="nofollow">http://www.notesandvolts.com/2013/01/fun-with-arduino-arduino-as-isp.html</a>&gt; wrote :</p><blockquote>Since we are using the SPI interface to program the chip, we don't need the Bootloader.</blockquote><p>It also wrote that burning a bootloader (and then erasing it) was an easy way to set the fusebits correctly.</p>
<p>Thank you #<a href="https://www.instructables.com/member/Cobus089" style="">Cobus089</a> for sharing the knowledge :)</p>

About This Instructable

2,675views

65favorites

More by SHAMSUDHEEN MARAKKAR:The PCB Speaker....! Fix Your Broken Ear Phone Jack (The Hot Glue Trick) DIY USB Speaker 
Add instructable to: