Computers, Development Boards & Shields
Educational & Robotics Kits
Electronic Sensors
Motors & Controllers
Communication & Display
Electronic Components
Soldering & Lab Tools

Bareduino328: Programming guide

Now that you have a working Bareduino, you’ll want it to do more then just blink over and over. So lets get into programming it.

You will need the Arduino IDE to program your Bareduino. Click here to go to the download page of the Arduino IDE.

There are many of ways to program your new creation, we have taken the time to write guides for a few of the methods you can use. If you are looking for a way not mentioned below and need some assistance, then please feel free to email us or comment on this posting and we’ll try and figure it out together.

First programming method – Arduino USB2Serial Light

For this method, the required items will be needed:

1 – Bareduino (see this guide to make your Bareduino)

1 – Arduino USB2Serial Light

1 – Type A to Mini B USB cable

1 – 100nF capacitor

Jumper wires (total of at least 4 wires)

 

All examples in this guide work with the simple blink program so load the Arduino IDE with the following code loaded and the “Arduino Duemilanove w / ATmega328” selected:

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);               // wait for a second
digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
delay(1000);               // wait for a second
}

These are really handy, don't forget to use them!

Down and dirty programming (with another USB2Serial Light):

1. Connect the ground pin of the Arduino (Gnd Blk) to Pin 8 (GND) on the Atmega328

2. Connect the +5v pin of the Arduino to pin 7 (VCC) on the Atmega328

3. Connect the TX pin of the Arduino to pin 2 (RX) on the Atmega328

4. Connect the RX pin of the Arduino to pin 3 (TX) on the Atmega328

5. Connect the EXT RESET pin of the Arduino using the 100nF capacitor to pin 1 (RESET) on the Atmega328

The reasoning for the connection of the 100nF capacitor between the resets on the Arduino and Bareduino is the way the Arduino board acts. The signal sent from the reset is fed from the Arduino whenever a program is being uploaded. The cap causes a brief low signal to the chip, this causes a reset to occur. At the same time, the cap is able to charge back up due to the pull up resistor. This charge is within the timing to allow the chip to sync to the programmer before transmitting and receiving.

6. Connect the Arduino USB2Serial to the computer using the USB cable (be sure you have the drivers installed).

[stextbox id=”info”]NOTE: The Bareduino ATMEGA328 is programmed with the Duemilanove Bootloader, this has no effect on your programs operations, but does change the baud rate at which the chip is programmed. When programming ensure that you have selected “Arduino Duemilanove w/ Atmega328” from the board menu even if you are programming it with an Uno.[/stextbox]

7. Use the Arduino IDE program to apply your new program code.

[stextbox id=”info”]NOTE: You do not have to modify your code for it to compile and run on a Bareduino or Bareduino plus. All Uno/Duemilanove code can be run on the Bareduino without modification.[/stextbox]

8. Use your Bareduino as you intended to

9. Bask in the cool glow of your blinking LEDs
Second programming method – Programming using Arduino Duemilanove

For this method, the required items will be needed:

1 – Bareduino (see this guide to make your Bareduino)

1 – Arduino Duemilanove

1 – Type A to Type B USB cable

Jumper wires (total of 5 wires)

 

These are really handy, don't forget to use them!

Down and dirty programming:
0. Remove the Atmega328 from the Arduino that is being used to program (This will prevent the to ATMEGA328’s from interfering with eachother).

1. Connect the ground pin of the Arduino Uno/Duemilanove to Pin 8 (GND) on the Bareduino

2. Connect the +5v pin of the Arduino Uno/Duemilanove to pin 7 (VCC) on the Bareduino

3. Connect the Digital pin 1 (TX) of the Arduino Uno/Duemilanove to pin 3 (TX) on the Bareduino

4. Connect the Digital pin 0 (RX)  of the Arduino Uno/Duemilanove to pin 2 (RX) on the Bareduino

5. Connect the RESET pin of the Arduino Uno/Duemilanove to pin 1 (RESET) on the Bareduino

[stextbox id=”warning”]Don’t forget to remove the ATMEGA328 from the Arduino you are using to program your Bareduino. Otherwise you won’t be able to program either device.[/stextbox]

6. Connect the Arduino Uno/Duemilanove to the computer using the USB cable.

[stextbox id=”info”]NOTE: The Bareduino ATMEGA328 is programmed with the Duemilanove Bootloader, this has no effect on your programs operations, but does change the baud rate at which the chip is programmed. When programming ensure that you have selected “Arduino Duemilanove w/ Atmega328” from the board menu even if you are programming it with an Uno.[/stextbox]

7. Use the Arudino IDE program to apply your new program code.

[stextbox id=”info”]NOTE: You do not have to modify your code for it to compile and run on a Bareduino or Bareduino plus. All Uno/Duemilanove code can be run on the Bareduino without modification.[/stextbox]

8. Use your Bareduino as you intended to

9. Find your happy place

 

 

Back To Top

