Index >> Technical support & download >> Application notes

AN24: Using SP Duo dongle with Charon 2 DK

Application example AN24 connecting SP Duo programming dongle to the Charon2 development kit module. How to connect SP Duo to the DK board over SPI as well as JTAG interface and use in the AVR studio.

The SP Duo is an In-System Programmer for Atmel's AVR series of microcontrollers. It can program using the through the SPI or JTAG standards, fast. Hardware and firmware had been developed by Embedded Creations.

For application development is working with SP Duo more comfortable, you can program over JTAG and AVR Studio does not, in contrast to standard HW STK 500, bother you with demands for FW upgrade.


SP Duo basic features

  • Two programming interfaces: SPI + JTAG
  • Supports all AVR devices using SPI or JTAG programming
  • Fast programming with JTAG
  • Fast programming with auto-adapting SPI clock
  • STK500 compatible programmer - compatible with existing PC software and IDEs that support the STK500 protocol
  • Supports all In-system-programming functions: programming + readback of Flash, EEPROM, Fuses, Lockbits, and oscillator calibration bytes
  • Programmer is firmware-upgradeable to support future AVR devices
  • RS-232 interface
  • Draws power from target, no external power supply needed


Supported AVR Devices using SPI

  • ATmega8, ATmega8515, ATmega8535, ATmega16, ATmega162, ATmega32, ATmega169, ATmega64, ATmega128, ATmega161, ATmega163, ATmega323, ATmega103
  • AT90S1200, AT90S2323, AT90S2343, AT90S2313, AT90S4433, AT90S8515, AT90S8535, AT90S2333, AT90S4414, AT90S4434
  • ATtiny12, ATtiny15, ATtiny26, ATtiny22, ATtiny13, ATtiny2313

Supported AVR Devices using JTAG

  • ATmega16, ATmega162, ATmega32, ATmega169, ATmega64, ATmega128, ATmega323


Connecting HW to the SP Duo

For proper functionality of the SP Duo along with Charon 2 DK is necessary to provide PullDown for SCK signal.

We recommend to plug in resistance in between output 7 of SCK signal on the SPI and ground. Recommended resistance is 1k to 2k. This is necessary for Charon 2 DK too.

Charon 2 DK modification (version 5.0 and before), detail on the photo:


How to use Charon 2 DK / SP Duo SPI

  1. Connect Charon 2 DK and SP Duo - cable SPI and connector SPI
  2. Connect SP Duo and PC - cable RS-232
  3. Connect power supply to Charon 2 DK
  4. Switch STK500E jumper in case of troubles during programming though it was not necessary for programming during testing.
    In case you use the jumper, do not forget to switch it off after you finish otherwise UART0 does not run (see Charon 2 DK diagram).
  5. Green LED will light up on the SP Duo

Attention: Do not switch off JTAG in fuses, if you do not configure fuses of oscillator properly, then you can program again via JTAG. But JTAG must be enabled! If not only parallel programmer or direct external clock to process helps

How to use Charon 2 DK / SP Duo JTAG

  1. Connect Charon 2 DK and SP Duo - cable JTAG and Connector JTAG
  2. Connect SP Duo and PC - cable RS-232
  3. Connect power supply to Charon 2 DK
  4. Green LED will light up on the SP Duo


Programming in AVR Studio

Tested versions of AVR Studio are:
- AVR Studio 4, ver.: 4.07, Build 260
- AVR Studio 4, ver.: 4.10, Build 356

Notice for use of JTAG:
  1. Set up Fuses to JTAG Interface Enabled before programming over JTAG. Program fuses over SPI, we recommend to enable JTAG always, see problem with misconfiguration of oscillator fuses
  2. JTAG can be switched off via program, to do so push RESET button during launching of programming mode

Notice: All following configuration is the same for programming over SPI cable as well as over JTAG cable.

  1. After launching AVR Studio click through to the following menu:
    Tools / Tools / STK500-AVRISP-JTAG ICE / STK500-AVRISP-JTAG
  2. Choose the right processor ATmega128 in Device :

  3. Set up Fuses
    Check following boxes :
    1. JTAG Interface Enabled
    2. CKOPT
    3. Ext. Crystal/Resonator High Freq.; Start-up time: 16K CK + 64ms;
    4. Program fuses - Program

  4. In Flash enter path to HEX file, Charon II DB Demo below

  5. Program - Program
During developing you can set up fuses Verify Device After programming because of slowing down. Do not forget to turn it back on after.



If you have already used STK500 and Charon 2 along with Charon 2 DK, then new SP Duo programator is absolutely simple and learn to use it is just a question to solder a resistor on the Charon 2 DK and set up one jumper in AVR Studio. Experience of flying programming follows
For those who do not have any experiences - do not worry, it is extremely simple to learn.



  • Can I use the SP Duo for JTAG Debugging?
    No, you can only upload or download FLASH and EEPROM memory contents or set or clear the fuses and lock bits.
  • AVRStudio offers to upgrade the STK500. Should I?
    No, the SP Duo is no STK500 or ATJTAGICE clone. Thus, the firmware upgrade offered by AVRStudio will not work on the SP Duo. Ignore this message and AVRStudio will work just fine with the current SP Duo firmware.
  • I accidentally let AVRStudio do an upgrade and the SP Duo stopped working. Can I repair this?
    In some cases it has been reported, that the AVRStudio upgrade will indeed spoil the SP Duo firmware. You can re-enable the SP Duo by uploading any original SP Duo firmware version.
  • AVR Studio shows alert ... FAILED! ... during programming over JTAG cable?
    Use the SPI cable and set up JTAG Enabled in Fuses
  • AVR Studiu shows alert ... FAILED! ... during programming over SPI?
    Turn on the Jumper STK500E on the Charon II DK or plug in 1k or 2k resistance in between output 7 of SPI connector and ground, see above Charon II DK modification