0% found this document useful (0 votes)
824 views27 pages

Amstrad CPC Serial Interface II User Guide

This document provides a user guide for the Amstrad CPC Serial Interface II (USIfAC II). It allows connecting the Amstrad CPC to a computer or other device via serial, USB, Bluetooth, or WiFi connection. It provides emulation of floppy disk access and new commands to load, save, copy and manage files on a connected PC or USB drive. Setup and use of the interface for different connection types is described along with example code for sending and receiving data.

Uploaded by

Brian Lorp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
824 views27 pages

Amstrad CPC Serial Interface II User Guide

This document provides a user guide for the Amstrad CPC Serial Interface II (USIfAC II). It allows connecting the Amstrad CPC to a computer or other device via serial, USB, Bluetooth, or WiFi connection. It provides emulation of floppy disk access and new commands to load, save, copy and manage files on a connected PC or USB drive. Setup and use of the interface for different connection types is described along with example code for sending and receiving data.

Uploaded by

Brian Lorp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Amstrad CPC Serial Interface II

(a.k.a USIfAC II)


User‟s Guide v1.0
(John Konstantopoulos, Dec. 2020)

Table of contents
Introduction ................................................................................................................ 2
Serial Interface Connections ........................................................................................ 4
Direct serial cable ................................................................................................... 4
CH376 USB Host module ......................................................................................... 5
Wireless connection using a Bluetooth module ....................................................... 6
Wireless connection using an ESP-8266 wifi module................................................ 7
Basic Usage .................................................................................................................. 8
Send & Receive bytes: ............................................................................................ 8
Send & Receive bytes with a WiFi module acting as TCP server: .............................. 9
Configure Interface .....................................................................................................10
RSX Commands ...........................................................................................................11
Windows PC Communication Utility ...........................................................................13
Terminal Function.................................................................................................. 15
File Copy to CPC Function ...................................................................................... 16
File Copy From CPC Function .................................................................................. 18
Image Copy Function ............................................................................................. 19
Direct Load Function .............................................................................................. 21
Configure Bluetooth Module ......................................................................................23
Configure ESP8266 WiFi Module .................................................................................24
Hints & Tips ................................................................................................................27
Introduction
Amstrad CPC Serial interface II (USIfAC II), is an evolution of a previous Design, based on a modern
powerful 18F47Q10@64Mhz 8bit PIC microcontroller, which offers many new amazing features:

- Receive buffer of 3100bytes (~3,5times than of previous interface)


- Serial port speeds of up to 1.065.000bps!
- Full 16bit address decoding,
- AMSDOS and PARADOS ROM emulation,
- 765 Floppy Disk Controller emulation,
- Ability to use a Usb storage device, by utilizing a cheap CH376 usb host module.
- New RSX commands that offer full access of PC‟s Hard Drive or a usb storage drive, for
change/create/delete directories and load/save/delete programs/games even Ascii files!
- Incredible loading speeds of up to ~20kb/sec (~4-5times faster than a real disk drive)!
- Full read/write access to DSK images of both AMSODS and PARADOS formats!
- Extra RSX commands to copy files from/to floppy disks and quick Format disks too!
- 1kb EEPROM for use as extra memory or for storing/executing your own routines.
- Includes 3 classic games, GALACHIP, PACMAN and KILLER GORILLA!
- Equipped with a reset button and a Pause switch for Amstrad CPC:
You can connect it directly to an external port raiser adapter like MX4 board:

Or directly to Amstrad‟s Expansion port using this adapter:


Serial Interface Connections
Serial interface can be used with:
(* For more details about all RSX commands, check the “RSX COMMANDS” section bellow)

Direct serial cable connection, using a usb2serial cable adapter.