15 Responses to “Bareduino328: Programming guide”

  1. LARRY MILLER May 3, 2012 at 6:40 pm #

    what do I program into it? the firmware, the source code?, can you be more specific please…thanks.

    • Joseph Dattilo May 3, 2012 at 7:06 pm #

      I will update the guide to clarify these points, but select “Arduino Duemilanove w/ Atmega328” and run any code that would work on the Duemilanove/Uno/Versalino. The rest of your questions will be answered in the guide shortly.

      Thank you for letting me know about your question.

    • LARRY MILLER May 8, 2012 at 7:01 pm #

      this page is nice with pictures, but does not take any time to post a picture. If you are sincere about providing “guides”, then there should be some text here like, “go to tools, select arduino as isp…etc.” basic anything. there is nothing here to say what to do, I am finding this info out from other sources, sorry not as smart as you, we all start somewhere….

      • Joseph Dattilo May 8, 2012 at 7:23 pm #

        No problem, maybe we should make a beginners guide that walks you through the Arduino IDE, is that what you are asking about?

        If so we will go ahead and start working on one shortly. Thank you for the suggestions.

      • Joseph Dattilo May 8, 2012 at 8:03 pm #

        Larry,

        I just realized that you happened to look in the middle of an upgrade to the blog. There was a problem with the visuals but it should be remedied now. The Notes are pretty prominent. Do you think if we wrote a beginners guide to supplement that it would have been easier for you to get through the process?

  2. George Max May 12, 2012 at 4:51 pm #

    Hello, i bought a bareduino plus, and installed it as shown, do you put the rx tx gnd 5vin and reset cables in the same pins as the normal bareduino? i did so, installed the drivers and i get this error each time i want to upload

    avrdude: stk500_getsync(): not in sync: resp=0x00
    avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
    thanks for your help

    • Joseph Dattilo May 13, 2012 at 10:28 am #

      The following are the most likely causes for your problem:

      Generally when programming the Bareduino or Versalino™ (with jumper wires) the protocol error

      “avrdude: stk500_getsync(): not in sync: resp=0×00
      avrdude: stk500_disable(): protocol error, expect=0×14, resp=0×51”

      is usually a result of the Reset failing to occur. Since you said you are using the USB Serial Light the first thing you should check is that your reset line is tied to the reset on the USB Serial Light through a 100 nF capacitor (this allows the reset to occur).

      Another good trick to make sure everything else is setup right is to put an LED between ground and pin 13 (reference https://www.virtuabotix.com/feed/?p=407 chip pin-out guide for pin location). If the LED blinks you have your power and crystal setup correctly.

      If you are still getting he error at this point than the most likely problem is that you have your transmit and receive lines swapped (remember with the USB Serial Light the Transmit goes to Receive and the Receive goes to Transmit).

      Note: If you had the wrong device selected it would give you this error
      “avrdude: Yikes! Invalid device signature.
      Double check connections and try again, or use -F to override
      this check.”

      The “protocol error, expect=0×14, resp=0×51” actually means that it can’t even talk to the device.

      If you still have problems just shoot me an email with a picture of your setup at webmaster@virtuabotix.com and I will help you figure out whats wrong.

  3. silverfox0786 March 12, 2013 at 7:37 am #

    do you have a guide how to burn the bootloader to a blank ATMega 328P using the USB2SERIAL LIGHT

    thanks

    • Joseph Dattilo March 12, 2013 at 1:56 pm #

      It is not possible to bootload using the USB Serial Light, or any other FTDI board, but it is possible to build a Bareduino and use it as a way to bootload chips in tandem with an Arduino, or another Bareduino using the ArduinoISP sketch that comes with the Arduino IDE.

      If there is interest I can write a guide on it in the future.

      Respectfully,
      Joseph Dattilo

      • silverfox0786 March 19, 2013 at 7:07 pm #

        would be great if a guide was available on how to use the IDE to bootload a chip via the Sketch

        • Joseph Dattilo June 26, 2013 at 12:40 am #

          I could work on a guide for using two bareduino’s to bootload chips if that is what you are asking for. Otherwise I was looking into making a Versalino loadboard to do that as well.

  4. vvn April 13, 2013 at 8:22 pm #

    Hi,
    I have a Bareduino, but not a USB2Serial Light. I have done some basic Arduino programming, and thought it would be a good learning experience to get a little more raw. I have looked up USB2Serial on your site, and don’t find it. So you think you could link to a place to purchase this item. (And in future maybe sell a kit that includes this as well?)

    • Joseph Dattilo April 17, 2013 at 3:58 pm #

      Thanks for the reminder, I wrote this guide before I had finished the design for the Versalino FTDI (https://www.virtuabotix.com/?page_id=3117&productid=609224531897) it works exactly the same, but it adds a couple of features like drop in Bluetooth support that don’t exist on any other FTDI. We should also have the USB Serial Light available on the website pretty soon for those who prefer it.

      Respectfully,
      Joseph Dattilo
      Founder Virtuabotix LLC

  5. robert_veitch December 24, 2013 at 4:50 pm #

    Just curious, I didn’t see it explained…. why is the RX and TX crossed on the USB2Serial Light, but not on the Arduino Uno/Duemilanove method?

    • Joseph Dattilo December 26, 2013 at 3:10 am #

      Sure thing, basically the reasoning is that the Tx and Rx on the Arduino are already from the perspective of the chip instead of the FTDI (or alternate USB chip in the case of the Arduino Uno R3).

      When you do the wiring to an FTDI like the Versalino FTDI the markings are from the perspective of the computer. That is to say that the Tx of the computer goes to the receive of the chip, and the Rx of the computer goes to the Tx of the chip. That reversal is already done for you on the Arduino (which can be confusing, but should make more sense when explained that way.

Leave a Reply