A2VGA-like card with Mockingboard emulation at the same time

12 posts / 0 new
Last post
Tronix's picture
Online
Last seen: 23 min 21 sec ago
Joined: Oct 9 2024 - 01:44
Posts: 6
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: 1 day 5 hours 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 1 day ago
Joined: Mar 30 2021 - 18:45
Posts: 11
Great addition

What a nice project - well done!

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

Can this card be done for $100 or less?

Offline
Last seen: 3 weeks 1 day 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: 23 min 21 sec ago
Joined: Oct 9 2024 - 01:44
Posts: 6
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: 23 min 21 sec ago
Joined: Oct 9 2024 - 01:44
Posts: 6
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
Online
Last seen: 1 hour 3 min ago
Joined: Jan 8 2021 - 05:18
Posts: 463
Привет Tronix!

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

Tronix's picture
Online
Last seen: 23 min 21 sec ago
Joined: Oct 9 2024 - 01:44
Posts: 6
I received the first test

I received the first test boards and assembled one

The edge connector is slightly smaller than necessary in height, the margins from the edge are slightly smaller than necessary. Otherwise, the board is without errors. Clear image without jailbars. It is necessary to correct the board a little and then I will publish the project on github.

 

Offline
Last seen: 9 hours 15 min ago
Joined: Jul 22 2020 - 01:56
Posts: 24
Since I don't know how this

Since I don't know how this would work, does it need to go into a particular slot to work?I am thinking most Mockingboards (mine) go in Slot 4, tho you can also put one in slot 5 (or you can put two, one in each slot).So for sound to work, would that be the same?  This card would go into slots 4 or 5 because the software looks for the cards there?

Tronix's picture
Online
Last seen: 23 min 21 sec ago
Joined: Oct 9 2024 - 01:44
Posts: 6
desiv wrote:Since I don't
desiv wrote:

Since I don't know how this would work, does it need to go into a particular slot to work?

Yes, card need to be installed into slot #4 for mockingboard sound. Now the firmware has a hardcoded address corresponding to the fourth slot, but it can be changed to work in slot number five. Theoretically, you can try installing two cards - one in the fourth slot and the other in the fifth by changing the addresses in the firmware and it should work. But I most likely won't be able to check this in the near future, since I have a limited set of Apple II hardware - this is a replica of Apple II modified to Plus and a Dan II controller (prodos), so i limited to run Apple IIe/c software.

Tronix's picture
Online
Last seen: 23 min 21 sec ago
Joined: Oct 9 2024 - 01:44
Posts: 6
here we are https://github
Log in or register to post comments