(Connect ONLY Tx=Green, Rx=White, and Ground=black to serial interface pins, red cable MUST
NOT be connected to the 5V!)
After you made the proper connections, just set serial port speed to match that on PC side, using
the “|SET” Command, and then just give: “|EN” to enable Direct mode.
That‟s it!
From now on, you can access the hard disk drive of your PC,by browsing directories (|CD), receive
catalogues (|CAT), delete files (|DEL) and use directly load, run, save and cat commands, exactly
like you do with floppy disks. Note also the amazing loading speeds (that can be up to
~20kb/sec),where you can load most of the games in a couple of seconds!
Moreover, you can also select disk images (|MG) and then enable Floppy Disk controller emulation
(|FDC on CPC 664/6128, |464 on CPC 464),in order to have full read/write access on that disk
image! In 2 words, you convert the HDD of your PC, to a HUGE super fast floppy disk, directly
accessible by your Amstrad CPC! ;-)
CH376 USB Host module:

Using this module, you can access a usb storage device, like a usb flash drive! In the photo above,
you can also see what pins you need to connect to interface UART connector,using 4 small dupont
wires:
Usb flash drive must be FAT or FAT32 formatted. If you experience problems in usage (like
frequent hang-ups, delayed execution of commands, erroneous messages, or even crashes),try to
create a small partition of 256Mb and format it, using FAT file sytem. In most cases, this will solve
the problems. If not, then probably you need to change the flash drive you are using.
As a general rule, better NOT to use large capacity drives (like 32Gb or 64Gb) or very cheap ones.
Now, after proper connections, just turn on your Amstrad and give:|USB command,and you are ready
to go!
(* On CPC 464, you should give first “|464”, press reset, and then give the above command, but, you
only need to do this ONCE, after power on Amstrad)
Any usb flash drive connected to host module, is fully accessible by your Amstrad, through many RSX
commands that allows you to:
Browse, create, delete directories (|CD, |MD, |DELD),
Get catalogues (|CAT)
Load, Run, Save programs/files (Ascii files also supported),
Delete files (|DEL)
And as described above at “direct serial cable connection”, you can also select and have full
access on DSK images too!

Wireless connection using a Bluetooth module:

For direct wireless connection to a Laptop/Note book/Smart phone equipped with Bluetooth, or, two
Bluetooth modules, one connected to CPC serial interface, and the other to a usb2serial cable
adapter connected to a usb port. Check “configure Bluetooth module” on how exactly you can
set up module for use. After that, everything is the same as described in previous “direct serial
cable connection”
Wireless connection using an ESP-8266 wifi module:

This is especially useful for creating a LAN or for direct connection to internet!
Check “configure Esp8266 WiFi module” on how exactly you can set up module for use. After that,
everything is the same as described in previous “direct serial cable connection”

All of the above, are very easy to find on ebay and they cost almost nothing!(usb2serial can be found at
~1euro and other modules for 2-3euros…).

Finally, if you have an on old motherboard with on board RS232 serial port, you can‟t use it directly to
connect with serial interface, but you must use an RS232 to TTL converter between them.
Basic Usage

Interface usage, is pretty simple and straight forward. Communication with the device is accomplished
using only two ports:
&FBD1: The control port
&FBD0: The data port
And the two BASIC commands INP() for receive and OUT for send.

Send & Receive bytes:

This method can be used with direct serial/ Bluetooth module and also, WiFi module, which must be
pre-configured using the |WIFI RSX command, in order to establish a passthrough/transparent
transmission mode.

To send a byte, just give the BASIC command:


OUT &FBD0,x (x: 0-255)
Or on assembler, the instructions:
LD A,x (x: 0-255)
LD BC,&FBD0
OUT (C),A

To receive a byte, you must first check if there is any byte available at the buffer, by reading the
control port. Use the BASIC command: INP(&FBD1). If it returns „255‟, there is a byte available, if not,
it returns „1‟.So, in order to receive a byte from serial port, you just give the BASIC command:

IF INP(&FBD1)=255 THEN A=INP(&FBD0) (variable A contains the received byte)

And if you want to wait until a byte is available, you can use a small loop like:

WHILE INP(&FBD1)=1: WEND


A=INP(&FBD0)

And here is the assembly code for doing the same thing:

check_BYTE:
LD A,&FB
iN A,(&D1)
DEC A
JR Z,check_BYTE
ld a ,&FB
in a,(&D0)

Accumulator A now has the received byte.


Send & Receive bytes with a WiFi module acting as TCP server:

