Jump to content
IGNORED

PICO9918 - a TMS9918A drop-in replacement powered by a Pi Pico (RP2040)


Recommended Posts

Excellent work Troy!!

The Pico is a versatile micro-controller, it looks like my Tango project just got gazumped by your PICO9918, so I decided add your design of the PICO9918 it into the same plug in board that I had for the Tang, so when the upgraded versions with the possible V9938/V9958 versions in the works (or new adaptations??), it will be a great and affordable replacement. Thanks, your design is nicely organised and very easy to follow, finally a replacement for the VDP. Regards Arto.

      

PICO99VDPvers1pic1a.png

  • Like 7
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, RickyDean said:

That'a really about the same thing as the Tang 9k 9918 replacement unit, isn't it?

Well yeah but, a Pi pico is $4 a Pi picow is $6 and a Tang about $16 - $35 (depending on where you get it - China or Amazon). The Tang requires some FPGA skills also if you're going to be a developer. Depending on the IDE a Pi can be plugged in like any USB device and programmed.

I don't have the skills (it's a hazy idea on the peripheral of brain) but I don't think we're far off from seeing the Pico used for an external keyboard and mouse interface. Just look at what some others are doing with the Pico here already. Will it replace the TiPi? I don't know that it needs to or will. The Pi Zero 2W is already pretty well established and is pretty inexpensive ($15) but perhaps the Pico could pick up some of the load of the other components of the TiPi -whose to say.

It's "off topic" but, Raspberry Pi just released an AI module for the Pi5. We might someday see an AiPi. Wouldn't that be something.

  • Like 3
Link to comment
Share on other sites

Posted (edited)
9 hours ago, Artoj said:

Excellent work Troy!!

The Pico is a versatile micro-controller, it looks like my Tango project just got gazumped by your PICO9918.

That's interesting. Sorry, @Artoj I hadn't seen the Tango project before. Fairly new here :D

 

If you're interested, this is what the current v0.3 (ordered, still untested) pico9918 PCB looks like:

 

image.thumb.png.ef75a5f6fa3f04b0baa1f989d9f6ddbe.png

 

image.thumb.png.4e0d77de8ac44e62b57e1c3485650d62.png

 

So, it's a touch bigger than the DIP40 footprint of the TMS9918A, but not much. I'm just using a pin header for VGA rather than include it at a fixed location.

 

The v0.2 PCB I used in the demos is very similar, but it was lacking the GROMCLK and CPUCLK signals. Since I don't use these in my homebrew HBC-56 which I was initially using as a test bed, I failed to add them to the initial design. In my videos, I have a second Pico providing the GROMCLK signal via that white wire.

Edited by visrealm
  • Like 4
  • Thanks 2
Link to comment
Share on other sites

6 hours ago, Duewester said:

Well yeah but, a Pi pico is $4 a Pi picow is $6 and a Tang about $16 - $35 (depending on where you get it - China or Amazon). The Tang requires some FPGA skills also if you're going to be a developer. Depending on the IDE a Pi can be plugged in like any USB device and programmed.

Agree. I think this is one of the main draws for the PICO9918. Many more people will be able to understand how it works and how to tinker with it (customize it) than would an FPGA. The cost is nice too.

  • Like 3
Link to comment
Share on other sites

2 minutes ago, RickyDean said:

Can anyone point to where I can buy pico's for $4, the ones I found on Amazon were 4 for 27.

 

https://www.amazon.com/dp/B092S2KCV2?ref=ppx_yo2ov_dt_b_product_details&th=1

Note: v0.3 of this requires a specific non-genuine Pi Pico board which has two additional GPIOs exposed. I linked to a couple of sources in the GitHub repo. Copied here too:

 

Purchase links:

In a future revision v0.4 perhaps, I'll do away with the need for an external Pi Pico module and just include the RP2040 and its support hardware directly on the PICO9918.

  • Like 4
Link to comment
Share on other sites

1 hour ago, RickyDean said:

Can anyone point to where I can buy pico's for $4, the ones I found on Amazon were 4 for 27.

 

https://www.amazon.com/dp/B092S2KCV2?ref=ppx_yo2ov_dt_b_product_details&th=1

https://www.adafruit.com/pico?src=raspberrypi

 

https://www.raspberrypi.com/products/raspberry-pi-pico/?variant=raspberry-pi-pico

 

@visrealm COMPOSITE?8)

  • Like 3
Link to comment
Share on other sites

4 minutes ago, HOME AUTOMATION said:

 COMPOSITE?8)

There is this project for PAL composite guruthree/pico-composite-PAL-colour: Trying to get the Raspberry Pi RP2040 chip's PIO to generate a colour PAL composite video signal, using only a resistor ladder digital-to-analogue converter (DAC). (github.com)

 

But that requires overclocking the RP2040 to 312MHz and increasing the VREG voltage to cope with that clock rate. I am overclocking the RP2040 as well to around 250MHz, but that's perfectly stable at the default voltages. You can go to around 270MHz before upping the voltage.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 6/8/2024 at 3:50 AM, Gary from OPA said:

At least first thing would be nice to add is basic 80 column mode like how the f18a does it. That shouldn't be too hard and still keeps it within the 16kb vram as well and not really any need for added vdp registers either.

Ask and you shall receive :) 

 

 

 

  • Like 6
  • Thanks 2
Link to comment
Share on other sites

I'll be watching this thread with interest.  Got a rough PAL Colecovision with bad VRAM and a bad VDP, and this would be a good candidate to see if I could get it up and working.

