YM2149F / AY-3-8910 sound card for the RC2014

2,280 views
Skip to first unread message

Ed Brindley

unread,
May 2, 2017, 6:42:39 AM5/2/17
to RC2014-Z80


Hi all,

I made an YM/AY sound card for the RC2104. 

Here's a video of it in operation and the schematics/gerbers in github. Currently working on a new R3 revision with a couple of small changes.

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


Cheers,
Ed


N.A. Moseley

unread,
May 2, 2017, 6:50:41 AM5/2/17
to rc201...@googlegroups.com, RC2014-Z80
Hi Ed,

Very nice indeed! 
What modifications are you going to make?
Does the RC2014 need a timer interrupt or does it use some other mechanism to set the playback tempo?

Regards,
/Niels.


--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/d900252f-de2e-4780-b106-47e585fd4b52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ed Brindley

unread,
May 2, 2017, 1:22:12 PM5/2/17
to RC2014-Z80
Hi Niels.

Modifications I'm making are larger footprints for the resistors as it's a bit tight, and possibly allowing for bringing out the 3 audio channels separately.

As you may have noticed, the timing is a bit off in the video as I just call the player routine in a loop and the routine doesn't always consume the same number of cycles. Using interrupts is really the only way to go.

I've been experimenting with using the Z80 CTC in timer mode to generate interrupts (I've got Scott Baker's CTC board), but not got it working yet.

Thanks,
Ed

David Hardingham

unread,
May 2, 2017, 4:54:12 PM5/2/17
to RC2014-Z80
Brilliant! Let me know when you have a spare board and I'll it from you.

Ben Chong

unread,
May 2, 2017, 6:08:43 PM5/2/17
to RC2014-Z80
This is really great.

I thought that audio seemed to be strangely missing from the RC2014, not even a simple beep. 

This fills in the gap nicely.


Spencer Owen

unread,
May 4, 2017, 7:43:34 AM5/4/17
to rc201...@googlegroups.com
Hi Ben,

This isn't the only audio device for the RC2014.  Don't forget that Dr Baker made a SPO256 speech module a while ago :-)

Cheers

Spencer

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Dylan Distasio

unread,
May 17, 2017, 6:00:17 PM5/17/17
to RC2014-Z80
Hi Ed-

This looks awesome.  Are you planning on selling boards?

Best,
Dylan

Ed Brindley

unread,
May 18, 2017, 4:10:14 AM5/18/17
to RC2014-Z80
Hi Dylan,

I've just sent my revised design off for manufacturing, if it works out OK yes I'll be selling the spare boards.

Will post here when I've got them!

Cheers,
Ed

Dylan Distasio

unread,
May 24, 2017, 10:11:53 PM5/24/17
to rc201...@googlegroups.com
Thanks for the update.  You can mark me down for one!

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/AX3ykQC0B9c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+unsubscribe@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

PianoMatt

unread,
May 30, 2017, 10:02:38 AM5/30/17
to RC2014-Z80
I wouldn't mind getting one of those

Ivan Juanes

unread,
May 30, 2017, 11:10:23 AM5/30/17
to RC2014-Z80
I would be interested in one of those cards, too. Thanks!

Ben Chong

unread,
Jun 5, 2017, 9:26:07 AM6/5/17
to RC2014-Z80
Is anyone in the US doing a batch of these?

I'd be interested to get one to test compatibility with the 6502.

A set of 3 with OSH Park is about US$39.

Tor-Eirik Bakke Lunde

unread,
Jun 5, 2017, 10:21:00 AM6/5/17
to RC2014-Z80
Whoa that's pricy! I usually pay 4.90 USD for 10 plus shipping at SeeedStudio, averages around 20$ if I want it shipped fast - so far the quality has been excellent for the cards I ordered.

Ed Brindley

unread,
Jun 5, 2017, 4:36:53 PM6/5/17
to RC2014-Z80
Hey all,

The listing for the boards has gone live on Tindie https://www.tindie.com/products/edbrindley/ymay-sound-card-pcb-for-the-rc2014-computer/

I've also update the readme in the github repo with more info: https://github.com/electrified/rc2014-ym2149/blob/master/README.md