In order to send data using a WiFi module that is configured as TCP server (using the setservr
program), you must first execute an AT command:

AT+CIPSEND=0,X

Where X, is the length of the string to be sent. Data string follows immediately after.
Below is the BASIC routine to send a string of chars/bytes (named A$):

1000 REM SEND WiFi ROUTINE


1010 B$=STR$(LEN(A$)): C$=AT+CIPSEND=0,+RIGHT$(B$,(LEN(b$)-1))
1020 FOR k=1 TO LEN(c$)
1030 OUT &FBD0,ASC(MID$(c$,K,1))
1040 NEXT K
1050 OUT &FBD0,&D: OUT &FBD0,&A
1060 FOR k=1 TO LEN(a$)
1070 OUT &FBD0,ASC(MID$(A$,K,1))
1080 NEXT K
1090 RETURN

Receiving a byte/char, is done like with serial connection, BUT before getting the actual data, there is
always a header in the form of:

+IPD,1,X:

Where X is the number of the received bytes (or length of string).


In order to receive only the actual data, some starting bytes should be removed:
For 1-9 bytes/chars, first 13 bytes should be removed or ignored
For 10-99 bytes/chars, first 14 bytes should be removed or ignored
For 100-999 bytes/chars, first 15 bytes should be removed or ignored
For 1000-2048 bytes/chars, first 16 bytes should be removed or ignored
Configure Interface

Default serial speed of the interface is 1065600bps.


You can give various commands to the interface, using the control port, and the BASIC command:
OUT &FBD1,x
Where x is:

0: For resetting the interface (without resetting Amstrad CPC)

1: Clears receive data buffer

2: Enables a special asynchronous burst mode, for fast receiving the hole receive buffer (3100 bytes)
at once. When this mode is enabled, you don‟t use INP(&FBD1) to check if there is available byte, but
instead you receive directly data using only INP(&FBD0). When the receive buffer becomes empty,
next INP(&FBD0) will cause automatically refilling of the receive buffer (e.g. 3100bytes). This mode is
used in the file transfer utility, in order to avoid asking if there is a byte available for every byte to
receive. USE WITH CAUTION, because it will freeze Amstrad, until the receive buffer is full!

3: Disables the above mode

10: Set serial speed to 300bps


11: Set serial speed to 2400bps
12: Set serial speed to 9600bps
13: Set serial speed to 19200bps
14: Set serial speed to 38400bps (useful for setting Bluetooth module)
15: Set serial speed to 57600bps
16: Set serial speed to 115200bps (the usually default speed for Wifi Modules)
17: Set serial speed to 230400bps
18: Set serial speed to 460800bps
19: Set serial speed to 576000bps
20: Set serial speed to 31250bps useful for connecting MIDI devices
21: Set serial speed to 921600 (max speed using wireless Bluetooth modules)
22: Set serial speed to 1000000bps(connection speed for usb storage device)
23: Set serial speed to 1065600bps(max speed for serial cable/Wifi module)
These are meant to be used mostly in program codes, as you can set serial speed much more easily
using the “|SET” RSX command.

30: This is the command used by |STAT Rsx command, which returns the status of interface (UART
speed,ROM number, Status for Direct Mode,FDC emulation, DOS ROM emulation).

Also,in order to change serial interface ROM number you can give:
OUT &FBD2,x
Where x is the desired ROM number (Default number is 5). This might be useful if you have other I/O
devices connected to your Amstrad that might use the same ROM number.
For CPC464 you should use a number less of 7, and for CPC6128, a number less or equal of 15. Note
also, that you should avoid numbers 0 and 7, because they are reserved by Amstrad CPC for BASIC
and AMSDOS ROMs respectively. The new ROM number will be saved into microcontroller EEPROM
memory (except for numbers „0‟ and „7‟),and will be used from now on, so you don‟t need to give the
command every time. Finally you can check the current ROM number, using |STAT RSX command.
RSX Commands

Bellow is the list of all supported RSX commands:

- |HELP: Shows all RSX commands with short description and usage.

