A2VGA-like card with Mockingboard emulation at the same time

8 posts / 0 new
Last post
Tronix's picture
Online
Last seen: 1 hour 18 min ago
Joined: Oct 9 2024 - 01:44
Posts: 3
A2VGA-like card with Mockingboard emulation at the same time

Hi, 

I wanted to add Mockingboard emulation functionality to the A2VGA-like board at the same time as the vga output. The first problem that needed to be solved was to free up several GPIOs for the right and left audio channels as well as for /IRQ control. As you know, in the standard A2VGA circuit all GPIOs are occupied, and I needed at least three free GPIOs. In the standard circuit 9 GPIOs are used to output the color code:

I thought that it would be possible to use two additional latches - one with store on the positive edge, the other on the negative edge clock signal. The result was the following diagram:

 

First 4 bits latched in HC373 at positive edge, then second 4 bit (with previos 4 bit from HC373) latched in HC574 at negative edge together with last 9 bit in GPIO18 with help side-set RP2040 PIO. Thus, 3 free GPIOs are released! Naturally, this circuit required changes to the firmware, in particular, doubling the vga-PIOs operating frequency and recalculating some timings in PIO blocks. If previously PIOs worked at a pixel clock frequency of ~25 MHz, then when sequentially loading values ​​into two registers, a frequency twice as high is required - 50 MHz. This is most likely almost the maximum frequency for the 74hc IC series, so it is better to use something faster, for example, the 74AC series. In my case I used what I had on hand, namely 74HC374 and 74AC574:

 

The second problem is the lack of processor time to emulate two AY-chips at 44100Hz stereo PWM simultaneously with vga output, especially in high-resolution mode. If Pi Pico used to work at a frequency of 252Mhz, then I had to overclock the rp2040 to 378mhz. Fortunately, I've done this many times before and everything was fine. For audio output, two GPIOs are used with a low-pass filter according to a typical scheme:

For proper Mockingboard emulation we also need drive/IRQ, so i used  MacFly's a2vga mouse circuit (with different GPIO):

Unfortunately, I'm not very good at programming, so after a lot of very bad code practics, I got some results (short youtube video):

https://www.youtube.com/watch?v=K2fCMBh2t7I

So it almost works. I need to run additional tests.

 

Offline
Last seen: 9 hours 58 min ago
Joined: Apr 13 2006 - 22:28
Posts: 151
Well done!

Wow, keep up the awesome work!

 

Looking forward to seeing how this progresses.

 

Cheers,

Mike

 

Offline
Last seen: 2 weeks 2 days ago
Joined: Mar 30 2021 - 18:45
Posts: 11
Great addition

What a nice project - well done!

Khaibitgfx's picture
Offline
Last seen: 2 hours 54 min ago
Joined: Jun 29 2019 - 20:02
Posts: 153
Can this card be done for

Can this card be done for $100 or less?

Offline
Last seen: 3 days 20 hours ago
Joined: Aug 30 2014 - 06:37
Posts: 17
What sound chip are you

What sound chip are you emulating? The  AY-3-8913 has a bug in it according to French Touch.

Tronix's picture
Online
Last seen: 1 hour 18 min ago
Joined: Oct 9 2024 - 01:44
Posts: 3
roughana wrote:What sound
roughana wrote:

What sound chip are you emulating? The  AY-3-8913 has a bug in it according to French Touch.

 

I am using open-source library: https://github.com/digital-sound-antiques/emu2149 so its emulate  AY-3-8910 or YM2149 i beleave. Currently i am chose AY-3-8910.

As I mentioned before, I'm not very good at programming, so I chose this library because I could make it work. But there's nothing stopping you from using another library, except for the need to figure it all out.

 

Khaibitgfx wrote:

Can this card be done for $100 or less?

The cost of this card is about the same as any other A2VGA card, here only two latch chips, one transistor, several resistors and capacitors and a headphone jack are added.

Tronix's picture
Online
Last seen: 1 hour 18 min ago
Joined: Oct 9 2024 - 01:44
Posts: 3
Today i draw circuit and

Today i draw circuit and route PCB. Not finishing but alpha pre-view:

 

Board size is 100 x 78 mm, so may fall under some promotions of PCB manufacturers (100x100 for $1 5pcs), the price should not be high i hope.

Macintosh_nik's picture
Offline
Last seen: 3 hours 53 min ago
Joined: Jan 8 2021 - 05:18
Posts: 462
Привет Tronix!

Looks great! If you need any help with testing I'd be happy to help you.

Log in or register to post comments