PCW Expansion Experiments

Started by danhans42, 22:40, 08 April 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hey all,

I thought I would throw this thread up on what I am currently tinkering with, feedback welcome.

Basically I like playing around with hardware, so thought I would throw some stuff on the bus of
the PCW and see how easy it is to get working. For address decoding, I thought about something that was 5v tolerant and
programmable to keep the IC count down, so have used a Atmel ATF22v10c for handling the creation
of the various chip selects I am going to want to use. Ive used them before in simple jobs and they are very cheap
and it keeps the IC count down.

Reading around how the Z80 works, I wrote what I needed to create chip selects and it seemed straightforward.

I've played around with the WCH-375&6 USB controller on other machines, so first thing to get working
was one of those.

When I first got this machine about a month ago I had no way of transferring anything between PC and PCW
so I set about getting a simple link working as a custom USB device wit some code in Mallard Basic. The idea
was to then send over a C compiler to get me on my feet a bit more quickly.

That worked fine with the ATF22v10 programmed to use a base address for the CH-376 chip select at 0xA0.

I then wrote some C code using pc side using libusb to talk to the usb bulk endpoint on the usb controller and wrote
some basic code to dump the data to a file.

Data transfer isnt the fastest but im currently rewriting the PCW side code using Hisoft C now so a rewrite should yield
more speed and will flesh the code out then to offer bidirectional transfers and auto filename and some basic checksum
if needed.

Next thing that interested me was the UIDE interface by JonB, Having mas storage would be helpful with programming
for me. So I programmed the ATF22v10 to create a chip select at 0xC8 as his UIDE interface does so I could also use the
driver that he kindly wrote.

Initially that seemed to work - however I'm currently having some directory issues that I am trying to pinpoint - that may well be down to the wiring or even the CF cards I have tried. I only have one 32mb DoM that doesnt support 8bit transfers so might need to pick another CF card or DoM up. Jons offered some support on this already, thankyou :)

Future goals are to figure out how write what I need to so I can use an AY-3-8910. I have had a look at Habi's Dktronics clone - I just need to look through the truth tables for the two 74HC138's to see how to handle BC1/BDIR correctly.

I've also added a 74hc245 at 0x9F so I can use a kempston joystick when I get around to playing games, as well as having the joystick on the dktronics.

I also have a NXP PXA9665 I2C controller I might hook up somewhere so I can access stuff like i2c eeproms/rtc etc in the future.

Im not really interested in getting PCBs made for this to be honest. Once ive got everything up and correct Ill push my code and schematics to github so if anyone is interested in how to DIY interfaces with jumper wires etc they can pick it up and learn.

I will probably then do a simple protoboard for it all to sit on and wire it up to a connector so it can work with a CPS8256 all in a consolised fashion. My PcW monitor is doing that thing where the image is squished to about an inch or two high in the centre of the screen - and im a scaredy cat with CRTS's so havent attempted looking at it yet so will stick with an LCD for the time being.

I also use a modified teac 3.5" drive with machine, as the belt has gone on the citizen drive it came with and I havent got around to swapping it over.

The connector I am currently using is an N64 cart slot that was removed from a dead cheat cartridge that fits the bill perfectly. :)

Im a proper CPM n00b but am having some fun with this at the moment. Last time I used CPM was on my Amstrad CPC6128 as a 9 year old so its been a while. Im doing a bit of a brain dump on here so will flesh out with more detail such as the code in WinCUPL and more on how the USB works.




Bit of an update on the Compact Flash side..

So it appears the issue lies with either the PQI cards I was using :-

PQI 128Mb
PQI 256Mb (ID as Samsung)
Sandisk 32Mb

are not compatible for whatever reason.

I remembered I had an SD2IDE adapter for another project - the £10 on eBay variety - so tried an old 4gb Sandisk SD Card with it and Jons driver and yes, it seems to be working perfectly so far. Very happy. Its overkill but proves the ATF22v10 and my learning/wiring is working which is pretty cool.

I still need to check that all the drive letters work, but I have been using floppysofts te editor and hisoft c using c/d drive saving and compiling and its not missed a beat. Even transferring files over usb using mallard let me save straight to it without issue.