- |CAT: Shows catalogue of files and sub dirs.Using argument „X‟ (|CAT,'X') it will show a list of files,
starting from 'X'. With usb device, you can use more than one letter for filtering. Finally, with argument
„1‟(|CAT,1) it will give a list of DSK images in selected dir (use this,only with PC Direct Mode).

- |CD,'name': Change dir to 'name'. Without argument, moves up a dir.

- |CDR': Moves up to root directory.Use with USB Device only.

- |USB: Enables CH376 Usb Host Module,to access USB Storage Device.You need to give this
command every time after a hardware reset (by either pressing RESET button or switch off/on
Amstrad). Nevertheless, interface will still “remember” the last state of the usb device, like the directory
you were or the dsk image you selected.

- |EN: Enables Direct Mode 1 to access files from PC or USB Device program (this is done
automatically with the use of “|USB” command).This practically means that LOAD, RUN and CAT
commands, will access files (or have a catalogue) from PC or USB storage device.Note that you MUST
Enable Direct Mode, before load/run/save a game/program.

- |EN2: Enables Direct Mode 2,try this,if above Mode 1 fails to load a game/program (NOT to use with
USB device)

- |DIS: Disables Above Direct Modes to Access Disk Drive, which means that LOAD, RUN and CAT
commands will access Disk Drive again. Alternatively, you can press RESET on USIfAC II board, or
give: OUT &FBD1,4.The latter is very useful, if you happen to get “unknown command” error message,
when trying to use an RSX command.

- |FDC: Enables/Disables 765 Floppy Disk Controller (765FDC) Emulation. For accessing DSK images.
This should be used only with Amstrad CPC 664/6128.

- |464: Resets Amstrad and enables Amsdos/Parados and 765FDC emulation. Use this command, for
accesing DSK images on Amstrad CPC 464,or, Parados DSK images on all CPC models. Note also
that,in order to use USB device on CPC 464, first time after power on your Amstrad, you should
give “|464”, and then press RESET button.This must be done ONLY once, at “cold start”, after that,
you DON‟T need to do it again, no matter how many times you reset Amstrad (or even turn it off/on by
the switch)

- |MD,'name': Create directory 'name' in current Directory of a Usb storage device. For Usb Device
Only.

- |DEL,'xxx': Delete all files starting from 'xxx',from selected directory. With PC direct mode,you can
also use wild card '*' for multiple file deletion. Of course you can also give a single file name as
argument, to delete this file only.

- |DELD,'name': Delete the directory 'name' from Usb Storage Device.


- |DOS,x: Select DOS Emulation,x=1 for Amsdos or x=2 for Parados.This is used in order to determine
which DOS ROM will be used with DIRECT mode, and also, after “|464” command is given.

- |COPY,'xxx': Copies from USB Device to a Floppy disk,all files starting from 'xxx'.

- |MG,'name': Selects DSK image 'name' to access, using “|FDC” or “|464” 765FDC emulation.
When in PC DIRECT mode, you can also use it without argument, to enable automatic selection of
image,e.g. first image found in current PC directory, will be selected (and the “Auto image selection”
check box, will be checked in PC windows utility).

- |SET: A small utility for easy setting Serial port speed. On CPC464 you should give 'Run' after 'Ready'
prompt.

- |WIFI: BASIC utility for easy configure ESP8266 WiFi modules.Again,on CPC464, give 'Run' after
'Ready' prompt.

- |DSK: Utility for copying DSK images from PC to Floppy disk.

- |FORMAT: Utility for easy and quick formatting floppy disks in just 15seconds! Supports both Data
and System formats

- |2PC: Utility for copying files,from Amstrad CPC floppy disk,to selected directory on PC or USB
Device.

- |2CPC: Utility for copying files,from PC to Amstrad CPC disks.This is the equivalent of the above
“|COPY” command, but for use with PC Direct mode.

- |TER: Terminal Utility.On CPC464,give 'Run' after 'Ready' prompt

- |COM: Small Terminal for easy communication with Wifi/Bluetooth Modules.

- |WROM,'name': Write to Microcontroller‟s EEPROM,first 1022 bytes of 'name' file.

