MCS Flashprogrammer Linux Drivers
Introduction
MCS Flashprogrammer is a full-featured AT89Cx051 programmer. It can issue all the available commands (read/write, erase, set lockbits). However, the only application that supports it is the infamous Bascom 8051. After analyzing the circuit a bit and reading the Atmel's datasheets, I wrote a simple Linux driver.
Internals
The programmer consist of three parts: standard i2c-parport interface, two port expanders accessing the microcontroller's pins and a dual-voltage regulator supplying Vpp.
Usage
Compile the program by typing make. If you have more than one parport, edit main.c, adjust the path appropriately (usually it should be /dev/parport0) and recompile (type make again) afterwards.
Invoke the program without any parameters to see the help:
$ ./a.out
MCS Flashprogrammer v2.0 for Linux
(c) 2005 Kosma Moczek
Usage: ./a.out <operation> [<file>]
Operations are:
--read - read chip
--write - write chip
--erase - erase chip
--ident - get chip model
--lock1 - set lockbit 1
--lock2 - set lockbit 2
--prepare - set ports to a safe state
Read/write operations require filename parameters.
Short switches also work, eg. -r -w -e -i -1 -2
Be aware that the code is somewhat experimental and might not always work. Remove the i2c-parport module before using it (rmmod i2c-parport). Also, remember that the supplied files must be binary and must fit exactly (i.e. 2048 bytes for AT89C2051) in the microcontroller you are using.
Usually, the program will be used as follows:
# do not insert chip before calling 'prepare'! ./a.out --prepare # insert chip ./a.out --identify # make sure the chip was detected ./a.out --erase ./a.out --write program.bin ./a.out --read test.bin cmp program.bin read.bin # verify that the files are identical
Downloads
- Source code [3.6k]