Only minor kink is xtest will not see the drive at all with any  of the tests, but the FID and xformat work fine with it which is strange. I am not sure why but I might have a go and doing some IDE enquiry commands testing to see if I can query the card with my own code. Will help me with some future projects on another system I want to tinker with.

Whilst I am working on making the data transfer client for the USB controller in Hisfoft C, Im going to start work on adding the AY-3 and tidying the solderless board up so I can add extra easily.

Ill also look at replacing the SD Card with something simpler - probably a DoM when I can find one in the UK at a fair price - I really cant be bothered wasting more time buying and testing CF cards.

Thanks for reading :)


AY doesnt look to complicated from the datasheet actually. Just need to check how exactly it was implemented by dktronics and try and implement that.

Ill so some proper writing up this weekend of my progress so far and tidy up the code in CUPL along with something a bit more in depth in respect to schematics. Not that its complicated.. thats the beauty of a PLD I guess :)


I can send you the XTEST.COM source if you like, but it's Z80 assembly.

I found the PQI 128MB DOM to be good for this application and always recommend it for uIDE users. I bought a bunch of them some time ago, then sold them with uIDE units. The subsequent time I tried to acquire some I found them a bit hard to get and rather expensive. Maybe I was lucky first time round.

Regarding PCBs, I can do the layout for you and get them fabricated, so ther should be no need for a breadboard hanging off the back of the PCW. Just need schematics. Worked out correctly, it could be made compatible with the Z80 bus used by the uIDE / uRTC cards. I do have a backplane design already.



Hi Jon,

Thanks for the reply. Yeah the DOMs are looking a bit tricky to find in the UK on the usual auction sites. I can order them in bulk from China but it still seems to still be prohibitively expensive hence the SD2IDE route which worked out cheaper for me. The adapter is still working flawlessly with your driver :) I have a job lot of random CF cards coming my way so will have a play around with those.

Breadboard is good for experimenting and testing hence I usually always start with that approach and work my way off that, but your offer of a board would be great.

My idea for a board was something that would support IDE/I2C/USB/Kempston Joystick & the AY-3 but with expansion passthru so a user could still use a CPS8256 if desired or other addons. Anything RAM related I would have on a seperate board. I do have ideas of an ISA slot eventually.

Current state of play is I still need to get the AT22V10C programmed correctly to handle the AY for both the creation of the BC1/BCDIR signals, as well as the clock divider. Clock divider I think I have nailed, its only a counter - i just need to get the address decoding to work the same as Dktronics sound generator so I need to up my game in WinCUPL.

My wife decided to redecorate my office a week or two ago so am just moving back in and will be back on with it.

Also, thanks for the PM on the memory stuff - really easy to understand Ill ping you a reply on that shortly.


I hve not played with the hardware for a week or two as everything seems to be working bar the AY-3, which I will be revisiting next week. One job I did get out of the way was getting z88dk setup and working. I have ported over my usb code to that and rebuilt the application which is now a lot lot faster than it was before.

I havent bothered with any buffering as such, it just writes the contents of the enpoint straight to disc so I am confident I can increase the transfer speed but am happy with it so far :-

Video of it in action


I get z88dk is probably creating bloated apps with me using stdlib etc but it makes life so much easier working on my linux machine rather than the PCW itself in hisoft c.


C? A language for quiche eaters. Use Z80 assembly.  ;D

I like the USB transfer thingie. I also think a serial port on your interface would be useful (if done per the Amstrad unit - there is a schematic - you can use the built in drivers).


I disagree on the C opinion but each to their own. If/when I need to use it I will.

I've finalised my spec with this so far and are sticking with just IDE/2xUSB and the AY-3. I'm putting the final touches on a board design then will get it sent to jlcpcb. It will plug straight onto the back

I'm not too bothered for adding a UART because I can do data transfer over usb which is my only use for it personally.

Im just playing around with some usb devices currently and seeing what I can get working. Usb sticks and mice so far. Next up is ch340 so can do serial over the usb using a usb UART.

Powered by SMFPacks Menu Editor Mod