This is the third day that I am walking in the Infineon world, as I expected, things are different than I am used to. Why am I here? Well, there are many reasons why I decided to candidate for a challenge based on an "unknown" to me product.
I like the spirit of challenges, of course. A challenge is a good motivator to overcome some obstacles and skills/knowledge upgrades. The need behind this challenge is to self-learn a new family of MCUs, and port an existing project of mine on it. That is a typical situation where a change in technology has to be done for any reason: market, lack of components, partnerships, etc.
The category of this project is very challenging, and I will be able to test many aspects of the PSoC62S4: inter-processor communication, shared memory, timers, DMA, DAC, and Capsense onboard. The resources are limited of course, and honestly, I am not sure I will be able to port this project completely from my original board. But, no matter what I will do my best to have this adventure with you all hoping that everything will be helpful to you also.
That said, let's go a bit into the project. A couple of years ago I have written an emulator of a vintage console by SEGA, produced and sold in the early 80s. Very popular in Asia but unlucky in the rest of the world. I am talking about the SEGA SG-1000.
a computer has been designed around this console, the SEGA SC-3000:
which I can say to be the predecessor of the MSX system because it has very similar hardware. In my previous project, I fully emulated the computer version SC-3000 on an STM32F4 MCU, now my goal is to port the minor version, the SG-1000, on this PSoC62S4.
I will assign specific hardware emulation to each core, but of course, the cm4, which is faster and supports both PDL and HAL, will be used for video generation, and hopefully, audio generation. I would leave the rest of the emulation to the cm0. Since I can take advantage of the IPC, I could consider the cm0 the virtual processor, and the cm4 the virtual peripheral.
It will be a huge amount of work since I practically know nothing about the architecture of the PSoC62S4, but I want to keep a positive and challenging attitude.
The hardware that will be emulated is composed by:
CPU: | D780C-1(Z80A) 3.579MHz |
VDP: | TMS9918A + 16KB VRAM |
PSG: | SN76489 |
ROM: | External cartridge |
RAM: | 1KB mirrored |
JOY: | External Atari-compatible joypad |
Video: | PAL/NTSC, through RF |
Audio: | Mono, through RF |
It may seem too ambitious and a bit odd to think to port this into the pioneer kit, but actually it is theoretically possible.
This emulator could virtually emulate all games written for the SG-1000, but what could be used as a joypad onboard lacks the Y axis. I only have the horizontal Capsense slider, and two buttons, therefore the only game that I will emulate is "Space Invaders", which is perfect here.
Let's see it in action:
So, what's the plan now? Since everything is possible only if the video signal can be generated, I will start from that. The easy way should be to generate a simple VGA standard signal by adding a video RGB resistors DAC on the J2 header. The GPIOs from P10_0 to P20_7 could be used for an R3G3B2 bits color byte, and two other GPIOs will be used for H/V sync.
The hardest way is to generate a video composite signal, NTSC/PAL. Without a proper input clock signal could be a nightmare, so I won't insist on it if I see that it's an impossible mission. Video generation is important also for synchronizing the audio output, but the audio is the easiest part.
OK, it's time to work, see you next post, if I am still alive!