Homebrew DIY SAM Coupe ?

General "chat", not necessarily MTX related
lezanderson
Posts: 186
Joined: 14 Aug 2012 15:31

Homebrew DIY SAM Coupe ?

Post by lezanderson »

Sam Coupé

Free ICs to anyone serious about building their own Sam Coupé.

If anyone is building a DIY/Homebrew Sam Coupé then this may be of interest.

The British Sam Coupé was a enhanced Clone of the well know ZX Spectrum.


DIP ICs
Z84C0020PEC Z80 CPU DIP40
512K SRAM DIP32
64K EPROM DIP28
EPM7512AET144 ( Or similar ) Blank
EPM7128SLC84-xx PLCC84 Blank
MC1377P PAL/NTSC TV Encoder DIP
8255 DIP40
8251 DIP
DS12885 RTC DIP
AM9511 Math FPU DIP
WD1793 FDC DIP40
SAA1099 DIP18
YM2149 DIP40
SN76489 PSG DIP16
7805 Regulator


PLCC ICs
Z84C0020VEC Z80 CPU PLCC44
Z84C9012xx Z80 KIO PLCC
128K SRAM (IS61C1024) SDIP 4pcs
64K SRAM W27C512-45 PLCC
82C55 Intel PIO PLCC 2pcs
82C51 Intel SIO PLCC 2pcs
DS12885Q RTC PLCC
WD1793 FDC PLCC

For more info on the Sam Coupe See Wiki Page : https://en.wikipedia.org/wiki/SAM_Coup%C3%A9


Anyone interested just email me at : lezanderson@gmail.com
lezanderson
Posts: 186
Joined: 14 Aug 2012 15:31

Re: Homebrew DIY SAM Coupe ?

Post by lezanderson »

Homebrew Sam Coupé Design !


Design Specification :

CPU Z80> Over-clocked to Max 24Mhz, 512K+ RAM, 64K+ROM, multiple I/O, FDC, video , Sound etc compatible with original SAM Coupé

Z80 (Z84C0020xx) CPU DIP/PLCC
Running at 6MHz,8Mhz,10Mhz,12MHz,16MHz,20MHz,24Mhz

Memory 512K ~Min SRAM, Either low Speed 55ns type DIP32 or Fast SRAMs IS61C1024-10 10ns 128K SRAMs 4pcs. 64K EPROM W27C511-45 45ns.

Input/ Output :
Z80 KIO (Z84C9012xx) has Z80 CTC,PIO,SIO all on one PLCC Chip. Plus Intel 82C55,62C51, PIO,SIO Chips. This would give lots of I/O to play with.

Glue Logic (EPM7128 Blank would need programming)
Glue logic for Memory & I/O Decoding would be done by a EPM7512SLC84-x, giving 60 CPLD +5V I/O lines for this purpose. It could also be used for keyboard Matrix Decoding.

Video Logic (EPM7512 CPLD Blank would need programming)
This would be used to generate all the SAM Coupé video modes and timing signals etc. Video and sound would be output via a standard SCART interface and Phono/Jack sockets.

Floppy disc controller (WD1793)
A WD1793 Chip could be used to access Floppy disc drives.

SD Card / Hard Drive functions.
The 8255 PIO IC or equivalent chip could be used to access an SD Card or PATA Floppy disc drive. Alternately this could be done by the logic in one of the CPLDS ?
This would give modern storage options. Even a DS1250 NVSRAM could be used as silicon disc instead of floppy disc drives.

Sound output:
The SAA1099 as in the original, plus a YM2149/AY-8910 ZX Spectrum PSG and a SN76489. These would be mixed to give left/right stereo sound output.


Costing :


Z84C0020xx Z80 CPU DIP40/PLCC44…………..…….…...$2.0
512K SRAM DIP32…………………………….…….….…..$4.0
64K EPROM DIP28/PLCC28………………….……..….…..$1.0
EPM7512AET144 ( Or similar ) Blank ………...……….…...$10.0
EPM7128SLC84-xx PLCC84 Blank …………………….…..$2.0
MC1377P PAL/NTSC TV Encoder or similar DIP…..….….$2.0
8255 DIP40/PLCC44……………………………………..…..$1.0
8251 DIP/PLCC…………………………………………..…..$2.0
DS12885x RTC DIP/PLCC………………………………..….$2.0
AM9511 Math FPU DIP………………………………….….$2.50
WD1793 FDC DIP40/PLCC……………………………..…..$2.50
SAA1099 DIP18 ………………………………………...…..$2.0
YM2149 DIP40………………………………………….…..$1.50
SN76489 PSG DIP16………………………………………..$0.50
7805 Regulator……………………………………………….$0.10

Total for ICs < $38

