element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
At The Core Design Challenge
  • Challenges & Projects
  • Design Challenges
  • At The Core Design Challenge
  • More
  • Cancel
At The Core Design Challenge
Blog ATCDC: Digimorf, Day 3, The project SEGA SG-1000 Emulator on PSoC62S4 Pioneer kit!
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join At The Core Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Digimorf
  • Date Created: 2 Mar 2023 1:14 PM Date Created
  • Views 1131 views
  • Likes 12 likes
  • Comments 6 comments
  • infineon
  • console
  • PSoCTm︎ 62 MCU
  • element14
  • Embedded Systems
  • challenge
  • sg-1000
  • sega
Related
Recommended

ATCDC: Digimorf, Day 3, The project SEGA SG-1000 Emulator on PSoC62S4 Pioneer kit!

Digimorf
Digimorf
2 Mar 2023
SEGA SG-1000 Emulator on PSoC62S4 Pioneer kit

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.

SEGA SG-1000

a computer has been designed around this console, the SEGA SC-3000:

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. Nerd

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

SEGA SG-1000 motherboard

It may seem too ambitious and a bit odd to think to port this into the pioneer kit, but actually it is theoretically possible.

pioneer kit

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:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

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. Sweat smile

OK, it's time to work, see you next post, if I am still alive! Joy

  • Sign in to reply
  • Digimorf
    Digimorf over 2 years ago in reply to baldengineer

    I have put my nose inside many consoles and computers ov the 70/80s and I think that is a miracle that I am still alive RoflRoflRofl

    One example. Atari and Commodore used to shield everything inside a metal enclosure, SEGA not. So, I was wondering what kind of magnetic field is generated by those boards Rofl

    It is common to see last minute wire jumpers to fix problems between pins Grin

    Those systems were power and heat hungry. You could cook some eggs after a couple of hours of work. Rofl

    Anyway, there was a different technology of course, so we can forgive the past. Wink

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • baldengineer
    baldengineer over 2 years ago in reply to Digimorf

    Exactly! Now that I've studied many retro computer and video game designs, I understand why they all had a non-integer for their CPU clock!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Digimorf
    Digimorf over 2 years ago in reply to dougw

    Thanks, I hope to do something nice Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Digimorf
    Digimorf over 2 years ago in reply to baldengineer

    Thanks, the composite signal is a nightmare when it's not possible to have a color carrier perfect or a multiple of it. Sometimes some TV sets are forgiving and video is displayed, but others are not really. I will go for a VGA.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 2 years ago

    Awesome project. I am looking forward to more installments.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube