login | register
Fri 18 of May, 2012 (00:41 UTC)

V6Z80P Documentation

Similar PagesHistorys5 slideshowPrint

Serial link protocol

Created by: Administrator, Last modification: Fri 31 of Jul, 2009 (22:13 UTC)

To send a file


1. Create and send a file header packet (see format below)
2. Wait for ASCII bytes "OK" from receiver - anything else signifies an error.
3. Send file byte packet of 256 bytes.
4. Send 2 byte CRC checksum of packet
5. Wait for "OK" from receiver - anything else signifies an error.
6. Goto step 3 until all bytes sent


To Receive a file


1. Wait for file header.
(2. Test CRC checksum of header when it arrives.)
(3. Check filename is that of file required if necessary.)
4. Send ASCII bytes "OK" if checksum/filename are OK, else anyother two chars.
5. Receive 256 byte file packet
6. Receive 2 byte CRC of packet
7. Test CRC of packet
8. Goto step 4 until all bytes received.


Header Format - first 256 byte packet



$00 - $0F: ASCII filename
$10 - $11: Length of file (lo word)
$12 - $13: Length of file (hi word)
$14 - $1F: ASCII "Z80P.FHEADER" (12 chars)
$20 - $FF: All must be zero

(All words are in normal Z80 little-endian format)

See also: Serial link file format

Search


Last modif pages