- |WROM,adr,size: Write to EPPROM,'size' bytes,starting from RAM address 'adr' - (Size


can't be more than 1022 bytes)

- |LROM,addr: Loads EEPROM contents to RAM,at 'addr' address.Note also, that, you can use an
RST3,&FC00 assembly command, in order to directly execute any code routine you have uploaded to
EEPROM.(last 1kb of selected upper rom @ &fc000-&fffd is reserved for EEPROM, last 2 bytes are
reserved for saving serial port speed and ROM number, thus you have 1022 instead of 1024 bytes
available  )

- |STAT: Shows current status of USIfAC II Interface (UART speed,ROM number,Status for Direct
Mode,FDC emulation, ROM DOS emulation )

- |SRV: Utility for easy set up a WiFi module as TCP Server.

- |GALA: Loads GALACHIP game.On CPC464 give 'Run' after 'Ready' prompt

- |PACMAN: Loads PACMAN game.On CPC464 give 'Run' after 'Ready' prompt

- |KGOR: Loads KILLER GORILLA game.On CPC464 give 'Run' after 'Ready' prompt.
Windows PC Communication Utility

I have developed a utility for PC with windows, that allows communication with Amstrad CPC:

It offers five functions:

 Terminal: A terminal for direct communication through serial/Bluetooth or Wifi modules.


 File Copy to CPC: A File Copy utility from PC directly to Amstrad CPC disk.
 File Copy From CPC: A file Copy utility from Amstrad CPC disk to PC.
 Image Copy to CPC: A dsk image copy utility from PC to Amstrad CPC disks.
 Direct Mode: Select this function for accessing files directly from your Amstrad,using either |EN
or |EN2 RSX commands.

For more details on the above functions, see next sections.


Now,in order to connect with serial interface on Amstrad CPC, you must first setup your
connection.This needs to be done only the first time, program will remember your settings, and set
them automatically every time you run the utility.
First, using the connection button on the right top, select the type of your connection (Serial or WiFi),
according to what you are using.
Then,from groupbox Serial/Bluetooth Settings you can select Com port (note: Rescan button,
allows you to rescan for serial com ports, in case you enable/disable Com ports after running the utility),
and speed for Serial/Bluetooth connection. If you use a WiFi module, connection is established from
AMSTRAD CPC (see section: configure Esp 8266 WiFi module). Make sure that Serial interface on
Amstrad CPC has the same speed settings and, if you are using Bluetooth module, the module is
properly set (see Configure Bluetooth Module section, on how exactly to do that).
Press Disconnected button, it should turn to Connected:
Terminal Function

On Amstrad CPC, give |TER RSX command,and the main terminal window appears:

On the left side, write anything, and by pressing <Return> it will be transmitted to PC. On the right side
you will receive any respond from the PC.

With terminal, you can also communicate with serial interface by sending various commands to
change port speed, clear receive buffer, get status etc. By pressing <Enter> (or <COPY> on WiFi
mode), you will get a list of all available commands. Commands are sent by pressing <Tab> and then
the desired code.

On PC side, after setting and enabling connection, select Terminal function. You can use the edit box
on the left of the <Send> button to write a message and by pressing Send button it will be transmitted
to Amstrad CPC.
File Copy to CPC Function

On Amstrad CPC, give |2CPC RSX command. You need to set the serial port speed (for WiFi mode,
don‟t forget to use |WIFI, to establish the connection) , and then, you should get a waiting for file…
message on screen:

Insert a formatted disk into Disk drive.


Run windows utility on the PC.After setting and enabling connection, select File Copy to CPC function.
Then, press Select Files button and select one or more files to transfer:
Press Open Button and file copy will begin:

On Amstrad, you will get a confirmation for each written file:

After finishing transferring the files you want, you can reset Amstrad to exit the program.
File Copy From CPC Function

On PC, after setting and enabling connection, select File copy From CPC function.
Use the Set Save Dir button, to set the save directory for the files transferred from CPC. On Amstrad
CPC, give |2PC RSX command. You will get a files catalogue of the inserted floppy disk:

Use arrows to move between files, <space> to select/unselect a file, and <Return> to execute
transfers of the selected files. By pressing <1>, you will receive DRIVE A file catalogue and by <2> ,
DRIVE B file catalogue.
Finally, with <Caps Lock> you can select/unselect all the files. This is useful if you want to transfer all
files of the disk, or if you want to invert the already selected files (e.g. all selected files will be
unselected, and all other, will be selected).
On the half bottom of the screen, you will get a list of all the selected files. Files from this list, will be
removed one by one, during the transfer process:
Image Copy Function

On PC utility program, select Image copy to CPC function. Press Select Image button to choose a dsk
image. You will get a confirmation that image is loaded successfully:

If you select a non Amsdos image (usually copy protected games) you will by notified that currently
these images are not supported:
Now,give: |DSK RSX command on the CPC, and you will get a message to insert a disk:

By pressing any key, the transfer of the selected image will begin. Using serial speed of 460800bps or
more, it should take less than a minute (~55-56seconds) to transfer a hole 180Kb disk image into any
disk (either CPC/ PC/Apple formatted or unformatted).
Now, as you might already noticed, there is also a Fast Copy check box, right next to Select image
button. By checking this, you can transfer an image to an already Amstrad Formatted disk in just
~40 seconds! If you check Fast Copy, you will be notified, for the format type needed (in most cases is
Data Format) on the disk:

This can be proved very useful if you already transfer a game image to a disk, and you want to transfer
another image on the same disk.
Direct Load Function

By selecting the Direct Load function, you practically convert the HDD of your PC to a huge storage
device for your Amstrad! Through RSX commands you can load or run a program/game (at
INCREDIBLY fast speeds, of ~20kb/sec, e.g. ~4-5 times the actual speed of a 3” disk drive!) ,
save files, delete files, change directories, even access DSK images (at slightly faster speed
than with a real disk drive)!

By giving a simple |EN or |EN2 to your Amstrad, any LOAD, RUN or CAT command you will give, it will
be redirected to PC! Using button Direct Mode Dir, you can set the loading directory and have a list of
all available files in it:

You can also use |CD,‟name‟ command to change directory (or |CD to move up a directory), directly
from you Amstrad!
About ~90% of games can be directly executed using this super fast direct mode. For the rest,
you can always use the dsk image file of the game(although in that case, access is much slower,
usually slightly faster than with a real disk drive/gotek drive).
You can find many dozens of games that already tested here.
As this method requires to have files extracted from dsk image files, i have also included the cpc loader
utility:
Using this, you can easily extract multiple dsk images instantly!

Finally, a couple of useful notes about Direct Load function usage:

 If you try to run/load a file that it doesn‟t exist, or there is an error in loading, Amstrad will give you a
“File already open” error message.

 For loading files with .BIN extension, this can be omitted (e.g. you can type: RUNGAME, instead of:
RUNGAME.BIN, regardless of the file having the BIN extension or not). But you must include
extension to load any .BAS files.

 If you have any problem loading a game/program, and reseting Amstrad doesn‟t resolve it, try to
turn off/on Amstrad, and if this don‟t work, go to PC program and select momentarily another
function (like terminal) and then set to Direct Load again (this will reinitialize the PC routine in case
it has hang/crash).
Configure Bluetooth Module

The recommended Bluetooth module is HC-05:

You can also use the HC-06 which is a bit cheaper, but it lucks the Set-Up button, which is very useful,
if you want to change the default speed of the module (9600bps).
You can easily find these on ebay or electronics shops for a few euros.
Of course you will need a pair of these, to establish a bluetooth connection between Amstrad CPC and
a PC or another Amstrad CPC. Or, you can use only one module for Amstrad CPC serial interface to
connect with a tablet or a smart phone! ;-)
Connect Bluetooth module to the USB2Serial adapter cable (Red: 5V, Black: Ground, Green: Tx-goes
to Rx pin, White: Rx goes to Tx pin). Then, connect cable‟s usb plug to a free usb port of your PC,
WHILE pressing the setup button. The red led should flash every 2-3 seconds.Now, you should set
serial speed to 38400 by giving |SET command. Then, you can easily configure Bluetooth modules
using a terminal program on PC, or the |COM RSX command on Amstrad.
First give the commands:
AT -You should get respond OK
AT+UART=X,0,0
X, can be 2400,9600,19200,38400,57600,115200,230400,460800,921600. You should get response
OK.
Now, disconnect the Bluetooth module and connect the other one (don‟t forget to press the button while
powering to enter the setup mode).Give the above commands, but also add this one:
AT+ROLE=1 –You should get response OK
This is for making the module Master. In order for two Bluetooth modules to connect to each other, one
must be Master and the other Slave. But Since all BT modules are preconfigured as Slave, you should
change one of them to Master.
Finally, power off and on the BT module (in order to exit from setup mode) and connect the other BT
module to serial interface. After a few seconds, both modules should flash twice every 3-4
seconds. This means that they are connected, and you are ready to go!
Configure ESP8266 WiFi Module

