µProg - tiny, fast, portable AVR programmer with SD. Part 3. Software, Memory card, files, Firmware update, Demonstration

Part 1. Features, Schematic and Description
Part 2. Usage, Function description, Speed tests

Memory card, files:
Files must be placed in memory card in proper directories. Flash memory files in “flash” directory, eeprom in “eeprom”, fusebits in “fuseb”, lockbits in “lockb”. “System” directory contains other files needed for programmer, including µControllers database file, settings file, BMP’s images. CONTENT of “SD-FILES” directory must be copied to card.

If there is no doubts when it comes to BIN or HEX files, because these are generated by compilers, then we need to describe fusebits and lockbits file structure. These are standard txt files in which we type values in hexadecimal character:

Fusebits file should contain data in sequence for: fuse low, fuse high, fuse extended – in HEX format. In example, the content of fusebits file for Attiny45 should look like that: 62DFFF. File can be longer, you can add there any comments etc, but only first 3 bytes will be used (6 chars). If chip has only two or even one settings byte, then only two or one will be used.

Structure of lockbits file is analogous to fusebits file. The only difference is that, only one byte will be used. Please note that unused bits are always must be set to “1″. In example, if we want to enable the LB0 and LB1, we need to write the “FC” value (11111100). The same rule applies to fusebits, but even if we try to enable not-existent bits (write 0), then nothing bad happens, we only get verifycation error because these unused bits will always read as “1″.

When reading fusebits or lockbits, programmer will create files accordingly to described above scheme.

Selecting appropriate memory, and then write or verify function, list of available BIN/HEX or TXT files from proper directory will be displayed. Files are not sorted alphabetical, but in the order in which there were copied. User can place any amount of files in any directory, and all of them will be listed. Select a file with UP and DN buttons, choose with RI button, or cancel operation with LE button. Screen can display 6 names at once, press DN button when last file is selected to view next card of 6 names. Cards can be only switched forward (down), after getting to the end of list, first card will be displayed.

Device supports MMC and SD cards, tested by me: (microSD) 128MB, 512MB, 1GB, 2x2GB. No restrictions with file naming, but names will be displayed in DOS 8.3 format (8 chars + extension). Longer names will be separated with tilde char (`), and if these names will be the same within first 8 chars, files will be tagged with sequential number. Diacritic chars and other weirdos will not be displayed either, so name your files in way which you can later identify them.

Поддерживаемые программатором µProg карты памяти

In plans: SDHC support.

Programming header – 6pin male connector in ISP ATMEL standard. Pin allingment is shown on drawing – plug indentation on the bottom side of pcb. I’ll suggest to make yourself an universal programming cable with combination of 6pin atmel and 10pin kanda headers. After programming ends, SCK, MOSI, MISO and RESET lines becomes transparent to the target device.

ISP коннектор

Programmer ISP

Стандартный ISP коннектор
Atmel ISP

ISP – programming speed auto-selection:

Programmer automatically selects the best programming speed (SCK line speed) before every programming operation. There is 7 regulation steps: 4MHz, 2MHz, 1MHz, 500KHz, 250KHz, 125KHz, 62,500KHz. Theoretically, 1/4 of target operating frequency will be chosen, but no always. Every time programming mode in target is initialized, programmer starts from highest frequency and performs speed test by reading signature bytes 10 times – if error occurs, speed is decreased and initialization with test are performed from the beginning. If the lowest speed fails, programmer returns “no answer” error. In case of very long programming cable it is not possible to detect speed errors in this short test. I suggest to use not longer cable than 20cm. Given SCK values apply when programmer chip runs at 8MHz.

ISP – assistant clock signal
Because programmer is battery-powered, i resigned from using the standard feature of VCC pin (pin 5 in 6 ISP header) and there is no possibility to give supply for target chip trough this line. Instead of, assistant 8MHz clock signal is present on this line, which can be used for targets with some weird/external clock enabled. This signal is connected trough 10K resistor, so you don’t have to mod your current programming cable, no matter if you got 5V from target on this line.

Firmware update:
If newer version of firmware will show up, it can be updated in two ways:

ISP: Connect your ISP programmer into ISP-6 header and close “SLF-PRG” marked pins – programming header will become update header (just like in the USBasp programmer).

BootLoader: Device has a build-in bootloader which can update the firmware in very simple way! Get the update BIN file, rename it to “000.bin”, and place it into main (root) directory of your memory card. If after powering-up display is blank, thats good! Firmware file has been successfully recognized and device awaits for your confirmation. Hit the RI button to confirm. Flashing takes few seconds, and after success device will power-up and you should see new version on welcome screen. Now, delete “000.bin” from sd card to prevent enabling actualization mode. If you put your file according to these instructions and actualization mode will not start – you got an SD card which is not supported in actualization mode, but can be supported in programmer mode. Just try another card.

Remarks:

Fusebits: Ext:07, high:D0, low:A2
(internal 8MHz oscillator without /8 division, enabled CLKO output, brown-out detection 2,7V, reset vector at bootloader, bootloader size 4kB, EESAVE enabled).

Demonstration

Downloads

Schematics, PCB, Software (SD files, HEX, BIN) - download

http://diy.elektroda.eu/uprog-maly-szybki-przenosny-programator-avr-z-sd/?lang=en

You may have to register before you can post comments and get full access to forum.
Fragments of discussion:Full version of discussion »
  • Hello This Project is Great . Thanks to you for sharing Documents . I want to edit some features of this project . May I receive the source code of the firmware ? I deceide to add some feature to it . I post it to this forum when it's finished . Thanks Best Regards
  • The author of this article did not offer the source code - [url]http://diy.elektroda.eu/uprog-maly-szybki-przenosny-programator-avr-z-sd/?lang=en[/url]
EMS supplier