I assume the Pico VDP is running at 60hz?  Good if it is, and not 50hz.

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, visrealm said:

Yep. Runs at 60Hz, so swapping a TMS9929A for this will change the framerate (and interrupt frequency) to 60Hz.

Done that with real VDP before.  Only game I came across which didnt work was Defender, was easy enough to  hack.  Didn't need a ROM change.

  • Like 2
Link to comment
Share on other sites

Hmmm, I should read closer. I thought this was being done with a Raspberry Pi Pico, not a 2040 based board with other "enhancements". Still, the base chip is still at play and as mentioned hear earlier, a custom board (2 chips, built in level shifting, HDMI, dvi, etc.) is a real possibility.

  • Like 1
Link to comment
Share on other sites

5 hours ago, Duewester said:

Hmmm, I should read closer. I thought this was being done with a Raspberry Pi Pico, not a 2040 based board with other "enhancements". Still, the base chip is still at play and as mentioned hear earlier, a custom board (2 chips, built in level shifting, HDMI, dvi, etc.) is a real possibility.

The videos I've shown so far are using my v0.2 prototype which is using a genuine Raspberry Pi Pico board. The problem is I needed two more GPIOs exposed in order to add GROMCLK and CPUCLK signals for v0.3. I could have reduced the VGA bit depth to free up some GPIOs, but given the end goal is to use a RP2040 directly, decided on the USB-C Pico board for now.

  • Like 1
Link to comment
Share on other sites

Quick update. Thought I'd do some initial real-time benchmarks - just to see how much wiggle room I have to implement more advanced features. It's looking quite good.

 

These images will look bad, but bear with me :D

 

What's happening here is I'm switching the VGA signal to output BLUE when it's done generating the next scanline. So, if it was at 100% generating scanlines, these images would look perfectly normal since it wouldn't have time to switch to BLUE. If the image was mostly blue, that means it has loads of time left to do more cool stuff.  Keep in mind, the VGA is at 640x480, so I'm doubling the scanline vertically for a virtual resolution of 640x240 (used to be 320x240, but switched to 640x240 to support 80 column mode). I generate a scanline once and use it twice. With that in mind, if I was using 50% of my single CPU core capacity to generate scanlines, you would see alternating lines: correct image, BLUE, correct image, BLUE, etc.

 

Ok. that's the gist of it. Now here's the results:

 

Graphics I - No sprites

 

image.thumb.png.c68bf2a5fe87b23a0666667b0bcba815.png

Using around 33% of the available scanline generation time. ie. It finishes around 2/3 of the way through the first pass of a doubled scanline.

 

Multicolor

 

image.thumb.png.b0185b838539384ad751eaebec0f152b.png

About the same: 33%.

 

Mixed modes

image.thumb.png.30c8fd6ebb26cf03dcde9e1f58750d88.png

 

Here, you can see MC mode is the fastest. Graphics II lagging a bit at roughly 40% of the available time used.

 

Sprites

image.thumb.png.8544e9ac4f814387f31b178a6a216931.png

image.thumb.png.04a28b77a38351981c46e366de294f5e.png

Adding in sprites gets us a pinch over 50% of a scanline time used (hence the black appearing on the left where sprites appear).

 

Anyway, all-in-all, I'm happy with the results. It means I have some room to move. For the most part, I could render the entire display twice (or more). I also haven't done much work to target my TMS9918A library to the Pico (was originally written for desktop use), so I'm sure there would be performance gains to be had by keeping the RP2040 in mind. Also, the scanline rendering is all taking place on a single CPU core. The second core is mostly twiddling its thumbs waiting for interrupts from the PIOs - I could allocate some work (such as the sprite layer) to that CPU core.

 

 

  • Like 6
  • Thanks 1
Link to comment
Share on other sites

15 minutes ago, visrealm said:

Or about 6 dollarydoos :D

 

Or about 8 Canadian loonies.. our dollar is getting weaker by the day here.. plus everything comes with China or USA with high shipping costs as well. But still a good deal. The rp2040 clones are bit cheaper but not all of them are the same got to make sure its compatible on how the gpio pins are arranged.

Edited by Gary from OPA
  • Like 2
  • Sad 1
Link to comment
Share on other sites

Wonderful Work Troy!!, I appreciate the gift of technical prowess it takes to accomplish feats such as you have shown! I am in awe, knowing you are also an Aussie, you might even live in striking distance of me, LOL. So much talent I see in this forum, I have no words, knowing so many great ideas are festering are due to our humble Ti99. This is where we move the goal posts and no AI can even come close, human beings are far superior in the CREATIVE aspects of technology that 9900 cpu's running AI could ever be. Regards Arto.

 

     

PicoVDPv1pic1a.png

Schematic_TMS99PICO-v1_2024-06-14.pdf

Edited by Artoj
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

7 hours ago, visrealm said:

Anyway, all-in-all, I'm happy with the results. It means I have some room to move. For the most part, I could render the entire display twice (or more). I also haven't done much work to target my TMS9918A library to the Pico (was originally written for desktop use), so I'm sure there would be performance gains to be had by keeping the RP2040 in mind. Also, the scanline rendering is all taking place on a single CPU core. The second core is mostly twiddling its thumbs waiting for interrupts from the PIOs - I could allocate some work (such as the sprite layer) to that CPU core.

But still, the F18A has an additional tile layer, a bitmap layer, hardware scrolling, more sprites, and more colors. I guess it would be tight? And do you think the other core would be fast enough to emulate a 100MHz TMS9900 (the F18A GPU)?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   1 member

×
×
  • Create New...