Ecological recycle of the Patmel 3 programmer
---------------------------------------------

The old Patmel 3 programmer equipped with a new firmware together with a new PC uploader can be used for uploading programs to various Atmel chips AT89S... series, if their configuration is properly made.

serisp.hex	- program for AT89S51 (if you have no other way, you can upload it to your chip with a makeshift programmer described on http://piskoviste.rosomak.cz/index.php?art=182 ).
serisp.asm	- source of the program for AT89S51 (can be compiled with MCU8051IDE).
uploader.cpp	- control program for uploading programs using your new makeshift programmer. Compile it on your system using command "g++ -o uploader uploader.cpp".
uploader.conf	- configuration file containing configuration for several chips. Note, that there are separate configurations for in-programmer and in-system programming (this is done yet only for AT89S2051).

Using of the control program:

Input is pure binary file. You can prepare it from Intel's HEX file using following command: "srec_cat yourprogram.hex -intel -o yourprogram.bin -binary"

Connect the programmer to serial port of your machine. You need to have permission to use it. Of course, you can use an override with the sudo command.

The syntax of control program is:

uploader <ic_type> <serial_port_device> <command> (<command> ...)

<ic_type>		- type of IC you are working with - must correspond with its name in uploader.conf
<serial_port_device>	- path to special file of the serial port
<command>		- erase | read <destination_binary_filename> | write <source_binary_filename>

Example of use:

(connect the programmer to the serial port - in this case the USB to RS232 cable is used - and switch the Vcc on)

uploader at89s51 /dev/ttyUSB0 erase write mytestprg.bin read mytestprg.check.bin

(now you can switch the Vcc off and compare the mytestprg.check.bin to mytestprg.bin to verify success of programming process; note, that the whole memory of the MCU is read, even if has been programmed partially)

There are two known hardware problems with 40-pin MCUs in the Patmel 3 programmer:
- the clock signal for the programmed MCU is led directly from the programming MCU's oscillator; this causes time to time that the programmed MCU doesn't respond (error message "incorrect reply from MCU.")
- there is a hardwired reset for the programmed MCU, the uploader has no way to restart the communication with it; so if you need to execute uploader repeatedly, cycle the power to the programmer (switch it off and on again).

Copyright (C) 2016 Petr Borsky
This fileset is distributed "as-is", absolutely without any warranty. Their author only hopes it will be helpful.
Anybody is permitted to use, modify, distribute and/or redistribute it strictly for non-commercial purposes.
Nobody is permitted to remove neither this README.txt nor this copyright note from the fileset if it is (re)distributed.