µProg - tiny, fast, portable AVR programmer with SD. Part 3. Software, Memory card, files, Firmware update, Demonstration
Memory card, files:
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.
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 – 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
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.
Fusebits: Ext:07, high:D0, low:A2
Schematics, PCB, Software (SD files, HEX, BIN) - download
News on theme: