Giter Club home page Giter Club logo

rc2014-ym2149's Introduction

YM2149F/AY-3-8190 Sound card for the RC2014 computer - Revision 6.1

The head of this repository contains the latest version - currently Rev 6.1. Please check the version of your board, and select the appropriate tag from the right to get the documentation for your board. e.g go here for the Rev 5 (most common) docs

Picture of the board

Video demonstration: https://www.youtube.com/watch?v=-iLwi9FagFE

The board

This is a YM2149F/AY-3-8910 sound card for the RC2014 Z80 8-bit computer. It adds the ability to play music on your RC2014!

What can you use this for?

  • Playing music for MSX or ColecoVision Super Game Module compatible software (you may also want a TMS9918A board)
  • Playing music ripped from spectrum games
  • Playing Spectrum Protracker 2/3 and tunes in MYM format
  • Adding music to your own games
  • Making music from BASIC or ASM!

Features

  • Stereo Line out, with golden ratio mixer.
  • Header for the 2 8-bit I/O ports. These could be used for reading from joysticks, additional serial ports, LED indicators etc.
  • Both YM2149F and AY-3-8910 ICs may be used
  • Supported in RomWBW
  • Possible to jumper to the same IO port as the ZX Spectrum AY
  • Known to work on the standard RC2014 setup, as well as on Steve Cousin's SC126 and SC130
  • Divides the RC2014 clock by 2 or 4 using flip flops to bring it under the 2Mhz max clock speed of the AY.
  • Supports enabling the YM2149F's internal clock divider. This means that bus speeds up to 16Mhz could be supported without overclocking the chip. (AY does not have this feature)
  • George Beckett has done some great work getting the board working on the Minstrel 4th Jupiter Ace compatible computer. See his repository here for information.

History

The Yamaha YM2149F and General Instrument AY-3-8910 are popular sound chips that were used in a wide variety of computers and arcade machines in the 1980s and 1990s. The most notable of those being the ZX Spectrum 128, Atari ST and MSX computers.

Construction Steps

  1. If you have bought one of Spencer's kits, obtain a YM2149 chip from your local friendly eBay seller :)
  2. Verify the components supplied in the kit match up with bill of materials
  3. Solder the components to the board, matching the components in the BOM to the component references printed on the PCB, starting with the lowest height ones first e.g. bypass capacitors and resistors, then moving on to IC sockets, pin headers and do the electrolytic capacitors and output jack last.
  4. Insert the ICs in their sockets. The component reference marking on the PCB (e.g. U1) is nearest to pin 1 for all ICs
  5. If you have a Z80 based system, configure the jumpers on the board so it looks like the picture in the README. This will ensure it is at the right IO address.
  6. Insert board into backplane/SBC
  7. Boot into RomWBW ensure you have the "tune.com" application (it's not included in the ROM drive but should be on the disk images)
  8. Find some music to play. There are some example files in https://github.com/wwarthen/RomWBW/tree/dev/Source/Apps/Tune/Tunes that you could transfer to the system.
  9. Use tune.com to play the music file. If you download the RomWBW*-Package.zip corresponding to whatever version of RomWBW you are using the from the releases page here https://github.com/wwarthen/RomWBW/releases, the tune.com executable will be in the Binary/Apps directory.

Bill Of Materials

Picture of the board

Qty Schematic Reference Description
2 U1 U2 16 pin DIP socket 2.54 mm pin pitch, 7.62 mm wide
1 U5 40 pin DIP socket, 2.54mm pin pitch, 15.24mm wide
1 U5 Yamaha YM2149F or General Instrument AY-3-8910
1 U4 74HCT74
2 U3 U4 14 pin DIP socket 2.54 mm pin pitch, 7.62 mm wide
1 U3 74HCT00
2 U1 U2 74HCT138
2 R6 R7 1k6 ohm 1/4 watt metal film resistor
2 R4 R5 1k ohm 1/4 watt metal film resistor
3 R1 R2 R3 3k ohm 1/4 watt metal film resistor
1 P1 40 pin right angled 2.54mm header
1 CON1 3 or 5 pin 3.5mm PCB mount jack socket (e.g. SJ1-3525N - mouser part 710-860020472001)
2 C6 C7 4.7uF electrolytic capacitor
5 C1 C2 C3 C4 C5 0.1uF ceramic capacitor 2.54 mm pin pitch
7 JP1-5 JP8-JP9 3 x 1 straight pin header 2.54 mm pin pitch
1 JP7 2 x 1 straight pin header 2.54 mm pin pitch
1 JP6 9 x 2 straight pin header 2.54 mm pin pitch
1 J2 9 x 2 straight pin header 2.54 mm pin pitch
1 X1 Half size Oscillator socket (or DIP-8 socket with middle pins removed)
5 Various Jumpers

The majority of the components are widely available, however both the AY-3-8910 and YM2194F are unfortunately not in production any more, but reclaimed chips are available fairly plentifully on eBay from suppliers in China. I would suggest using a standard 40 pin DIL socket for the AY as they are more accommodating to bent/soldered pins than a turned pin ones.

Addressing

The board contains a set of jumpers to select the address at which the sound chip will respond to commands. The jumpers settings are described in detail below.

"Normal" or MSX addressing mode is recommended.

Normal/MSX/ColecoVision addressing

MSX mode uses standard 8-bit port addressing. This board allows the base address to be any value from 00-F0 (MSX uses A0 and ColecoVision SGM uses 50 for the PSG's base address). Different ports in the lower nybble are used for reading and writing the address and data registers. Writing to port X0h selects the PSG register. Writing to port X1h writes the selected PSG register value and reading port X2h reads the selected PSG register value.

i.e. for MSX: Configure base address: A0h Register write address: A0h Data write address: A1h Data read address: A2h

and ColecoVision Configure base address: 50h Register write address: 50h Data write address: 51h Data read address: 52h

ZX Spectrum addressing

ZX Spectrum mode uses an uncommon 16-bit I/O addressing scheme for the PSG. This is possible since the Z80 puts the value of the B register on the upper 8 bits of the address bus when performing an IN r, (C) or OUT (C), r instruction. Setting A15 to 1 and A1 to 0 enables the PSG and A14 distinguishes between PSG address and data registers. To select a PSG register, set BC to FFFDh and use OUT (C), r to select the address in r. To write a value to the selected PSG register set BC to BFFDh and use OUT (C), r to write the value in r. To read the selected PSG register value, set BC to FFFDh and use IN r, (C). Note that r must be A, D, E, H, or L since B and C are required for addressing. Also note that OUT (n), A and IN A, (n) instructions won't work since they put the value of A on the upper 8 bits of the address bus.

Compatibility with Rev 5

REV6 no longer supports the D0/D8 addresses used by default in REV5 and earlier. REV6 introduced MSX-compatible addressing and supporting addresses used by REV5 and earlier would have required additional chips. This seems like a fair tradeoff since existing software that uses the original default addresses for this board is minimal compared to software that uses the MSX or Spectrum addressing schemes.

Note: Pin 1 on each jumper is identified by having square pad.

JP1-JP3

Select between MSX and ZX Spectrum decoding. All 3 jumpers should all be set to either MSX or ZX Spectrum mode. For Spectrum mode, JP6 must also be set in position 17-18. Mixing modes on different jumpers will result in nonsensical address decoding.

pins description
1-2 (Left Position) Normal/MSX/ColecoVision
2-3 (Right Position) ZX Spectrum

JP5

Selects the upper or lower half of the address range selected by JP6.

pins description
1-2 (Left position) Upper (odd) half
2-3 (Right position) Lower (even) half

JP6

Selects the base address for MSX addressing mode. For Spectrum addressing, the rightmost position (17-18) must be used. MSX addressing can use any base address from 00-F0, where JP6 selects the 3 most significant bits. JP5 is used to set A4, thus selecting the lower or upper half of the range chosen by JP5.

pins with JP5 on 1&2
1-2 (Bottom most position) 0x00
3-4 0x20
5-6 0x40
7-8 0x60
9-10 0x80
11-12 0xA0 (MSX Compatible)
13-14 0xC0
15-16 0xE0
17-18 (Top most position) Spectrum Mode
pins with JP5 on 2&3
1-2 (Bottom most position) 0x10
3-4 0x30
5-6 0x50 (ColecoVision SGM compatible)
7-8 0x70
9-10 0x90
11-12 0xB0
13-14 0xD0
15-16 0xF0
17-18 (Top most position) Spectrum Mode

JP7

YM2149 only, internally halve clock if jumpered

JP8

Use bus clock or onboard oscillator

pins description
1-2 Oscillator
2-3 Bus clock

JP9

Clock divisor. Divides the bus or oscillator

pins description
1-2 Divide by 2
2-3 Divide by 4 - Default

Outputs

CON1 - 3.5mm audio out

J2 - 2 8 bit I/O ports

How to use from BASIC

See the BASIC programs in player/test. descend.bas plays some descending tones, io_in.bas demonstrates reading from the IO port, and io_out.bas demonstrates writing to an IO port.

How to use from RomWBW

Wayne has incorporated a player called "Tune" into RomWBW that will play PT2, PT3 and MYM files. See here for the source: https://github.com/wwarthen/RomWBW/tree/master/Source/Apps/Tune. It should be present within RomWBW disk images.

Alternatively start the Microsoft BASIC interpreter mbasic, and refer to the above BASIC examples.

MSX Configuration

#A0 (write) Register write port #A1 (write) Value write port #A2 (read) Value read port

Sources for music to play

ZXArt is my favourite site: https://zxart.ee/eng/music/mainpage/

http://zxtunes.com/ is another massive collection.

http://ftp.kameli.net/pub/mym/ has a collection of MYM files

This tool compresses YMs to MYMs, which makes a lot of music available: http://osdk.org/index.php?page=documentation&subpage=ym2mym although your mileage may vary, I found some YMs weren't convertible.

This is a large archive of YM tunes to try with the above tool: ftp://ftp.modland.com/pub/modules/YM/

The CPC Power site has a lot of Amstrad YMs: https://www.cpc-power.com/index.php?page=database

There are some PT2s, PT3s and YMs on Sergei Bulba's site: http://bulba.untergrund.net/music_e.htm (although a lot of tunes in other formats)

Credits

  • Some ideas and the golden ratio output mixing were taken from the Melodik 2 design here: http://hw.speccy.cz/melodik2.html
  • MSX decoding, many thanks to J.B. Langston

License

Copyright Ed Brindley 2017-2022.

This source describes Open Hardware and is licensed under the CERN-OHL-P v2 You may redistribute and modify this documentation and make products using it under the terms of the CERN-OHL-P v2 (https:/cern.ch/cern-ohl). This documentation is distributed WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-P v2 for applicable conditions

rc2014-ym2149's People

Contributors

electrified avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rc2014-ym2149's Issues

No sound new setup

Hi,

Just installed the soundmodule on my RC2014 Pro with a Pi-Zero Terminal and Digital IO module but there is not any output when running descend.bas. My RC-2014 jumper settings are shown here: https://rc2014.co.uk/wp-content/uploads/2018/04/RC2014-Pro-Jumper-Settings-CPM.pdf and the Sound Card jumpers settings according to this image: https://www.tindie.com/products/semachthemonkey/ym2149-sound-card-for-rc2014-retro-computer/

Any ideas how to get the card working?

Best regards, Hans.

Separate TEST.BAS into 3 separate programs

After I assembled my card, I wanted to do a quick test to verify that it was alive. I copied TEST.BAS and pasted it into MBASIC, not noticing it's actually 3 separate programs. The line numbers are the only clue that this is the case, and I wasn't paying close attention so I missed it. This made me question whether my sound card was working right because the program didn't do what it was supposed to, and I spent a lot of time scratching my head. Separating the programs into individual files would prevent someone else from making this mistake.

Compatibility to CP/M

I built this card and tried some assembler examples which worked perfectly but now i'd like to play some music, is there a player for CP/M too?

Add on board oscillator/ ability to divide clock down by more than 2

See https://groups.google.com/forum/#!topic/rc2014-z80/Z36yUhXvdBY

Suggestions from that thread:

Add oscillator

The other way around this is to replace on the sound-card the 74HCT74 (dual D type FF) with a 74HCT175 (quad), so we can divide the CLK by 8 or even 16 and meet the chip requirements without slowing down the CPU. Maybe this wider clock-divider front-end should be adopted for future designs with faster CPU clock frequencies in mind. It's not uncommon to see new builders use the 20 MHz CMOS version of the Z80.

C6 C7 capacitor values

Hi The original melodik schematic shows 4.7uF caps on the audio output but your RC2014 circuit uses 470uF. Is this change intentional? It appears to be a very high value compared to other circuits which vary from 1uF to 10uF. Regards Phil

Rev 6.1 jumpers

Hi! Any information on the rev 6.1 jumpers? Thank you! -john

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.