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. what do I program into it? the firmware, the source code?, can you be more specific please…thanks.

    • 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.

    • 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….

      • 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.

      • 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. 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

    • 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. do you have a guide how to burn the bootloader to a blank ATMega 328P using the USB2SERIAL LIGHT

    thanks

  4. 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?)

  5. 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?

    • 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