You can directly connect an ESP8266 WiFi module to serial interface.


You can either use:

Esp-07 or Esp-01/01S
The latter, will also need this 5v adapter (ESP-01 adapter):

Which will be combined to this:

You can easily find any of these, on ebay or many electronics shops, at very cheap prices, of only a few
euros. And remember to connect Tx to serial‟s interface Tx pin, and Rx to Rx pin (no swap of signals
needed).
Now, in order to use WiFi, module must be connected to an Access point and then connect to the TCP
server that is activated by the PC utility program. This can be done either manually (by giving the
appropriate AT commands), using the small terminal utility through |COM command, or more easily, by
giving |WIFI command. Program will first check for the current Wifi module serial speed, and ask you if
you want to change it.
Then, you just give the name and password of the access point (where WiFi module will be connected
to),and then, the ip address and port of the TCP server ,taken from groupbox WiFi Settings in PC
utility window program.
If everything goes well, you will get a connected! message, and then you can directly run and use any
utility you want. If there is a problem connecting to the given Access Point or TCP server, you will be
prompted for retrying or give new settings.
If for any reason you want to change TCP server‟s port number, you can do it from Wifi Settings
group box, (you will have to close and reopen the PC utility for activating the new port setting) .
Note also that, when a WiFi Connection is established, the Connection button will be automatically
enabled and connection type will be set to: Connection: WiFi. You can also have a serial connection
and a WiFi connection both activated at the same time and select which one to use by pressing the
connection type button.
In order to disable WiFi module connection you must first send a single string of: +++ (check
AT+CIPMODE command bellow) and then give the AT command: AT+CIPCLOSE to disconnect from
TCP server.
ESP8266 module use AT commands for control and communication.
You can give all AT commands using terminal program, or directly, using this small BASIC program (a$
is the AT command string):