I got the boards manufactured by Elecrow and got stung by import duty so they're not as cheap as I'd have liked :(

Cheers,
Ed

Spencer Owen

unread,
Jun 5, 2017, 4:46:17 PM6/5/17
to rc201...@googlegroups.com
That's awesome Ed! It's exciting to see other stuff designed for RC2014 on Tindie :D

By pure coincidence, I finally got around to building up my one today - however, not having any 470uf caps stopped me within sight of the finishing line! I should have some being delivered tomorrow though :-)

Cheers

Spencer 

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Dylan Distasio

unread,
Jun 5, 2017, 4:52:45 PM6/5/17
to rc201...@googlegroups.com
Hi Ed-

Any chance of shipping to the US?  I tried to place an order, but was denied.

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/AX3ykQC0B9c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+unsubscribe@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Ed Brindley

unread,
Jun 5, 2017, 5:45:31 PM6/5/17
to RC2014-Z80
Hi Dylan,

I've added shipping for USA and Europe and see you've managed to check out.

That's great!

Thanks,
Ed

Ed Brindley

unread,
Jun 5, 2017, 5:55:21 PM6/5/17
to RC2014-Z80
Hi Spencer,

Good stuff! The electrolytic cap values are fairly non critical as it's just for blocking the DC present on the YM output pins, but 470uF is the value the Speccy AY board uses.

Let me know how you get on :)

Cheers,
Ed

Stephen Kelly

unread,
Jun 5, 2017, 6:47:44 PM6/5/17
to RC2014-Z80
Hello Ed,

The card is a great idea.
I watched your video and it looks like a fun thing to build.
Tindie order placed!

Cheers,

Stephen

Tor-Eirik Bakke Lunde

unread,
Jun 6, 2017, 4:27:40 AM6/6/17
to RC2014-Z80
That's awesome. Tried ordering the full monty, but appearantly you down ship to Norway :(

Ed Brindley

unread,
Jun 6, 2017, 4:49:31 AM6/6/17
to RC2014-Z80
Hi Tor,

Bit new to TIndie so still getting to grips with the shipping options!

I've added Non-EU Europe and Norway specifically, so it should work now :)

Thanks,
Ed

Tor-Eirik Bakke Lunde

unread,
Jun 6, 2017, 7:11:11 AM6/6/17
to RC2014-Z80
Just ordered it right now, though seems like someone snapped up the jack plug right from under my nose. Found them on ebay so I got one of them for the price of 8$ with shipping, damn you use high quality stuff. Me, I just assume I'm going to break a handfull of them anyway so order the really cheap stuff :-P

Looking forward to putting together, so now I have further excuses to keep me from completing my own card using the SN76489AN sound chip. Propably won't want to after listening to the sound quality on the video you made...

PianoMatt

unread,
Jun 6, 2017, 7:38:11 AM6/6/17
to RC2014-Z80
I ordered mine. Can't wait to get some bleeps and bloops out of my RC2014

Ed Brindley

unread,
Jun 6, 2017, 8:03:42 AM6/6/17
to RC2014-Z80
Wow, $8 is pricy.

It's a bit late now you've bought from eBay but they are available on Norway Farnell site: http://no.farnell.com/cliff-electronic-components/fcr1295/connector-stereo-jack-pcb/dp/2392727

Regarding your own sound card, the more the merrier! I'm thinking SID, OPL3 would also be nice. It's unfortunate that most of these old sound chips are out of production, it would be good to have a card based on something still being manufactured.

Cheers,
Ed

Scott Lawrence

unread,
Jun 6, 2017, 8:38:08 AM6/6/17
to rc201...@googlegroups.com
Am I correct in saying that the default jumper values for this card put the AY registers at IO hex D0 through DF?

Sent from my fancy-schmancy phone.

On Jun 6, 2017, at 7:38 AM, PianoMatt <mattyb...@gmail.com> wrote:

I ordered mine. Can't wait to get some bleeps and bloops out of my RC2014

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

Ed Brindley

unread,
Jun 6, 2017, 9:05:04 AM6/6/17
to RC2014-Z80
Hi Scott,

The AY uses 2 IO ports, one for selecting the register being accessed and another for reading/writing data to/from that register.

With the default jumpering D0 is the data IO address and D8 is the register address.


You are right though that the address decoding isn't complete so the chip will be active for some of the other addresses in the Dx range. I've tried to give enough configurability that people can put it at an address that doesn't conflict with their other devices.

Cheers,
Ed


On Tuesday, 6 June 2017 13:38:08 UTC+1, Scott Lawrence wrote:
Am I correct in saying that the default jumper values for this card put the AY registers at IO hex D0 through DF?

