Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
AVR microcontrollers
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Programming interfaces == <!--NOTE: This section was originally started by copying http://en.wikibooks.org/wiki/Embedded_Systems/Atmel_AVR#Programming_Interfaces on February 20, 2011 --> There are many means to load program code into an AVR chip. The methods to program AVR chips varies from AVR family to family. Most of the methods described below use the <span style="text-decoration: overline">RESET</span> line to enter programming mode. In order to avoid the chip accidentally entering such mode, it is advised to connect a pull-up resistor between the <span style="text-decoration: overline">RESET</span> pin and the positive power supply.<ref>{{cite web|url=http://www.atmel.com/images/atmel-2521-avr-hardware-design-considerations_applicationnote_avr042.pdf |archive-url=https://web.archive.org/web/20141222084848/http://www.atmel.com/Images/Atmel-2521-AVR-Hardware-Design-Considerations_ApplicationNote_AVR042.pdf |archive-date=2014-12-22 |url-status=live|title=AVR Hardware Design Considerations|date=Jun 2015|publisher=Atmel Corporation|page=5|type=application note|access-date=14 Jun 2015|quote=The reset line has an internal pull-up resistor, but if the environment is noisy it can be insufficient and reset can therefore occur sporadically.}}</ref> === ISP === [[File:Isp_headers.svg|thumb|6- and 10-pin ISP header diagrams]] The [[in-system programming]] (ISP) programming method is functionally performed through [[Serial Peripheral Interface Bus|SPI]], plus some twiddling of the Reset line. As long as the SPI pins of the AVR are not connected to anything disruptive, the AVR chip can stay soldered on a [[Printed circuit board|PCB]] while reprogramming. All that is needed is a 6-pin connector and programming adapter. This is the most common way to develop with an AVR. The Atmel-ICE device or AVRISP mkII (Legacy device) connects to a computer's USB port and performs in-system programming using Atmel's software. AVRDUDE (AVR Downloader/UploaDEr) runs on [[Linux]], [[FreeBSD]], [[Windows]], and {{nowrap|[[Mac OS X]]}}, and supports a variety of in-system programming hardware, including Atmel AVRISP mkII, Atmel JTAG ICE, older Atmel serial-port based programmers, and various third-party and "do-it-yourself" programmers.<ref>{{cite web|url=http://savannah.nongnu.org/projects/avrdude|title=AVRDUDE programmer|publisher=Savannah.nongnu.org|access-date=2012-09-19}}</ref> === PDI === The Program and Debug Interface (PDI) is an Atmel proprietary interface for external programming and on-chip debugging of XMEGA devices. The PDI supports high-speed programming of all non-volatile memory (NVM) spaces; flash, EEPROM, fuses, lock-bits and the User Signature Row. This is done by accessing the XMEGA NVM controller through the PDI interface, and executing NVM controller commands. The PDI is a 2-pin interface using the Reset pin for clock input (PDI_CLK) and a dedicated data pin (PDI_DATA) for input and output.<ref>{{cite web|url=http://ww1.microchip.com/downloads/en/AppNotes/doc8282.pdf |archive-url=https://web.archive.org/web/20200325021625/http://ww1.microchip.com/downloads/en/AppNotes/doc8282.pdf |archive-date=2020-03-25 |url-status=live|title=PDI programming driver|access-date=2012-09-19}}</ref> === UPDI === The Unified Program and Debug Interface (UPDI) is a one-wire interface for external programming and on-chip debugging of newer ATtiny and ATmega devices. UPDI chips can be programmed by an Atmel-ICE, a PICkit 4, an Arduino (flashed with jtag2updi),<ref>{{Cite web|url=https://github.com/ElTangas/jtag2updi|title = GitHub - ElTangas/Jtag2updi: UPDI programmer software for Arduino (Targets Tiny AVR-0/1/2, Mega AVR-0 and AVR-DA/DB MCUs)|website = [[GitHub]]|date = 17 December 2021}}</ref> or though a UART (with a {{nowrap|1 kΞ©}} resistor between the TX and RX pins) controlled by Microchip's [[Python (programming language)|Python]] utility pymcuprog.<ref>{{cite web |title=pymcuprog - Python MCU programmer |url=https://github.com/microchip-pic-avr-tools/pymcuprog#serial-port-updi-pyupdi |website=Github |publisher=Microchip PIC&AVR Tools |access-date=18 November 2022 |date=13 November 2022}}</ref> === High-voltage serial === High-voltage serial programming (HVSP)<ref>{{cite web|url=http://support.atmel.no/knowledgebase/avrstudiohelp/mergedProjects/AVRDragon/AVRDragon_HVSP_Description.htm|title=HVSP_Description|publisher=Support.atmel.no|url-status=dead|archive-url=https://web.archive.org/web/20091012094540/http://support.atmel.no/knowledgebase/avrstudiohelp/mergedProjects/AVRDragon/AVRDragon_HVSP_Description.htm|archive-date=2009-10-12|access-date=2012-09-19}}</ref> is mostly the backup mode on smaller AVRs. An 8-pin AVR package does not leave many unique signal combinations to place the AVR into a programming mode. A 12-volt signal, however, is something the AVR should only see during programming and never during normal operation. The high voltage mode can also be used in some devices where the reset pin was disabled by fuses. === High-voltage parallel === High-voltage parallel programming (HVPP) is considered the "final resort" and may be the only way to correct bad fuse settings on an AVR chip. === Bootloader === Most AVR models can reserve a [[bootloader]] region, 256 bytes to 4 KB, where re-programming code can reside. At reset, the bootloader runs first and does some user-programmed determination whether to re-program or to jump to the main application. The code can re-program through any interface available, or it could read an encrypted binary through an Ethernet adapter like [[Preboot Execution Environment|PXE]]. Atmel has application notes and code pertaining to many bus interfaces.<ref>{{cite web|url=http://www.atmel.com/dyn/resources/prod_documents/doc2541.pdf |archive-url=https://web.archive.org/web/20050516025202/http://www.atmel.com/dyn/resources/prod_documents/doc2541.pdf |archive-date=2005-05-16 |url-status=live|title=DES-encrypted AVR Bootloader|access-date=2012-09-19}}</ref><ref>{{cite web|url=http://www.atmel.com/dyn/resources/prod_documents/doc2589.pdf|title=AES-encrypted AVR Bootloader|access-date=2012-09-19}}</ref><ref>{{cite web|url=http://www.atmel.com/dyn/resources/prod_documents/doc2589.pdf|title=XMEGA Bootloader|access-date=2012-09-19}}</ref><ref>{{cite web|url=http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf |archive-url=https://web.archive.org/web/20060628210714/http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf |archive-date=2006-06-28 |url-status=live|title=AVR USB Bootloader|access-date=2012-09-19}}</ref> === ROM === The AT90SC series of AVRs are available with a factory mask-ROM for program memory, instead of flash.<ref>{{cite web|url=https://pdfslide.net/reader/f/atmel-avr-wikipedia-the-free-encyclopediapdf|title=Atmel's Self-Programming Flash Microcontrollers|format=PDF|access-date=12 March 2020}}</ref> Because of the large up-front cost and minimum order quantity, a mask-ROM is only cost-effective for high-production runs. === aWire === aWire is a new one-wire debug interface available on the new UC3L AVR32 devices.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)