Total Costing : Approx $100 (£80)
Total cost based on one third for ICs , one third for PCB and one third for miscellaneous. Miscellaneous includes resistors, capacitors, switches, connectors etc.
Martin A
Posts: 799
Joined: 09 Nov 2013 21:03

Re: Homebrew DIY SAM Coupe ?

Post by Martin A »

If you're building a system that can't use PS2 or USB, then the cost of the keyboard components is possibly the biggest outlay.

Buying from Mouser in packs of 100, a 12mm key and keycap works out at 60.6p each. With anywhere between 40 (ZX81, Spectrum) and 80 (MTX/MSX/SAM) in a home brew, that can be quite a significant cost.
lezanderson
Posts: 186
Joined: 14 Aug 2012 15:31

Re: Homebrew DIY SAM Coupe ?

Post by lezanderson »

ZX spectrum keyboard

I'm sure there's people that have made PCBs for ZX Spectrum keyboards. I don't think anyone has made a replacement SAM Coupe keyboard ?

https://www.ebay.co.uk/itm/CUSTOM-KEYBO ... SwLNVc2GRv

https://www.sellmyretro.com/search/natu ... m+keyboard

Or you could use a microcontroller to read an old PS/2 keyboard, though this would need software alterations.

The PS/2 keyboard option may be the cheapest ?
lezanderson
Posts: 186
Joined: 14 Aug 2012 15:31

Re: Homebrew DIY SAM Coupe ?

Post by lezanderson »

Using CPLDs to Emulate ULAs like in the SAM Coupé ?

The original SAM Coupé uses a PLCC ULA to give quite a bit of it’s glue logic and Video Mode generation & Timing. As these are no longer available some other IC would need to be used to do these functions.

Video Logic
Video Logic using a CPLD. EPM7512AET144 > 512 Macrocells , 100+ I/O lines.
Using an Altera MAX CPLD (EPM7512AET144 or similar) CPLD to emulate SAM Timing & Video Logic ? By programming a Blank CPLD to give the functionality of the SAM Video logic you would produce the same video modes and timing. A EPM7512xx has 512 macrocells which should be enough to do this function.

The SAM Coupé provides four graphics modes:

Mode 4 — 256×192, linear framebuffer, 4 bits per pixel (16 colours) = 24 KB
Mode 3 — 512×192, linear framebuffer, 2 bits per pixel (4 colours) = 24 KB
Mode 2 — 256×192, linear framebuffer, 1 bit per pixel with 32×192 separate attributes for each 8×1 block of pixels = 12 KB
Mode 1 — 256×192, separate attributes, non-linear framebuffer arranged to match the display of the ZX Spectrum = 6.75 KB


Glue Logic
Glue Logic using a CPLD. An Altera MAX EPM7512SLC84-15 128 Macrocells , 60 I/O Lines, could be used to do memory decoding , I/O address decoding, keyboard matrix decoding etc.
Martin A
Posts: 799
Joined: 09 Nov 2013 21:03

Re: Homebrew DIY SAM Coupe ?

Post by Martin A »

If you're going with a high pin count CPLD, then that means working at 3.3v instead of 5v. Rather than invest in a mass of level shifting to accommodate a Z80, the low power version of the Z180 might be an easier fit. The Z8S180 has 20mhz 3.3v version.

For an idea of resource cost, I've VHDL code for a VGA 256 x 192 pixel doubled to 512 x 384 ZX Spectrum style display, that currently compiles to just 65 macro cells in the EPM7128. I'm hoping that once it's fully debugged it will fit into a EPM7064 (or ATF1504)

That's using an external shift register and colour multiplexer, I don't expect the linear framebuffer modes to be any more resource expensive. Getting it all into the 7128 might not be possible, but 256 macro cells ought to be enough for all 4 modes with a few carefully chosen external parts...
lezanderson
Posts: 186
Joined: 14 Aug 2012 15:31

Re: Homebrew DIY SAM Coupe ?

Post by lezanderson »

+5V CPLDs

I believe the Atlera MAX7000 series uses +3.3V for it's Supply rail but I/O is 5V compatible (best to check datasheet!) ? The MAX7000s are in system programmable and seem to be preferred. Most +5V CPLDs seem to be obsolete these days, according to Digikey etc, but that does not make them any less useful for the hobbyist or DIY builder.

MAX7000 Datasheet here : https://www.digikey.co.uk/en/datasheets ... tera-m7000

Alter MAX9000 is another option you can get a MAX9400 in PLCC84 with 400 macrocells if you can source them? And the cost might be rather eye-watering !

I was sourcing EPM7512AETC144 for $10 each which is a reasonable price for obsolete ICs !

