projects:avrprogrammer
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projects:avrprogrammer [2013/01/13 14:16] – [Idea] mkucia | projects:avrprogrammer [2013/01/16 15:00] (current) – [AVR programmer for begginers] mkucia | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== AVR programmer for begginers ====== | ||
+ | <WRAP center box > | ||
+ | This project is for educational purposes only. | ||
+ | |||
+ | I AM NOT RESPONSIBLE FOR ANY INJURY OR DAMAGE CAUSED BY USE OF THIS INFORMATION. | ||
+ | </ | ||
+ | |||
+ | Currently popular programmers have the following disadvantages: | ||
+ | |||
+ | * Relatively expensive | ||
+ | * Complicated - Presented programmer requires minimum amount with functionality tradeoff. | ||
+ | * Require another programmer to start working! | ||
+ | |||
+ | The code is based on project that is a part of LUFA framework (Lightweight USB Framework for AVRs by Dean Camera): [[http:// | ||
+ | |||
+ | ===== Programmer advantages ===== | ||
+ | * Thanks to build-in USB bootloader another programmer is not required to get the device running. | ||
+ | * Allows powering target device. | ||
+ | * All parts are in SMT technology, therefore PCB does not require drilling | ||
+ | * Only 5 elements require special attention to package direction (harder to make mistake) | ||
+ | * Works with AVR Studio or AVRDUDE (selectable by firmware) | ||
+ | * Low cost | ||
+ | * Small | ||
+ | * 4 [MHz] rescue clock output | ||
+ | * ISP, PDI and TPI programming interfaces | ||
+ | * True USB (unlike USBASP) | ||
+ | |||
+ | ===== Schematics ===== | ||
+ | {{: | ||
+ | {{: | ||
+ | |||
+ | ===== BOM ===== | ||
+ | |||
+ | ^ Element ^ Wartość ^ Opis ^ | ||
+ | | IC1 | AT90USB162 | microcontroller | | ||
+ | | USB | - | solder field for USB wire | | ||
+ | | F1 | 500 [mA] | Polymer fuse | | ||
+ | | R1 R2 | 22 [Ω] | USB-line impedance-match resistors | | ||
+ | | C1 | 1 [uF] | 3V3 USB voltage stabiliser capacitor ((for AVR USB peripheral)) | | ||
+ | | C3 C4 | 33 [pF] | oscillator capacitors | | ||
+ | | Y1 | 16 [MHz] | quartz oscillator | | ||
+ | | C2 | 100 [nF] | power bus decoupling capacitor | | ||
+ | | C5 | 10 [uF] | power bus decoupling capacitor | | ||
+ | | R3 | 1 [kΩ] | pull resistor | | ||
+ | | R4 | 1 [kΩ] | bootloader line pullup resistor | | ||
+ | | R5 R6 | 1k ÷ 220 [Ω] | LED resistors | | ||
+ | | LED1 LED2 | Signal LEDs | | ||
+ | | | | Goldpin headers | | ||
+ | |||
+ | ===== Launching ===== | ||
+ | - Check all components and connections | ||
+ | |||
+ | ==== Software ==== | ||
+ | |||
+ | 1. Download required tools: | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * (Extra) [[http:// | ||
+ | Linux users should download appropriate tools and use them accordingly to their OS. | ||
+ | |||
+ | <WRAP center important > | ||
+ | Code from LUFA requires modification: | ||
+ | </ | ||
+ | |||
+ | 2. Connect device to the PC. You should see a new device using __Device Manager__ or __USBView__. Linux users can use '' | ||
+ | |||
+ | 3. Install DFU drivers from Atmel FLIP directory. (Linux users should follow instructions for DFU programmer). | ||
+ | |||
+ | 4. If user compiled the firmware on his own, he can use a make script to program the device. If user use precompiled code: | ||
+ | - Run Atmel FLIP | ||
+ | - Select __Device__-> | ||
+ | - Select __Settings__-> | ||
+ | - When window __USB Port Connection__ opens choose __Open__ | ||
+ | - Select __File__-> | ||
+ | - In the __Operations Flow__ tab click __Run__ | ||
+ | - Close Atmel FLIP | ||
+ | |||
+ | 5. Reset programmer trough re-plugging it from PC USB port. Among USB devices user should see a new device. Drivers for it are located in the libUSB-win directory. | ||
+ | |||
+ | 6. If our system does not accept unsigned driver user need to generate appropriate INF file using __inf-wizard__ | ||
+ | |||
+ | <WRAP center tip> | ||
+ | If you have AVRStudio installed your system most likely has [[http:// | ||
+ | </ | ||
+ | ===== How to use programmer ===== | ||
+ | If you use AVRDude please use following scheme: | ||
+ | < | ||
+ | |||
+ | |||
+ | ===== Firmware upgrade ===== | ||
+ | MCU manufacturer uploads bootloader to the chip during fabrication process. Bootloader code is located at the end of program memory. After reset PC (program counter) is " | ||
+ | After firmware upload bootloader does not start automatically. We can force MCU to jump directly into bootloader code after reset. To do so: | ||
+ | * Pull-down HWB (HardWare Boot) line to the ground [1] | ||
+ | * Reset MCU trough pulling reset line to the ground. [2] (HWB must be pulled down during reset!) | ||
+ | Schematic below shows point you should short (programmer must be connected to the PC during the process). | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Metal tool such as callipers can be used. One of the signals can be pulled using GND wire from the programmer pin header. | ||
+ | |||
+ | <WRAP center important > | ||
+ | Take attention to the procedure. Accidental shorting of power line to the ground might influence your PC. I have marked the power line by red, ground plane by colour blue and signal lines to be pulled-down by violet. | ||
+ | </ | ||
+ | |||
+ | ===== Files ===== | ||
+ | * {{: | ||
+ | * {{: |