Sent from my fancy-schmancy phone.

On Jun 6, 2017, at 7:38 AM, PianoMatt <mattyb...@gmail.com> wrote:

I ordered mine. Can't wait to get some bleeps and bloops out of my RC2014

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.

Tor-Eirik Bakke Lunde

unread,
Jun 6, 2017, 10:14:23 AM6/6/17
to RC2014-Z80
So they do, unfortunately they refuse to sell to ordinary customers. Had a heck of a time finding anyone within the country that was willing to sell me at all - the only I've found here is www.elfadistrelec.no though they tend to cater to the professional customer as well (meaning the prices are outraging). The same plug there is around 3$ plus shipping and handling (around 6$) so just figured that if I bought them on Ebay they arrive around the same time and I got two of them for 8 :-)

The site is ok for simple ICs in a pinch, but everything else is horribly expensive... Want a set resistors of various values, that's a 100$ or so - so I tend to lean towards AliExpress and the like. Wanted to build a Cosmac Computer, so looked at switches - they're around 5$ per piece, AliExpress sold me 10 for 4 and I can't tell the difference so I'm feeling they came from the same factory anyway :-P

David Hardingham

unread,
Jun 6, 2017, 4:33:29 PM6/6/17
to RC2014-Z80
Thanks Ed. This is going to be lots of fun.

David

Ivan Juanes

unread,
Jun 6, 2017, 6:08:30 PM6/6/17
to RC2014-Z80
Hi everybody:

I have already ordered mine from Tindie. Can't wait to receive it!

Ed Brindley

unread,
Jun 8, 2017, 6:56:56 PM6/8/17
to RC2014-Z80
Hi folks,

Just a note for those who are collecting parts together to build their soundcards... I'd recommend using  3k rather than 470 ohm for the pulldown resistors R1 R2 and R3. This is in line with the data sheet values and produces a slightly louder output.

I've updated the schematic/ BOM in the github repo to reflect this.

Cheers,
Ed

Peter Fielden-Weston

unread,
Jun 10, 2017, 7:41:04 AM6/10/17
to RC2014-Z80
Thanks Ed.  I'll do that.

Peter

Ed Brindley

unread,
Jun 14, 2017, 5:11:52 PM6/14/17
to RC2014-Z80
Recorded another video demonstrating the sound card, this time showing using the Z80 CTC to generate a 50Hz interrupt to drive the music playback routine under CP/M.


Cheers,
Ed

Ed Brindley

unread,
Jul 7, 2017, 3:35:35 AM7/7/17
to RC2014-Z80
I'm going to do a 2nd run of sound card PCBs, are there any changes people think would be worthwhile?

Changes I'm planning so far:
- Increase annular ring size (Kicads pads are a bit small in the library components)
- not miss off the component references :)
- move components slightly so a ZIF socket can be used for the YM.

I want to keep the form factor the same, so I don't think there is room for big changes (e.g. opamp to boost/buffer output)

Cheers,
Ed

PianoMatt

unread,
Jul 7, 2017, 7:02:51 AM7/7/17
to RC2014-Z80
The output is more or less line level already isn't it? I must admit I still haven't built mine but I've used AY chips before and they always seem to be able to drive a set of powered computer speakers

Peter Willard

unread,
Jul 7, 2017, 8:26:58 AM7/7/17
to RC2014-Z80
"Increase annular ring size (Kicads pads are a bit small in the library components)"   Thank you... this is one of my "pet peaves" about Kicad.

Ed Brindley

unread,
Jul 7, 2017, 8:54:35 AM7/7/17
to RC2014-Z80
Hey Matt!

You're right it's perfectly adequate for line out purposes and even works on my headphones which are fairly low impedance. Most other YM devices seem to not do any amplification either.

