Utilities: See the folder (“PC-based-apps”)
Two Windows based tools for PC-V6Z80P communications are supplied:
(There is also a Linux version of SerialTX called sendv6 - see the folder Contributions/Daniel.)
The V6Z80P's default baud rate is 115200, format 8-N-1 (57600 baud can also be selected).
To send a file to the V6Z80P's memory from the PC, in FLOS enter:
RX filename address [bank]
Notes
FLOS will say “Waiting for file…”. On the PC Serial Link util, click “send file”, and choose a file to send.
To send a file from the PC direct to the V6Z80P's SD card (current directory) use the command:
FRX [path]
To send a file from the V6Z80P's memory to the PC, click “Receive File” on the PC serial link util, then in FLOS enter:
TX filename address length [bank]
The Serial Link PC util will time out after a few seconds if no files are forthcoming.
To send a file from the V6Z80P's SD card (current directory) to the PC use the command:
FILETX filename
To send a file from the PC command line to the V6Z80P use SerialTX.exe as follows:
SerialTX filename [COMn] [Baud]
COMn is the serial port you're using on the PC (EG: COM1, COM2 etc) If this is not supplied SerialTX will scan the PC and use the first serial port it finds.
If Baud is not supplied, the default 115200 baud is used. The only other option is 57600 (if this is used, then the COM port must be specified also).
(Obviously you need to use RX, FRX or have a serial requester waiting at the V6Z80 end.)
SerialTX.exe can be set up as a helper tool in various text editors allowing files to be assembled and passed to the V6Z80P with little interaction. It can also be handy to add it to the Windows “Send to” list allowing files to sent using the right click context menu.
(used by RX/TX commands and PC-side utils)
(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)
Bytes from the file, sent in 256 byte packets followed by a 2 byte checksum word.
The calculation is described as a “standard CRC-CCITT that uses polynomial $1021” and produces a 16 bit output, the Z80 code (slow, unoptimized) to generate it is as follows:
;--Z80 code to make CRC -------------------------------------------------------- ; makes checksum in HL, src addr = DE, length = C bytes crc_checksum ld hl,$ffff crcloop ld a,(de) xor h ld h,a ld b,8 crcbyte add hl,hl jr nc,crcnext ld a,h xor 10h ld h,a ld a,l xor 21h ld l,a crcnext djnz crcbyte inc de dec c jr nz,crcloop ret ;----------------------------------------------------------------------------------