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.
Wow, keep up the awesome work!
Looking forward to seeing how this progresses.
Cheers,
Mike
What a nice project - well done!
Can this card be done for $100 or less?
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.
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.
Today i draw circuit and route PCB. Not finishing but alpha pre-view:
photo_2024-10-24_20-04-30.jpg
photo_2024-10-24_20-04-30 (2).jpg
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.
photo_2024-10-24_20-04-31.jpg
Looks great! If you need any help with testing I'd be happy to help you.