10 FOR k=1 TO LEN(a$)


20 OUT &FBD0,ASC(MID$(a$,K,1))
30 NEXT K
40 OUT &FBD0,13: OUT &FBD0,10

Note that after giving the AT command, an: out &fbd0,13: out &fbd0,10 (CR and Line Feed) must be
also sent for proper execution!

There is a very big manual with 100‟s of commands available, but bellow, i give you the most useful
commands, for configuring the module manually:

AT+CIPMODE= 0 or 1 Sets Transmission Mode


0: normal transmission mode (must be used when WiFi acts as a TCP server)
1: UART-Wi-Fi passthrough mode (transparent transmission), this mode is used for communication
with the PC utility program. It can only be enabled in TCP
single connection mode Notes:
• The configuration changes will NOT be saved in flash.
• During the UART-Wi-Fi passthrough transmission, if the TCP connection breaks, ESP8266 will
keep trying to reconnect until +++ is input to exit the transmission. If it is a normal TCP
transmission and the TCP connection breaks, ESP8266 will give a prompt and will not attempt to
reconnect.

AT+CIPSEND Start sending data in transparent transmission mode.


Data must be sent with a 20-ms interval between each packet, and a maximum of
2048 bytes per packet.
To disable transparent transmission mode, a single packet containing „+++‟ must be received, (in
practice, you must give: out &fbd0,43: out &fbd0,43: out &fbd0,43) ESP8266 returns to normal AT
command mode.Wait for at least one second before sending the next AT command.
This command can only be used in transparent transmission mode which requires single
connection. Note also that, you CANT give AT commands when transparent transmission mode
is activated.

