Coder Social home page Coder Social logo

xthanhn / mcuprog Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 7.15 MB

MCUprog UPDI is a windows program with CLI and GUI for programming various Microchip MCU devices using Microchip CMSIS-DAP based debuggers and standard TTL serial port.

License: MIT License

Python 99.98% Batchfile 0.02%
updi-programmer updi pyupdi pymcuprog avr attiny atmega microchip pickit4 tinyavr

mcuprog's Introduction

MCUprog UPDI

MCUprog UPDI is a windows program with CLI and GUI, is used for programming various Microchip MCU devices using Microchip CMSIS-DAP based debuggers and standard TTL serial port.

I create this tool for my personal project and focus on UPDI programming interface only, so I name it as MCUprog UPDI.

MCUprog UPDI supports newest MCU from microchip. It works well with new AVR 0-Series, 1-Series and 2-Series using UPDI programming interface.

You can use it directly on windows without Python. Checkout releases

Notice

This soruce code is modified and used to build Windows application. it does not compatible original build.

Serial UPDI

MCUprog UPDI can be used as Serial UPDI programmer using a standard TTL serial port

If you use MegaTinyCore by SpenceKonde version from 2.3.2, programming speed can be as high as 460800 baud. Checkout docs for SerialDUPI from SpenceKonde

Example connection, for detailes please check above link. Be sure to connect a common ground, and use a TTL serial adapter running at the same voltage as the AVR device

Vcc                     Vcc                     Vcc
+-+                     +-+                     +-+
 |                      |                       |
+---------------------+ |                       | +--------------------+
| Serial port         +-+                       +-+  AVR device        |
|                     |      +----------+         |                    |
|                  TX +------+  1k-4.7k +---------+ UPDI               |
|                     |      +----------+    |    |                    |
|                     |                      |    |                    |
|                  RX +----------------------+    |                    |
|                     |                           |                    |
|                     +--+---------------------+--+                    |
+---------------------+  |                     |  +--------------------+
                        +-+                   +-+
                        GND                   GND                        

Pickit 4 UPDI

                                         Vcc
                                         +-+
                                           |
        +---------------------+            |  |-------------------+
        | Pickit4       2-VDD +------------+--+   AVR device      |
        |                     |               |                   |
        |               3-GND +---------------+ GND               |
|USB|---|                     |               |                   |
        |               4-PGD +---------------+ UPDI              |
        |                     |               |                   |
        |                     |               |                   |
        +---------------------+               |-------------------+

Usage

MCUprog UPDI can be used as a command-line interface. GUI version will release soon.

CLI examples

When installed using pip, MCUprog UPDI CLI is located in the Python scripts folder.

Example 1: test connectivity by reading the device ID using Curiosity Nano:

mcuprog ping

Example 2: write contents of a hexfile to flash using Curiosity Nano:

mcuprog write -f app.hex

Example 3: interface with UPDI using pickit4 and erase flash

mcuprog -d attiyy1626 erase

Example 4: interface with UPDI using TTL serial port

mcuprog -i uart -u com1 -c 115200 -d attiny1626 reset

Example 5: write content of hexfile to flash

mcuprog -i uart -u com1 -c 115200 -d attiny1626 write -f app.hex

Example 6: get voltage of devices using pickit4

mcuprog getvoltage

For more examples see on pypi.org

Supported devices and tools

MCUprog UPDI is primarily intended for use with PKOB nano (nEDBG) debuggers which are found on Curiosity Nano kits and other development boards. This means that it is continuously tested with a selection of AVR devices with UPDI interface as well as a selection of PIC devices. However since the protocol is compatible between all EDBG-based debuggers (pyedbglib) it is possible to use MCUprog UPDI with a wide range of debuggers and devices, although not all device families/interfaces have been implemented.

Debuggers / Tools

MCUprog UPDI supports:

  • PKOB nano (nEDBG) - on-board debugger on Curiosity Nano
  • MPLAB PICkit 4 In-Circuit Debugger (when in 'AVR mode')
  • MPLAB Snap In-Circuit Debugger (when in 'AVR mode')
  • Atmel-ICE
  • Power Debugger
  • EDBG - on-board debugger on Xplained Pro/Ultra
  • mEDBG - on-board debugger on Xplained Mini/Nano
  • JTAGICE3 (firmware version 3.0 or newer)

Although not all functionality is provided on all debuggers/boards. See device support section below.

Devices

MCUprog UPDI supports:

  • All UPDI devices, whether mounted on kits or standalone
  • PIC devices mounted on Curiosity Nano kits, or similar board with PKOB nano (nEDBG) debugger

Other devices (eg ATmega328P, ATsamd21e18a) may be partially supported for experimental purposes

Build instruction on Windows

Open Command Prompt and run cx_freeze

pip install cx_freeze

Change working directory to source code folder and run

python build.py build_exe

Go to build/exe.win-xxx folder and run runme.bat and enjoy!

Origin Python version

  • Browse origin pymcuprog source code on github
  • Read API documentation on github

mcuprog's People

Contributors

xthanhn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mcuprog's Issues

Add --erase option to write

Would it be possible to add --erase option to the write command?
Just to erase the memory before programming the MCU.
It took me a few moments to figure out what is going on as I did only write and the verify was failing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.