General Category > Amstrad CPC hardware

Universal Serial Interface for Amstrad CPC (a.k.a USIfAC)

(1/50) > >>

ikonsgr:
 Hello everyone,

What i'm going to present you here,is a "Universal" serial interface for Amstrad CPC (or USIfAC (Universal Serial Interface for Amstrad CPC)  naming courtesy of Gunhed  :) )
Although i know that other serial interfaces for amstrad cpc already exist, this one offer many innovations that makes it a rather modern, cheap and useful solution:
 
 
DSCN1147.JPG
(109.95 kB, 605x422 - viewed 2058 times)

- Completely "from the scratch" project,based on a modern 8bit PIC 16F1579@32Mhz MicroController!
(all other serial interface projects, use the rather old, expensive and bulky 40pin 16C550 UART chip)

- Very easy to use by only two BASIC commands, INP() and OUT!

- Completely free DIY project, rather easy and cheap to make (total cost for the DIY kit +all extra parts, would be less than 6euros!).

- SUPER FAST loading of many games/programs, DIRECTLY from the PC!(see "Direct Load" function in User's Guide, and here is a list of games already tested and working)

- Easy and fast transfer of dsk images directly to Amstrad CPC disks!

- Easy and fast individual file transfer (check link for 1000's of games extracted from dsk images)directly from/to Amstrad's Disks!

- Equipped with a reset button and a pause switch for Amstrad CPC!


And here is a small demonstration: Playing PONG in network with a Commodore 64!   :D

You can find everything you will need here, it contains:

-The circuit diagram,
-The gerber files for the pcb,
-The bill of materials,
-The Pic 16F1579 microcontroller Hex file (you will need a pickit2/3 in order to flash it into PIC 16F1579),
-Amstrad’s utility dsk image disk (you can transfer it to a real disk with CPCDISKXP using an ide or a usb 3.5" floppy Drive),
-The PC utility program,along with CPCLOADER (for easy extracting dsk images) and a folder including the utility disk files,for direct loading from PC using "Direct Load" function,
-The User's Guide.

I have also developed a windowsprogram which you can use it to comunicate with Amstrad:

 
driect_scr.png
(69.01 kB, 800x553 - viewed 1879 times)

It can be used for terminal file transfer, dsk image transfer, and RUN many games/programs directly from PC!

Serial  Interface is equipped with a big receive buffer of 920 bytes (more than 3.5X the buffer of the classic 16C550 UART chip, or booster/booster+ adapters), and can achieve speeds up to 576000bps, using a direct usb2serial cable adapter, or 460800bps using a Bluetooth or Wifi Module.
Serial interface can be used with a  USB2serial cable adapter (PL2303HX), an HC-05 Bluetooth module, a WiFi module (an ESP-07 or an ESP-01 along with a 5V adapter) or even this Usb host board which, depending on loaded software, can host many different USB devices, like USB modems, flash drives, keyboard,mouses, joysticks, Midi interfaces etc. So, if you connect this usb host module to the serial inerface ,ALL of these devices can potentially communicate with amstrad cpc!
In practice, any device with a UART interface can be connected!

So, first let's take a look at the circuit. And this is the pcb board.

You can connect it to an external port raiser adapter like MX4 board, or directly to Amstrad’s Expansion port using this adapter.
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.
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.

You can also give various commands to the interface (OUT &FBD1,x), using the control port, like reset interface, change serial port speed, clear receive buffer and some other.


And If anyone wants a ready made Serial interface, i can offer:

- A ready made board for 8euros+shipping (2.5euros for standard, 5euros registered/tracked).

- A Basic DIY kit for 4euros,including postage. You will get the PCB board and PIC 16F1579 (flashed with the program).All other parts can be easily found in any electronic parts shop,check Bill of Materials here)

- A Complete DIY kit for 6euros,including postage. This DIY kit will have everything:PCB board+PIC 16F1579 (flashed with the program)+4002Logic Chip+DIP sockets+Pause switch+reset button+resistors+caps+bjt+diode

- Extra Edge connector adapter costs +2euros.

- Extra Centronics connector adapter costs +5euros.



 Having a cheap, easy to make and easy to use Serial port, and considering the strong and vivid program community for Amstrad CPC, it could open many prospects for future developments, like LAN or WAN games, Apps for communicating with smart phones and tablets, even a basic Web client...  ;)

GUNHED:
Very nice project indeed. However that's the same we already have with MiniBooster and CPC-Booster+. But cheaper and probably more easy though.  :)

What I would love to see are:
- A way bigger buffer, because with that high transfer rates 1 KB buffer is filled up literally in no time. So a buffer of at least 16 KB would be helpful.
- Either a 2nd port or a RS4xx, to enable a network of a ring of CPC computers. Great fun on meetings.

That's just my 3 Pfennige, since I'm more a software person I don't know if this is doable.  :)

Good luck with it anyway, look great!  :)