AT+CIPSEND=[link id],x send x bytes. Bytes/chars follow immediately after the command. Link id is
usually 0 for single connections, but can be up to 5 in a LAN situation
AT+CIPCLOSE Closes the TCP/UDP/SSL Connection.
AT+CWLAP Will list access points in range.
AT+CWJAP=yourSSID,yourWifiPassword connects to an access point
AT+CWQAP quit from acess point
AT+UART_CUR=115200,8,1,0,0 (don‟t remain after reboot/power off)
AT+UART_DEF=115200,8,1,0,0 Set UART speed (remains after reboot/power off)
AT+CWMODE = 1 (1 for standard mode , 2 for AccessPoint mode & 3 for both)
AT+CIPMUX=1 (set multiple connections, this must be set to „1‟ if you want to use module as TCP
server)
AT+CIPSERVER=1,80 (start the TCP server at port 80)
AT+CIFSR (shows WiFi module‟s ip/mac address)
ATE0 remove echo (recommended for having WiFi module act as TCP server)
AT+CIPSTO=X (server timeout, range between 0 and 7200, set to large number or 0 for never)
AT+CIPSTART=TCP,Tcp server IP,port no. Connects to a TCP server, useful for connecting many
Amstrad CPC‟s together in a WiFi network!
AT+CWSAP_DEF=<ssid>,<pwd>,<chl>,<ecn> Set up WiFi module‟s Access point
<ssid>: string parameter, SSID of AP.
<pwd>: string parameter, length of password: 8 ~ 64bytes ASCII.
<chl>: channel ID.
<ecn>: encryption method; WEP is not supported.
‣ 0: OPEN
‣ 2: WPA_PSK
‣ 3: WPA2_PSK
‣ 4: WPA_WPA2_PSK
Example: AT+CWSAP_DEF=ESP8266,1234567890,1,3

For more detailed information and examples, you can refer to the AT command manual mentioned
above.
Hints & Tips

- As a general rule, better use RESET button (instead of on/off switch) every time you want to restart
Amstrad. Also this is the proper action for any problem you might encounter.

- If you happen to get an “unknown command” error message, when trying to use any of the RSX
commands, just give: OUT &FBD1,4 and everything should work fine. Just remember to give:
“|EN” again, before load/run/save a game program.

- If you are using a usb device, remember to give “|USB”,every time after pressing RESET button
on the board. However, you DON‟T need to do that, in case of a soft reset (by pressing
<ctrl>+<shft>+<esc>). In either case, interface will remember last directory/dsk image used.
Finally, don‟t forget that, on CPC 464, first time after power on your Amstrad, you should give
“|464”, and then press RESET button. This must be done ONLY once, after initial power up, you
DON‟T need to do it again, no matter how many times you Reset Amstrad (or even turn it off/on by
the switch momentarily)

- Always use UPPERCASE letters with arguments of RSX commands when using a USB
device, for example: |CD,”B” (and not “|CD,”b”). Nevertheless Load and Run commands , support
both upper and lowercase letters.

- For loading files with “.BIN” extension, this can be omitted (e.g. you can type:RUN”GAME”, instead
of:RUN”GAME.BIN”, regardless of the file having the “BIN” extension or not). But you must include
extension to load any “.BAS” files.

- Mind that many games you will find in dsk images (especially newer ones, after late 80‟s) are NOT
designed to run on a CPC464.

- Access to DSK images on a CPC 464 (and generally whenever you use |464 command) would be a
bit slow (~20%-30% slower than a real disk drive) because Interface‟s Microcontroller, need to
emulate both “missing” IC chips of AMSDOS/PARADOS ROM and 765 Floppy Disk Controller, at
the same time! BUT, in direct mode, where you access directly files, you will get the same amazing
loading speeds as with a CPC 664/6128!

- To use arguments with RSX commands on a CPC464, you can‟t pass them directly (this is BASIC‟s
1.0 “problem”), but you need first to assign argument to a variable. For example, if you want to
change directory to “DIR1”, you can‟t just give: |CD,”DIR1” but instead:
A$=”DIR1”
And then:
|CD,@A$

You might also like