Digikey has a selection of current and obsolete CPLDs with Datasheets from various manufactures like Xilinx inc, Cypress Semiconductors, Intel, Lattice semiconductors etc. However Getting large (High number Macrocells) in PLCC84 is difficult.
lezanderson
Posts: 186
Joined: 14 Aug 2012 15:31

Re: Homebrew DIY SAM Coupe ?

Post by lezanderson »

Sound Circuit ?

SAA1099+YM2149+SN76489 Programmable Sound Generators !

The original SAM Coupe used a PhilipsSAA1099 sound chip DIP18, however it didn't use a AY-3-8910/YM2149 sound chip. This meant that some ZX Spectrum software may not run or woul not be as good, as there'd be no sound ! Thus designing a more complex sound circuit would address this issue.

The SAA1099 has a left and right Stereo output, by mixing these outputs with other sound chips a more sophisticated sound output and greater compatibility would be achieved . The Left Stereo SAA1099 Output could be mixed with a YM2149 and the right Stereo output mixed with a SN76489. All these chips are easily sourced and cheap !


>>>>>>>>>>>>.........YM2149 output Mixed using Op-Amps/Summing Amps giving left Stereo output
SAA1099......
>>>>>>>>>>>>.........SN76489 output Mixed using Op-Amps/Summing Amps giving right Stereo output



The SAA1099 , to my knowledge, was only used in the SAM Coupe. THe YM2149 is ZX spectrum Compatible and the SN76489 was used in the Acorn BBC, Memotech MTX etc.
lezanderson
Posts: 186
Joined: 14 Aug 2012 15:31

Re: Homebrew DIY SAM Coupe ?

Post by lezanderson »

* From Martin's post *

For an idea of resource cost, I've VHDL code for a VGA 256 x 192 pixel doubled to 512 x 384 ZX Spectrum style display, that currently compiles to just 65 macro cells in the EPM7128. I'm hoping that once it's fully debugged it will fit into a EPM7064 (or ATF1504)

That's using an external shift register and colour multiplexer, I don't expect the linear framebuffer modes to be any more resource expensive. Getting it all into the 7128 might not be possible, but 256 macro cells ought to be enough for all 4 modes with a few carefully chosen external parts...


**************************************************************

This would make an excellent video chip (ULA) for a modern update on the ZX81 , a sort of 'Super Turbo' ZX81

With :

Z8S18033xx Z180 33Mhz Chip PLCC
1Meg Fast SRAM IS6C1024-10 10ns 128Kx8bit SDIP32 8pcs
IS28F010A-45 128Kx8bit 45ns Eprom PLCC32
CPLD as Video Chip with Glue logic > as described by Martin's post.
SAA1099 SDIP18 as sound Chip
89C2051 or similar MCU for keyboard or mouse
82C55 PLCC44 as SD Card reader or PATA Harddrive
DS12885Q PLCC Real Time Clock / Calendar
7805 Regulator with +9 to +12V DC input

Would be an interesting project and theoretically quite cheap ? 8-)
lezanderson
Posts: 186
Joined: 14 Aug 2012 15:31

Re: Homebrew DIY SAM Coupe ?

Post by lezanderson »

SAM Copue / ZX Spectrum Floppy Disc Controllers FDC :

The ZX Spectrum (Amstrad Versions) used a uPD765 FDC with a SED9420

765 FDC was also used in the Amstrad CPC : µPD765 - Floppy Disc Controller (used in DDI-1 and CPC 664/6128).

More than one manufacturer made 765 compatible ICs. These are the ones known to be used in the CPC by looking at pictures of CPC mainboards.

All should operate almost identically.

Zilog Z0765A08PSC
NEC D765AC-2
NEC D765AC
UMC UM8272A
Intel 8272A or 82072A
PC8477BV-1 Advanced Floppy Disk Controller PLCC-68

The following data separators are used: FDC9216 : SED9420C

see Wiki page : https://en.wikipedia.org/wiki/Floppy-di ... C2%B5PD765


SAM Coupe FDC:


The SAM Coupe used a Citizen 3.5 inch slimline drives which slotted in below the keyboard to provide front-facing slots. Like IDE hard disks, these enclosures contained not just the drives but also the drive controllers, a WD1772-02, with the effect that the SAM could use both drives simultaneously.

Western Digital FD1771 :The FD1771 is the first in a line of floppy disk controllers produced by Western Digital. It uses single density (FM) modulation and supports the IBM 3740 disk format. It is packaged in a 40-pin

see Wiki page : https://en.wikipedia.org/wiki/Western_Digital_FD1771

Compatible chips

Many compatible chips were available from other vendors:

FD179x series from SMC Microelectronics
MB887x series from Fujitsu
VL177x series from VLSI Technology.
Soviet KR1818WG93 (КР1818ВГ93) was a WD1793 analog
WD1793 has built in data separator.
Post Reply