By line out "standards" (https://en.m.wikipedia.org/wiki/Line_level) output is a bit low though by my measurements.

Cheers,
Ed

PianoMatt

unread,
Jul 7, 2017, 9:36:15 AM7/7/17
to RC2014-Z80
One of my favourite easy projects is the LM386 speaker in a coffee can. Maplin used to sell little mylar speakers that are the perfect diameter for fitting in the top of Nescafe coffee cans. Takes an hour to build and it's ideal for testing audio projects.

Scott Lawrence

unread,
Jul 7, 2017, 11:36:05 AM7/7/17
to rc201...@googlegroups.com
Throughout college, my two bedroom speakers were two #10 Coffee Cans, with speakers rescued from horrible enclosures.  I filled them with some cloth batting of some sort, and taped the crossover to the outside.  Tweeters hanging off the side. They actually sounded quite good, surprisingly.

-s

On Fri, Jul 7, 2017 at 9:36 AM, PianoMatt <mattyb...@gmail.com> wrote:
One of my favourite easy projects is the LM386 speaker in a coffee can. Maplin used to sell little mylar speakers that are the perfect diameter for fitting in the top of Nescafe coffee cans. Takes an hour to build and it's ideal for testing audio projects.

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Scott Lawrence
yor...@gmail.com

Tor-Eirik Bakke Lunde

unread,
Jul 9, 2017, 1:45:52 PM7/9/17
to RC2014-Z80
Seems that most of the cheapo electrolytic capacitors I've got laying around are a bit too large for the current footprint, an extra millimeter or so between them should clear that right up.

Ed Brindley

unread,
Jul 10, 2017, 3:26:09 AM7/10/17
to RC2014-Z80
Good idea, I'll do that.

Ed Brindley

unread,
Aug 2, 2017, 3:06:57 PM8/2/17
to RC2014-Z80

Ed Brindley

unread,
Feb 3, 2018, 3:22:14 AM2/3/18
to RC2014-Z80
After selling out for a bit, the sound cards are now back in stock again on Tindie.

J.B. Langston

unread,
Feb 16, 2018, 5:10:39 PM2/16/18
to RC2014-Z80

All electronic parts should be taped with choo-choo trains.  Mouser, are you taking notes?

J.B. Langston

unread,
Feb 16, 2018, 7:06:33 PM2/16/18
to RC2014-Z80
How critical are the resistor values? I stupidly assumed I'd have all the needed values when I made my mouser order and I only have 3.3K instead of 3K and 1.5K instead of 1.6K resistors. Would that work? Also I accidentally ordered 74HC00s instead of 74HCT00s... any experience substituting these? I know that the HC will be slower and I'm not sure if the YM chip will be compatible with the output levels.  I do have 74LS00 chip so i can try that too... I guess that might be a better bet unless the power requirements would be a problem.

J.B. Langston

unread,
Feb 16, 2018, 11:32:34 PM2/16/18
to RC2014-Z80
 Well, call me impatient but I read up and I concluded that the resistor values probably weren't that critical since originally you were using 470K instead of 3K for the pullups and the README said to experiment with the mixer resistor values. I figured at worst, the balance of left and right or the volume would be a bit off.

Anyway, I've tried running test.bas and I get white noise on the left speaker and it prints 255 repeatedly. I don't hear anything resembling a scale.  So it's alive at least but I can't say much else.  I have tried both the 74HC00 and the 74LS00 chip in the U3 socket and I get the same results with both.  Based on the behavior I doubt that this is related to the resistor values; it seems more like I'm not poking the right register.  Maybe I have set the jumpers incorrectly, but I don't think so.  I have them set as shown in the attached photo, which I believe should match the defaults.

I haven't yet been able to try any of the other tests because I can't get them to assemble.  I have tried z80asm z88dk-z80asm under Ubuntu and sjasm.exe under Windows (both 0.42 and 0.39 downloaded from from https://github.com/Konamiman/Sjasm), and I get syntax errors under all of them.
IMG_9311.JPG

J.B. Langston

unread,
Feb 16, 2018, 11:40:40 PM2/16/18
to RC2014-Z80
OK, part of the problem was I didn't realize TEST.BAS contains two separate basic programs (that's kind of confusing).  When I paste only the first program, I now get the descending tone, so I think the sound card is working correctly.

I'm still not sure what I need to do to get the assembly examples to work but I will probably leave that for tomorrow.

J.B. Langston

unread,
Feb 17, 2018, 12:27:27 PM2/17/18
to RC2014-Z80
I'm successfully playing music and it sounds fine with the resistor values I used.  

sjasm reports 9 errors on PTxPlay.asm but I guess they're really warnings.  I hadn't noticed last night that it had produced a binary in spite of the reported errors.  Also my version of appmake doesn't have a +rom target, so the second command in the Makefile to build a hex fails.  I tried both z88dk 1.8 that is packaged in Ubuntu and 1.99B that I downloaded directly from the z88dk website and compiled. Neither one has this option, so I am curious what version you were using.  Anyway, I just uploaded the binary created by sjasm to a com file using xmodem and it plays music when I run it, so I guess the conversion isn't really necessary.

Ed Brindley

unread,
Feb 18, 2018, 5:50:45 PM2/18/18
to RC2014-Z80
Hi JB, apologies for the lack of replies, glad to hear you've got it working though!

Yep, as you gathered, the resistor values aren't that critical.

Regarding z88dk, the released version is quite out of date. Building from source from the master branch is the best plan (or download one of the nightlies if your'e on OSX/windows)

phillip.stevens

unread,
Feb 18, 2018, 7:09:43 PM2/18/18
to RC2014-Z80
Regarding z88dk, as Ed notes, it is best to use the current nightly or do your own build from source.

The acia (rom) subtype is very slightly broken, and there’s a one line commit in the default config as an open pull currently.

Also, we’re working on improving both acia (rom) and basic subtypes to work better with modern terminals. AA has that open work in progress now. I’m away for a few more days too (seems like holidays for all atm), but I’ll be testing the updates when I’m back.

Just to note again (though it is covered in older threads), the default hardware assumed is the classic rc2014 or mini 2014, with 32k RAM for acia and basic subtypes. Though for 56k RAM it is easy to change the origin. The HexLoadr ROM and basic subtype is a simple way to develop using the real hardware.

J.B. Langston

unread,
Feb 18, 2018, 7:36:48 PM2/18/18
to RC2014-Z80
Ed, thanks for following up.  Yes, the card is working great and I've been jamming out all weekend! Once I get the PCB for my z80ctrl board built, I will try to implement timer interrupts on that so I can use your interrupt driven player.  The hardware is there to support triggering Z80 interrupts from the AVR, although I haven't written the software yet.  The interrupt signal is on the I/O expander so it will be limited to approximately 400KHz max interrupt frequency due to the latency introduced by the SPI communication with the IO expander, but that should still be more than fast enough for playing music.  I plan to also try to merge the interrupt-driven player with Michael's command line player and hopefully I can send him a pull request. I think it should be possible to select interrupt or non-interrupt timing via a command-line switch.

Philip, thanks for the info on z88dk. FYI, I'm using the RC2014 Pro that uses the SIO/2 chip instead of the ACIA so I'm not sure how that affects the type I will need to use. TBH, I haven't played around with z88dk much at all yet but I plan to do more in the future. Especially once I get started my TMS9918 board built since you mentioned in another thread that it's got support for that.

J.B. Langston

unread,
Feb 18, 2018, 7:42:35 PM2/18/18
to RC2014-Z80
Actually I guess it was someone else who mentioned that z88dk has support for the TMS9918 but regardless I'm looking forward to trying it out. 

Ed Brindley

unread,
Apr 15, 2018, 8:39:42 AM4/15/18
to RC2014-Z80
Hi,

I've written a blog post collating all the info on the differences between the AY and YM sound chips. The YM is a drop in replacement for the AY but it does have a number of differences, and doesn't quite sound the same.

Audio samples recorded from the RC2014 sound card included for your listening pleasure :D

https://maidavale.org/blog/ay-ym-differences/

Cheers,
Ed

CubeCentral

unread,
Apr 15, 2018, 9:24:01 AM4/15/18
to rc201...@googlegroups.com

Ed,

Thank you very much for the enlightening and entertaining write-up and demonstration of the differences between these two chips.  I had no idea!  However, to my ears, the YM sounds superior while listening to that tune.  As you had mentioned, it is “cleaner” but also the bass was much better and the secondary or background melody was more defined.

Perhaps I am not listening to the right parts.  I would very much enjoy another pair of examples!

I am looking forward to completing the sound card I received from you as the parts are now here.  Cheers!

 

    -Randal   (at CubeCentral)

--

You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.

To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.


To post to this group, send email to rc201...@googlegroups.com.

Ed Brindley

unread,
Apr 15, 2018, 12:04:25 PM4/15/18
to RC2014-Z80
I hope you have fun assembling it!

I'll have a listen to a few more tunes.... if I find one where the differences are particularly pronounced I'll upload that too :)

Cheers,
Ed

To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.

J.B. Langston

unread,
Jun 19, 2018, 9:03:24 PM6/19/18
to RC2014-Z80
Ed,

Following up from my video this morning with the Bold MSX demo running on my RC2014 with TMS9918A chip, I have gotten sound working: https://www.youtube.com/watch?v=hhMnPo6kPw4

You will notice, unfortunately, that adding the sound card adds a lot of video glitches.  The TMS9918 on the breadboard is already a little glitchy with random address and data bytes getting corrupted. I think that the sound card introduces additional noise causing further problems.  Hopefully once I get an actual PCB for the TMS9918, it will be less succeptible to noise.

Getting this working required a few hacks both on the hardware and software side, because the board cannot map to the ports used by the MSX. I couldn't easily change the software to use an already supported port configuration because the software relies on the ports being contiguous and uses ld c, 0a0h to set the first port, then inc c/dec c to switch back and forth. If I change the inc c/dec c instructions to ld c, 0a8h and ld c, 0a0h, this adds more bytes because of the immediate parameter, which changes the offsets to the rest of the code. I used a disassembler with labels, but apparently it didn't use labels for everything, so there are offsets that get broken, and then demo will not run.  So major changes to the code were out.  

By running a jumper cable from the right side of JP3 (connected to pin 1 of U2) to the A0 line in one of the empty bus slots and the proper selections on the other jumpers, this got me almost there, with the data port on A0h and the address port on A1h. Unfortunately this s backwards from the MSX.  Luckily though, I can change the code enough to make this work without adding bytes and altering the offsets. I can change ld c, 0a0h to ld c, 0a1h, and then swap all the inc c instructions for dec c and vice versa.  All the instructions are still the same length, and it works.

What I did isn't really a long-term solution for MSX software compatibility, so I think a board revision will be needed.  Besides having to modify the software, another problem is that the MSX uses a separate data read port instead of reading and writing from the same port.  This isn't an issue for the demo because it never reads from the port, but if we want to try for compatibility with other software that would use the YM2149 GPIO port for a joystick interface, this won't work. 

I've taken a crack at modifying the decoding on your board, and I think I came up with something workable.  This sacrifices some decoding precision for the original D0/D8 port scheme because A1 can no longer be decoded the same way. However, I think I have managed to maintain the ability to map to any addresses previously supported; it just takes up a few duplicate ports. I maintained compatiblity with the Spectrum 128's A15/A14 scheme as well.  The BOM remains largely the same. The only changes are the repurposing of a few jumpers and the addition of two more.  I've attached a schematic and a picture of the truth table I used to work out the decoding.

Let me know what you think.
rc2014-ym2149.pdf
IMG_1098.jpg

J.B. Langston

unread,
Jun 19, 2018, 9:06:41 PM6/19/18
to RC2014-Z80
Oh, it also sacrifices the ability to have the address port at offset x4, but since that's not a default and I'm not aware of any software that uses it, it seems like a reasonable sacrifice to make.  It might be possible to bring it back by adding yet another jumper.

Ed Brindley

unread,
Jun 23, 2018, 9:39:13 AM6/23/18
to RC2014-Z80
Hi JB,

Not been in the group for a while due to other commitments but saw your video of the demo via Spencer's tweet, great work!

I think I'll have to build your z80ctrl and TMS boards when I get some free time...

Regarding your changes to the address decoding, sounds sensible.

Cheers,
Ed

J.B. Langston

unread,
Jun 24, 2018, 9:40:07 PM6/24/18
to RC2014-Z80
Regarding your changes to the address decoding, sounds sensible.

Thanks for giving it the once over.  Is this change something you're interested in doing yourself or should I start working on the board layout changes and get some made myself?  If I do it myself I may also change the audio jack to a more widely available part. My preferred source is Mouser since it's located in Dallas where I live and I can get parts the next day with standard UPS shipping.

Ed Brindley

unread,
Jun 26, 2018, 1:05:35 PM6/26/18
to RC2014-Z80
Hi JB,

Unfortunately I'm not finding much time for RC2014-ing at the moment, so I'd suggest making the changes yourself as I may never get round to it :D. Completely agree on the 3.5mm connector too. The one I picked originally is very robust (it's used by some modular synths that use 3.5mm instead of 1/4") and can withstand a lot of insertions, but ones in this pin layout http://uk.farnell.com/cliff-electronic-components/fc68131/stereo-jack-3-5mm-3pos-pcb/dp/2518188 are way easier to find.

Cheers,
Ed

Ed Brindley

unread,
Jul 9, 2018, 5:05:09 PM7/9/18
to RC2014-Z80
Hi JB!

I've pulled your changes to this branch https://github.com/electrified/rc2014-ym2149/tree/msx-address-decoding and made a few further changes so the ERC passes:

Connected pin 6 of U1 to pin 2 of JP7 instead of pin 3
Moved no-connect flag from A0 to A2
Removed no-connect flag from /M1
Changed pin 3 of JP2 to be /RD instead of /WR

Do these make sense to you? Hopefully I've preserved the intention of your changes :)

Cheers,
Ed

J.B. Langston

unread,
Jul 10, 2018, 8:45:14 AM7/10/18
to rc201...@googlegroups.com
Hi Ed,

I hadn't thought too much more about this since I was able to modify the code to work with the default D0/D8 addresses.  Someone pointed out how I could do that for Bold without changing the code size.  My other attempt at porting MSX software was Nyan cat and I found its code to be so convoluted and enmeshed with MSX-DOS and BIOS that it was easier to just rewrite it from scratch. None of the other demos I've looked at so far look like they will be as straightforward to port as Bold was, so after a little more experience, I am not sure how useful having the correct addresses for the sound card will actually be.  

On the other hand, it couldn't hurt.  I think your changes are fine. The important thing would be just to go through the mental decoding exercise and ensure that with the jumpers set correctly, the addreses 98 and 99 are actually correctly decoded.  I will try to take a look at the changes and confirm this when I get a chance.

Thanks,
J.B.

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/AX3ykQC0B9c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.

To post to this group, send email to rc201...@googlegroups.com.

J.B. Langston

unread,
Jul 10, 2018, 9:08:34 AM7/10/18
to rc201...@googlegroups.com
Sorry, I meant A0/A1/A2, not 98/99. Too much time thinking about my video card :)

Bill Shen

unread,
Sep 24, 2018, 11:35:10 PM9/24/18
to RC2014-Z80
I breadboard the YM2149 sound card design and was able to play it with ZZ80RC in CP/M.  I downloaded SJASM, reassembled the PTxPlay.asm program and xmodem the resulting player program into CP/M and able play the tune.  However, the tempo of the music is too fast (ZZ80RC is effectively running as 10MHz Z80).   I'm not using the interrupt right now.  Is there an internal variable in PTxPlay.asm that I can change to slow down the tempo?
  Bill

Bill Shen

unread,
Sep 25, 2018, 6:43:46 PM9/25/18
to RC2014-Z80
I found the variable that controls the tempo.  It is in the subroutine "pause".  This is where the processor idles for a fixed amount of time before playing the next sound.  For ZZ80RC, the delay constant is 0x3500 instead of 0x1500, so replace "LD BC,$1500" with "LD BC,$3500".
  Bill

Phillip Stevens

unread,
Dec 20, 2018, 8:35:04 PM12/20/18
to RC2014-Z80
Hi all,

I'm having some issues with my YM2149 sound card.

I've done all the standard things, checking voltages, solder bridges, etc. Nothing odd, and the RC2014 runs correctly with the card inserted so that is final proof there is nothing odd with the buses.

I noted that the BDIR and BC1 signals are appearing at the AY / YM chip properly, using Ed's BASIC testing tools, so the addressing and (default) jumpers are confirmed correct.

I have two chips, both from UTSource. The AY chip gives me nothing at all. The YM chip occasionally springs to some kind of tuneless life for a second or two, when I touch the oscillator probe (10MOhm) to the VCC pin, or one of the data pins. But otherwise the YM chip is also unable to set any IO pins, or work consistently.

Now, in the past I've found UTSource to be 100% reliable, and having two dud chips (of different types) would seem to be a coincidence that couldn't repeat. I'm pretty sure there's no ESD issues with these chips. But perhaps they're sensitive in some way that I haven't understood.

Has anyone found similar kinds of issues with AY or YM chips previously?

I've ordered two more YM chips as a precaution, but last thing I want to do is to break them too.

Merry Christmas,
Phillip

J.B. Langston

unread,
Dec 20, 2018, 9:13:31 PM12/20/18
to rc201...@googlegroups.com
Did you check the clock frequency going into the YM2149? What is it? Do you have the internal divider enabled for the YM chip?

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/AX3ykQC0B9c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.

Phillip Stevens

unread,
Dec 20, 2018, 9:26:55 PM12/20/18
to RC2014-Z80
Yes, the jumper JP6 is not fitted. The clock is /4 of the normal RC2014 clock.

My jumpers match the picture on Ed's Github exactly.

IMG_1803.JPG


The chip graphics are a bit odd, I think. Not sure if these are correct?

Cheers, Phillip

Phillip Stevens

unread,
Dec 20, 2018, 9:42:56 PM12/20/18
to RC2014-Z80


On Friday, 21 December 2018 13:26:55 UTC+11, Phillip Stevens wrote:
Yes, the jumper JP6 is not fitted. The clock is /4 of the normal RC2014 clock.

My jumpers match the picture on Ed's Github exactly.

The chip graphics are a bit odd, I think. Not sure if these are correct?

Actually, I'm reminded that I got an AY8930 which, according to data sheet, should be 100% compatible to the AY8910. But perhaps it is not?
But that still doesn't explain the YM2149 not working either... Sigh...

Phillip 

J.B. Langston

unread,
Dec 20, 2018, 9:44:02 PM12/20/18
to rc201...@googlegroups.com
This is what mine looks like. The date code on your YM (assuming that’s what it is) does seem odd. Don’t think they made them anymore in 2013. 

As a sanity check did you actually look at the frequency going into the chip with a DMM or Oscilloscope?



--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/AX3ykQC0B9c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.

Phillip Stevens

unread,
Dec 20, 2018, 9:59:16 PM12/20/18
to RC2014-Z80
On Friday, 21 December 2018 13:44:02 UTC+11, J.B. Langston wrote:
This is what mine looks like. The date code on your YM (assuming that’s what it is) does seem odd. Don’t think they made them anymore in 2013.

Yes, I agree my YM does look odd. Yamaha is normally a stickler for correctness, and your logo looks corporate correct.
My logo is the same font as all of the other markings.

As a sanity check did you actually look at the frequency going into the chip with a DMM or Oscilloscope?

Yes, it was 1.8MHz and change as expected.

The only thing that I'm not convinced about in the addressing circuitry is that the BDIR and BC1 signals seem quite short in comparison to the cycle time of the system. Definitely not "pulses", but I'll check them again tonight with respect to the data validity.

Bill Shen

unread,
Dec 21, 2018, 12:07:23 AM12/21/18
to RC2014-Z80
I bought 5x YM2149F off eBay from polida2008 for $5.99.  They all looked the same like the one in this picture.  I prototyped 3 of them and they all work correctly.

UTSource has been very reliable in my experience.
  Bill
DSC_39640925.jpg

Phillip Stevens

unread,
Jan 12, 2019, 5:27:18 AM1/12/19
to RC2014-Z80
On Friday, 21 December 2018 12:35:04 UTC+11, Phillip Stevens wrote:
Hi all,

I'm having some issues with my YM2149 sound card.

I have two chips, both from UTSource. The AY chip gives me nothing at all. The YM chip occasionally springs to some kind of tuneless life for a second or two, when I touch the oscillator probe (10MOhm) to the VCC pin, or one of the data pins. But otherwise the YM chip is also unable to set any IO pins, or work consistently.

Now, in the past I've found UTSource to be 100% reliable, and having two dud chips (of different types) would seem to be a coincidence that couldn't repeat. I'm pretty sure there's no ESD issues with these chips. But perhaps they're sensitive in some way that I haven't understood.

Has anyone found similar kinds of issues with AY or YM chips previously? 

I've ordered two more YM chips as a precaution, but last thing I want to do is to break them too.

Just to close off my issue. The two new YM2149 chips from UTSource arrived yesterday, and today I've been testing the YM2149 card.

First I worked around the card with my scope with the YM2149 chip NOT inserted, and everything looked good.
So I thought let's risk a new chip...

And it worked first time.
And, it worked second time with the second new YM2149 chip too.

So there you have it... it was TWO dud chips in my original UTSource order that caused my problem.

I think that the lesson there is there's always a chance to be unlucky with recycled components.
So, don't despair too early.


As an interesting aside. My first (dud) YM2149 chip was outputting 25V on its Channel A pin... Yes a full 25V.
I mistook my scope going blank as "not triggering", rather than "over range", and didn't notice this initially.
I wonder how it was generating 25V?

Musically, Phillip

Mark T

unread,
Jan 12, 2019, 1:23:51 PM1/12/19
to RC2014-Z80
From unsource there are sometimes alternate suppliers shown, do you know if both your orders were from the same source?

Mark

Reply all
Reply to author
Forward
0 new messages