ikonsgr:
Well, i don't think that  MiniBooster and CPC-Booster+ are "competitive" to this project. For one thing, they offer much more than a serial port (A/D converters, PWM channels etc pretty much like MULTI purpose I/O device), and for that, are surely much more complicated and expensive to make. Moreover,they are pretty old projects, so i really don't know if they are available any more...  ::)
My intention was to design a small, cheap and easy to make (and use) serial port, that everyone with a soldering iron and a few euros, could make it by himself!  ;)


As for your requests,at one thing, it's difficult to find 8bit Microcontroller with 16+KB of ram, and they would be rather expensive too.But i think that a nearly 1Kb receive buffer, is already pretty much (16C550 UART and booster boards have much smaller buffers of ~250bytes), and believe me, if you use assembly code, it's easy to empty the buffer really fast too! :-) In anycase, you will always need to have some transfer control for fast speeds ,regardless of the buffer size you have. One good solution for example,is, for the sender to transmit a packet of bytes at the size of buffer at once, and then wait for acknowledge, to send the next. As for the networks, it's easy to make one ,using the WiFi modules! These WiFi ESP8266 modules can either connect or create TCP servers! So, you can have one Amstrad with a serial interface and a WiFi module running a TCP server, all other amstrads can connect to this server as TCP clients,and here is your Amstrad CPC network! ;-)

ComSoft6128:
Individual/batch file transfer from/to the 3" drive interests me, transfer from the 3.5" B drive is what I'm really looking for but that might came at a later date.
I'd like to buy one for a 6128 Plus.

Cheers,

Peter

ikonsgr:

Ok, peter, send me your address with a pm or to my email ikonsgr745@hotmail.com to arrange it then.
Now,i think you're gonna love this, INDIVIDUAL file transfers from/to 3" disks was the reason i design this interface at the first place!  :)
I have dozens of 3" disks ,from the good old era, with many programs and listings me and friends had made, but the procedure to transfer them to a pc for safe keeping was somewhat combersome and timeconsuming, as all existed transfer methods are for copying hole disks or dsk images at once! So, i had to copy 3"disks to 3.5" disks using discology, and then (using an old pc that has an ide floppy drive), transfer the 3.5" disk to a dsk image using cpcdiskxp...
Now,i can just select individual files from a 3" disk and with a press of a button, transfer them directly to my pc! And, after a lot of study and work,i've managed to do it rather fast too, it takes less than 15seconds to transfer a hole 42kb game from 3"disk to pc, and about 20seconds for writing it back to a disk from pc!
In 2 words, having this interface, allows you to use your amstrad without needing ANYTHING extra, either a 3.5" drive, or a gotek emulator drive, just a good old 6128 with a bunch of 3" disks!  ;)

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Media Embedder
Powered by SMFPacks Alerts Pro Mod
Powered by SMFPacks Mentions Pro Mod