====================================================================================================
jtag2updi - JTAGv2 to UPDI Bridge
====================================================================================================

https://github.com/ElTangas/jtag2updi

----------------------------------------------------------------------------------------------------
jtag2updi and all its files are not part of the eCxx library and are not covered by eCxx licenses.
----------------------------------------------------------------------------------------------------

This minimum jtag2updi source code is placed here just in case someone needs it. Please use the
above URLs to download the complete version of jtag2updi.

----------------------------------------------------------------------------------------------------

Several prebuilt firmware HEX files are included:

    JTAG2UPDI-ATmega328P-16MHz-TYPE1-LEDB5.hex  - ATmega328P (16 MHz clock)
                                                - UPDI IO type 1; UPDI pin at PD.6 (OC0A)
                                                - Indicator LED at pin PB.5

    JTAG2UPDI-ATmega328PB-16MHz-TYPE1-LEDB5.hex - ATmega328PB (16 MHz clock)
                                                - UPDI IO type 1; UPDI pin at PD.6 (OC0A)
                                                - Indicator LED at pin PB.5

README.md recommends a 4k7 series resistor. However, if it does not work (communication instability
or even error with the target AVR), try to reduce the series resistor down to 470R.

----------------------------------------------------------------------------------------------------
jtag2updi is licensed under term of the MIT License. Please refer to LICENSE file for more details.
----------------------------------------------------------------------------------------------------


====================================================================================================
Usage Examples
====================================================================================================

---------------
Build jtag2updi
---------------

Use make.sh       to build the firmware for ATmega328P.
Use make-328pb.sh to build the firmware for ATmega328PB.

Please adjust the variables inside the scripts as needed.


-------------------------
Burn jtag2updi via USBasp
-------------------------

export AVRDUDEROOT=~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17
export AVRDUDEPROG=$AVRDUDEROOT/bin/avrdude
export AVRDUDECONF=$AVRDUDEROOT/etc/avrdude.conf
$AVRDUDEPROG -C $AVRDUDECONF -c usbasp -B 1 -p atmega328p -e -u -V -U flash:w:build/JTAG2UPDI.hex:i

Please adjust the above path as needed.


------------------------------
Burn jtag2updi via serial port
------------------------------

export AVRDUDEROOT=~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17
export AVRDUDEPROG=$AVRDUDEROOT/bin/avrdude
export AVRDUDECONF=$AVRDUDEROOT/etc/avrdude.conf
$AVRDUDEPROG -C $AVRDUDECONF -c arduino -P /dev/ttyUSB0 -b 115200 -p atmega328pb -D -U flash:w:build/JTAG2UPDI.hex:i

Please adjust the above path as needed.


====================================================================================================
