Getting started with Tag-Connect on an AVR MCU

By The MacroFab Team  |  October 4, 2016

Intro to Tag Connect / AVR MCU

Previously we introduced Tag-Connect pogo pin connectors for programming. This time we will be designing an AVR board based on the ATmega328P, which is used on the Arduino platform. The AVR board will have a TC2030-IDC connection for programming over ISP and an LED to show functionality. The heart of the board will be the tried-and-tested ATmega328P in the QFP-32 package (-AU). We will be using Eagle as our EDA tool for this example. Make sure to get the latest version of the MacroFab part libraries. The sample files for this board can be found in the Macro_Articles GitHub repository where you should locate the .brd and .sch files for the AVR_Tag-Connect board.

Pin-out for the Tag-Connect

The pin-out for the TC2030-IDC connector for AVR ISP is below. Figure 1 shows the pin-out on the PCB board side. Figure 2 shows the pin-out for the 02×03 header for the programmer side.

Figure 1: Pinout for the TC2030-IDC connector for AVR ISP.

Figure 1: Pinout for the TC2030-IDC connector for AVR ISP.

Figure 2: Pinout on the 02×03 Header side of the TC2030-IDC cable.

Figure 2: Pinout on the 02×03 Header side of the TC2030-IDC cable.

AVR_Tag-Connect Example Board

The AVR_Tag-Connect board is a bare bones example of the minimum needed to get an ATmega328P working and programmed. The part that will connect to the Tag-Connect cable is called “CON_02X03_AVRISP_TC2030-IDC” and can be found under the MF_Connectors library (Figure 3). The schematic for the AVR_Tag-Connect board is shown on Figure 4 and the board layout is shown on Figure 5.

Figure 3: The MF_Connectors library for Eagle showing the CON_02X03_AVRISP_TC2030-IDC.

Figure 3: The MF_Connectors library for Eagle showing the CON_02X03_AVRISP_TC2030-IDC.

Figure 4: Schematic for the AVR_Tag-Connect example board.

Figure 4: Schematic for the AVR_Tag-Connect example board.

Figure 5: Board layout for the AVR_Tag-Connect example board.

Figure 5: Board layout for the AVR_Tag-Connect example board.

Example Arduino Code

Now that the board is built, we can test it with some example code (Figure 6).

To test if the AVR_Tag-Connect example board is working we are going to use a modified version of the Blink program that is included in the Arduino IDE. The LED on the AVR_Tag-Connect board is connected to PB0 which corresponds to Digital Pin 8 in the Arduino world. The code can be found here or copied from below. The code should blink the LED D1 on the board.

void setup() {
    pinMode(8, OUTPUT);
}

void loop() {
    digitalWrite(8, HIGH);
    delay(1000);
    digitalWrite(8, LOW);
    delay(1000);
}

Programming the AVR_Tag-Connect Example Board

Figure 7: Setup for programming the AVR over Tag-Connect.

Figure 7: Setup for programming the AVR over Tag-Connect.

To connect the AVR_Tag-Connect example board to our AVR ISP programmer we are going to use the AVRISP2TC board. You can plug the TC2030-IDC-NL Tag-Connect cable directly into most AVR ISP programmers, but we want to provide power to the example board. To provide power to the AVRISP2TC board we need to connect the Tag-Connect cable to the AVR ISP programmer AND to an external source of power. In this case we will be using USB power, which reduces how many cables that are needed to connect to the AVR_Tag-Connect example board during programming, which also speeds up production programming. See Figure 7 for how to connect up the AVRISP2TC board to your AVR ISP programmer.

Setup the Arduino IDE by selecting the board to be the “UNO” and then choose the programmer you are using. In our case we are using a USBASP compatible programmer (Figure 7). Then go to Sketch -> Upload Using Programmer (Figure 8). This should flash the ATmega328P on the AVR_Tag-Connect example board and start flashing the LED! See Figure 9 for blinking goodness.

Figure 8: Arduino IDE uploading using programmer.

Figure 8: Arduino IDE uploading using programmer.

Figure 9: Configuring the Arduino IDE.

Figure 9: Configuring the Arduino IDE.

Final Steps

Now just power up the board and you should have a nice blinking LED!

Figure 11: Macro_Duino layout in Eagle. Check out the rad silkscreen on the back!

Figure 11: Macro_Duino layout in Eagle. Check out the rad silkscreen on the back!

Using this example – engineers, designers, and makers should be able to easily add the Tag-Connect connector to their AVR projects and Arduino based designs. This should help lower the cost of products by reducing BOM costs and reducing the time to program the device.

I’ve made a “Macro_Duino” which is an Arduino compatible board that uses Tag-Connect and USB Type-C (See Figure 11). I will have an article in a month or so that will feature this board.

Related Topics
PCB Antenna Design: A Step-by-Step Guide

Step-by-step guide to the PCB antenna design process, providing practical tips to help you successfully integrate the antenna into your wireless product.

Top 10 Electronics Podcasts You Should Listen To

This curated list of top electronics podcasts is tailored for those trying to keep up with the rapidly evolving tech world.

MacroFab's Certifications Benefit PCBA Production

Your PCBA production must be secure and reliable for your products to compete in the market. We have listed our certifications and how they benefit you.

About MacroFab

MacroFab offers comprehensive manufacturing solutions, from your smallest prototyping orders to your largest production needs. Our factory network locations are strategically located across North America, ensuring that we have the flexibility to provide capacity when and where you need it most.

Experience the future of EMS manufacturing with our state-of-the-art technology platform and cutting-edge digital supply chain solutions. At MacroFab, we ensure that your electronics are produced faster, more efficiently, and with fewer logistic problems than ever before.

Take advantage of AI-enabled sourcing opportunities and employ expert teams who are connected through a user-friendly technology platform. Discover how streamlined electronics manufacturing can benefit your business by contacting us today.