This description is also available from the Download
page as an Adobe PDF document.
The programmer communicates at 38400bps, 8 data bits,
no parity, 1 stop bit. (38400 8N1) DonkeyProg Overview - Comms protocol
---------------------------------------------------
STX= 0x02
ETX= 0x03
Programmer startup/reset
--------------------------------
Programmer sends <STX><'1'><'6'><ETX>
Programmer commands: general form
------------------------------------------------
All programmer commands and responses are in ASCII HEX format, e.g.
a data byte
of value 200 would be sent as the ASCII text characters 'C' followed
by '8'.
The checksum is calculated on all bytes in the message with the exception
of the
checksum itself and the STX and ETX characters. Checksum is calculated
BEFORE
ASCII encoding, using the formula: BYTE csum = ~(D1 ^ D2 ^ D3... ^ Dn
).
Note that STX and ETX are sent "raw", without hex encoding.
Programmer sends <STX><Opcode><Data....><Checksum><ETX>
Programmer responds <STX><'0'><'6'><ETX> for
ACK, <STX><'1'><'5'><ETX> for NAK.
Opcodes
------------
01 Enter Programming mode
------------------------------------
No data. Turns on Vcc and Vpp in the correct order, and illuminates
the LED.
02 End Programming mode
----------------------------------
No data. Turns off Vcc and Vpp, and extinguishes the LED.
03 Set Core Type
-----------------------
Data: 1 byte containing either 0 or 1. A core type of zero indicates
a device
that can only accept 8 bytes of programming data per write cycle. See
the
CPICTypes class.
04 Set Number of Pins
----------------------------
Data: 1 byte containing the number of pins on the package. (18,28 or
40). Used
to select the appropriate Vpp line for programming in the ZIF socket.
**Actually irrelevant, as all devices in this family use the Vpp1 line,
but must
be specified anyway.
05 Load Program Memory
---------------------------------
Data: Start address (UU:MM:LL) - 3 bytes, size of data payload in bytes
- 1 byte,data (max.32 bytes)
Loads and writes the data to the chip.
06 Write Program Memory
---------------------------------
No data. Obsolete.
07 Bulk Erase
-----------------
No data. Erases the entire chip.
08 Program Configuration Byte
--------------------------------------
Data: Start address (3 bytes UU:MM:LL), byte to write.
Writes the fuses, one byte at a time.
09 Read Memory Location
---------------------------------
Data: Start Address (3 bytes UU:MM:LL), number of bytes to read (max.32)
Initiates a device read of n bytes from the address specified.
This message will generate a NAK reply if unsuccessful, but if it IS
successful
will generate the next message (10) instead of a regular ACK.
10 Read data return
-------------------------
Data: Returned data (n bytes).
11 Write EEPROM location
----------------------------------
Data: Start Address (2 bytes HH:LL), Data (1 byte)
|