Close
0%
0%

SS Minnow - 8-bit Game Console

Building an 8-bit game console based off of the 6502 and an ATMega 162 (for advanced I/O) .

Similar projects worth following
I've decided to take a plunge and try to build my own gaming console. The 6502 is special to me, so that's the heart of it - but I'm using some ATmegas for more modern stuff: serial I/O, Internet?, Video out, etc.

Fair Warning: I'm not a HW guy, I'm a life long systems/graphics/tech programmer. I was hesitant to post this because I'm sure I'll be doing countless things wrong - but I learn a lot from others' successes and failures, so maybe this will be of interest to someone!

Ever since playing the Intellivision and the NES I've always wanted to build my own console, it's time to full fill that dream!

It's called the SS Minnow, here are the part code names and descriptions:

The SS Minnow will consist of a motherboard and a graphic's board.  The motherboard is called The Island.  

The Island will consist of Gilligan (6502 CPU) for handling game code and the Professor (ATMega 162v) which will be the utility chip.  Gilligan will execute the cartridge code as well as update a display list on the graphic's board.  The Professor will be the motherboard work horse handling things such as serial i/o, peripheral i/o, SPI stuff (maybe?), etc. 

Gilligan can access 32 KB of RAM, and the Professor and Gilligan share a 256 bytes of that RAM (physical address 0x0200, 0x02ff) for back and forth packet communication.

The Professor has Internal RAM and additional items will be hooked up to his pins; currently peripherals and serial i/o, but in the future some SPI expansions might be added.

The Island's bus has lines to the graphic's board, the graphic's board is called The Ocean.

The Ocean will consist of Ginger which will interpret display lists and write scan line buffers to be consumed by Mary Ann for video output.  The current design is for Ginger and Mary Ann to be ATMegas, but the design is still in the schematic stage.

I'm not sure how much or little technical detail I should go in to - more can be found on the github along with all of the code the schematics - I've never done one of these projects before so hopefully I can find the right technical balance as I move forward.

  • 16 Color Palette

    trapper.mcferron07/06/2018 at 05:39 0 comments

    So the DAC (AD7302) I ordered arrived - but it turns out digikey sent me the wrong chip :(  It was in the correct packaging - but it was actually an ILD55.  So that was unfortunate, I contacted customer support and I'm still waiting for a reply.

    Meanwhile, I found a different DAC on Amazon with free (Prime) shipping, so I went ahead and ordered it: AD558.  It came today so I wired it up.

    And boom! Now I have my 16 unique color bars!  These are 4 bit color in the form of R, G_HI, G_LO, B

    The green color goes through the DAC so I can convert it to 3 unique voltage levels.  Unfortunately where those voltage levels shift there is some bleeding.  You can see it in the pic after the first 3 green bars, it goes to light blue just before dark blue.  As best as I can tell, the DAC can take 200ns to shift voltage levels, This equates to 0.2uS - and the pins coming straight from my ATMega take only .125uS - I believe this is a large enough discrepancy to account for the brief bleeding. 

    So... now I need to think about this and do some research.... I'll post back when I come up with something!

  • (Minor) Color Bar Update

    trapper.mcferron06/29/2018 at 06:12 0 comments

    It was bugging me today that the color bars were a bit muted - not as vibrant as I would expect; it became really obvious when the colors transition - it almost appears to drop to black.


    After a bunch of testing and re-examining the board I realized that I used some 750ohm resistors instead of 75ohm - so it dropped the voltage level much below what I expected... I know I tested the voltage levels before... but.. somewhere along the lines of my intense 2 week debugging and refactoring I must have made a mistake. 

    So now the colors are as vibrant as I'd expect!

    The only issue is some minor noise where the colors change... I haven't been able to track this down yet but I'm sure it's related to capacitors or resistors - I'll keep an eye out for it as I wait for my DAC for full 4bit color :)

  • Color Bars!!!

    trapper.mcferron06/28/2018 at 06:48 0 comments

    Well today I received my new AD724 chip, theoretically all I had to do was plug it in and replace the one I had blown and I'd have color bars... or cry salty tears because if it didn't work then I would have no clue what was going on, so I plugged it in and turned on the power!...

    Nothing worked - blue screen (blue meaning the monitor had nothing to sync to).


    So frustrating!!!!!   I spent a long while pouring over the datasheet for the hundredth time... I had everything hooked up right... why was I seeing nothing? No wavy bars, no noise, just... nothing.

    So I looked things over one more time... I noticed the capacitors to the color input pins were hooked up wrong.  They were supposed to be hooked up in series... but I actually wired them in to the breadboard in such a way that they would have no effect.  I dunno, I was probably tired and those holes are so tiny they always just look correct... embarrassing I know.  But these were just for the color inputs - theoretically I should have AT LEAST been seeing black and not a blue no-sync screen right?  But... you know, desperation and all...so I wired them up correctly and turned on the power...

    OMG IT WORKED I SEE COLOR BARS!!!!!!

    I actually thew off my headphones and screamed to my wife "oh my gosh - color bars!!!!!!"

    The bars are R,G,B - the next step is to get a DAC and use it to vary voltage signals to the color pins so I can send my 4-bit color palette: R, GG, B - hopefully the next screenshot I post is 16 different colors instead of just red, green blue.

    An interested reader here will wonder, well was the original AD724 blown or was it incorrect capacitor hook ups all along?   I wondered that my self so I put the original chip back in and boom - it worked perfectly.  Ah well - now I have a back up :)

    Next step is to order the DAC, hook it up, and modify the code to do 16 color bars.  I'll post when I have an update, hopefully this weekend or next week!

  • VSYNC Progress! But Color Woes :(

    trapper.mcferron06/23/2018 at 05:27 0 comments

    Wow it's been 2 weeks since my last update, that's because I've not had much to report - even though I've been working my tail off on this... seriously - like 5 or 6 hours of sleep a night, that catches up with me after awhile :(


    So - here's the deal; I got the AD724 all hooked up and I was super excited to test my code and the HSYNC timings - I plugged it all in and..... basically just a flickering monitor with nothing really to show.


    So I poured over my ASM code for a long time, found lots of small timing bugs (this NTSC timing has to be pretty perfect) and tested... didn't work so I repeated the progress over and over again.

    Speaking of NTSC timings - OMG there are sooooo many different references and they all very slightly!  For example; if you're trying to figure out timings for sync pulses, visible scan lines, front porch, back porch, etc.  most of the documents vary slightly - here are some examples of ones which are different:

    https://bradsprojects.com/generating-video-signals-with-a-microcontroller/

    https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/f2014/jn286_cy255/jn286_cy255/index.html

    https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/s2006/kwj5_mhw23/index.html

    http://www.sxlist.com/techref/io/video/ntsc.htm

    https://www.maximintegrated.com/en/app-notes/index.mvp/id/734

    ... I could go on...

    But this lead me to the conclusion that televisions (and monitors) can be a bit forgiving (but not too much)... so why was mine showing nothing???

    I decided to try ditching the color chip (AD724) and directly sending voltage signals (gray scale) to the monitor... after a few quirks in my timing I was able to get it to look good on two displays... my Goodwill monitor and my USB->Composite capture software... here are the bars:

    Hooray!!!  That was an exciting moment - taken at 2:30am when I had to be up for work at 8:00am... totally worth it though :)

    So now that I had the sync working on two monitors I decided to revisit the color chip... absolutely nothing was coming out of it - so I started pouring over the datasheet again.

    http://www.analog.com/media/en/technical-documentation/data-sheets/AD724.pdf

    To my horror I realized a minor issue.. the color input pins (RIN, GIN, BIN) maximum input values are 714mV.  I never realized this - I had been blasting them with TTL 5V levels!    I consulted my HW mentor and asked if I could have blown the chip... his response: "Totally".   So!  That's ok - I've got everything wired up to send the correct voltage levels and I just digikey'd off for a new AD724.  As soon as it gets here I'll plug it in and see what happens!  It should be here next week, so hopefully I'll update this within a week.

    Thanks for reading!  This is the most challenging and most rewarding project I've ever attempted :)

  • My Goodwill Hunt (Part 2) and More!

    trapper.mcferron06/09/2018 at 07:21 0 comments

    I had an old composite to USB converter lying around and the software for it - so I got that all installed (along with its VHS Screen Grabber software) and working as a place holder until I found a monitor which accepts composite.

    Then I wired the graphics board (The Ocean) up to  the motherboard (The Island).. and powered it all on!!!

    Sadly, The Island freaked out; it wouldn't spit out it's normal debug text and the debug LED wasn't blinking at 30hz.  After an hour or so of debugging I realized the problem, but to make it clear I need to back up a step....

    The Island (motherboard) communicates with The Ocean (gfx board) through a 30 pin connector.  This has the 8mhz clock, address bus, data bus, VCC, GND, and a VSYNC pin used for The Ocean to tell The Island when it VSYNCs.

    I'm not using the address or data bus right now, but I wired up VCC, GND, 8mhz clock, and VSYNC...  it turns out I screwed up my PCB design and VSYNC on the 30 pin connector is actually wired to the 8mhz clock!   Ugh how dumb - I'm not sure how I missed that...but that's why The Island was freaking out.

    Fortunately I have an additional VSYNC debug pin on The Island, so I used that and bypassed the broken VSYNC on the 30 pin connector.

    Then I powered it up again... BOOM The Island started up as normal and spewed its debug information to the serial port on my PC.  Unfortunately The Ocean composite output just kinda flickered on my Screen Grabber software. 

    After debugging for awhile, I pulled up the datasheet for the AD724 (that's my color generator for the composite output).  To my horror I realized that, for some odd reason, I ignored the important parts of the chip.  I didn't add the correct resistors or capacitors, and I was sending voltage levels MUCH TOO HIGH to the R,G,B input pins.  It wants a max voltage level of 357mV - I was sending it a full 5V!!!!   Oh man I hope I didn't blow the chip :(

    So.. I didn't have the necessary resistors and capacitors here - which meant I went to Amazon and ordered everything I need.  It should be here tomorrow (Saturday) and I'll hook it all up to test again.  I pray I didn't damage the AD724 because it was about $40 (it's a SMT and I had to have it soldered to a DIP breakout board).


    As I wait - I have other exciting news...I took another trip to Goodwill tonight and there was a new monitor (well, new to Goodwill).. a Westinghouse with composite input and a normal 3 prong power plug!!!!   I picked that sucker up for $10 - and now I'm good to go!!!

    Here's a pic of the beauty, price tag still on...

    Anyway - I'll need some peace and quiet to hook the resistors and capacitors up (I have to do a voltage divider network to get down to .3v) - so I'm not sure I'll have that chance over the weekend - but I'll post back here when I have some results, hopefully Monday or Tuesday night at the latest.

  • My Goodwill Hunt!

    trapper.mcferron06/06/2018 at 15:51 0 comments

    I realized I don't have a monitor which will take composite input!   The only TVs we have in the house which take it are much too big for my workstation - so on to Goodwill!!!   That's what I did last night and here is a quick recap of my adventure - feel free to skip this entry entirely it has no technical details relevant to my project.

    So I went to Goodwill last night to get myself a monitor with composite input.  They had a whole rack of old monitors Dell, Gateway, Acer, you name it!  

    Guess what I found out about old monitors?  Most of them only have a VGA input!  I figured they would all include composite... I'm not sure why, I guess because my old one did.  Anyway so I found 1 that had composite input - I was super excited!  Then I realized it had a custom power plug instead of the standard 3 hole one... ugh of course it did.

    So I went on a search through every power supply I could find in Goodwill, nothing provided the 3.5 amps needed by this thing :(

    I decided to switch gears and try to find an old small TV, oddly enough they have very few.  After much searching I found an old LCD panel that you'd strap to the back of a car seat so your kids can watch a movie.  It used a miniplug input for A/V composite.. but no big deal I have one at home.  It took awhile to find a matching power supply but I found one and tested it out - the screen lit up so I was good go!

    My quick 5 minute 8:00pm Goodwill trip ended up taking almost an hour as my patient wife roamed the asiles with our tired 6 year old...but...totally worth it!

    So after getting home I figured I should test this sucker first...I found my miniplug A/V cord only to realize it wasn't an A/V cord it was just audio... it only had 3 rings on the miniplug not 4 :(

    By now it's like 10pm, so naturally I decided to tear through the house trying to find any miniplug with 4 rings, when I was just about to give up I finally found one - old earbuds with a mic on the cord... I figured I could strip it, wire the video signal to whichever of the 4 rings was the video one and it would work.

    After some quick Internet searching I found out that there is no standard (of course there is not) but generally the video is on ring 2.  I stripped the wire and... omg the wires were so tiny and full of this fabric stuff and so twisted together that everytime I tried to separate them and wire my composite wire to it it ended up in this jumbled disaster.  I know that sounds strange, I should have taken a picture, but I've never seen wiring like that (it must be a technique they use to keep the overall cord size super small).

    The only course of action was to rip it apart and extract the mini plug itself and resolder my composite wire directly to the internal connection that is linked to ring 2.  It came apart fairly easily and my trusty mulitimeter quickly showed me which internal connection to solder to.  I'm a pretty poor solderer but after some trial and error I did a decent job.

    So I went to test!  It was a very exciting moment for me to have made my own adapter.  I plugged the RCA composite end into our old dvd player and the miniplug into this custom lcd panel and boom!  Buzzing and no video :(

    It turns out that this thing didn't use the common choice of ring 2 for video, it used it for audio.  So... after a bit more testing and trial and error I determined it used ring 4 for video.. no problem I'll send it to ring 4.  After some rewire I was ready to test!  Now no buzzing... but the video just did a quick white flash and nothing.  I played around with it for a bit longer and came to the conclusion that either A: it doesn't take a composite input, it does say "slave device" perhaps some other master unit is sending it a custom signal.  or B: it's just broken, afterall it was thrown on a rack in Goodwill.

    It was now 4 1/2 hours later, 12:30am - and I was back to...

    Read more »

  • Mary Ann (Part 1) Breadboarded

    trapper.mcferron06/05/2018 at 07:06 0 comments

    The AD724 arrived today - so after the family went to bed I stayed up breadboarding everything.  I think it's all ready to go and I'll start writing the code tomorrow.

    What the pic shows is...

    Bottom center is Mary Ann's ATmega 162, she'll handle the composite video timings.  She is wired up to receive VCC, GND, and 8MHz CLK from The Island (the main motherboard)  and to send VSYNC signal which The Island uses as an interrupt to tell the Professor (ATmega 162 on The Island) the frame is complete  (This allows the Professor to do maintenance and send then a vsync interrupt to Gilligan [6502]).

    Bottom right(ish) is the AD724.  The ATmega 162 is hard wired to send green, blue, red, HSYNC, and VSYNC to the corresponding pins on the AD724. 

    Finally, far right is my composite cable for composite NTSC output.

    There is also a (hard to see) 3.58MHz clock tied directly to the AD724 for it's FSC clock, it applies a 4x multiplier to it which allows it to stay in sync with the timings required by NTSC composite video. 

    My plan is to code up the ATmega to send the correct HSYNC and VSYNC pulses and the red, green, blue colors so color bars are displayed across the screen.  I think getting this correct will be the hardest part of the project.... at least this far.  Wish me luck :-D

    A quick side node - the ZIF socket which the ATmega is plugged into is AWESOME.  It works so much better than my previous ones... the downside is it takes up a bit more space, but I'll gladly sacrifice space for ease of use.  It's also much sturdier than the other one, no risk of bent pins.  If anyone else is interested, you can find it at:

    https://www.amazon.com/gp/product/B01FDD4M8O/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

    I plan on finishing the code this week, I'll post back when I have an update.

  • Mary Ann (part 1) Ordered

    trapper.mcferron06/01/2018 at 05:48 0 comments

    I ordered my components for part one of Mary Ann... the color bar test.  I already have an additional Atmega 162 - so no need to order that.  But I needed the following to complete my color bar test.

    AD724 and a 3.579545MHz clock for the video timing

    I noticed there is an AD725, and I was tempted to order this newer? model, but then I noticed it requires a ~14mhz clock and I'm trying to keep this whole breadboard project under 8mhz.  The AD724 is capable of applying a 4x multiplier to the 3.58 MHz clock.

    Unfortunately the AD724 only came as a surface mount... and I've destroyed too many chips trying to solder the surface mount connectors to a DIP adapter board - I need to practice.  For now though I ponied up some extra cash and had proto-advantage do it for me.  It's not cheap, but they'll order it directly from digikey, solder it to an adapter board, and send the finished product.  I've used them many times and the quality has always been outstanding:

    https://www.proto-advantage.com/store/index.php?cPath=2200

    I'm SUPER excited - as soon as they arrive I'll bread board it up, finish up the ASM code and give it a shot.  I'll post back with the results!

  • Breaking Ground (Prototyping composite output)

    trapper.mcferron05/31/2018 at 06:04 0 comments

    Now I'm starting on the graphics board.  As I mentioned in my previous post there will be two main parts to it.  Ginger, (probably designed around an 8mhz Atmega 162) and Mary Ann (again, another 8mhz Atmega 162).


    Ginger will read the display list sent from Gilligan (the 6502), change it into tiles, sprites, etc. and then wait for VSYNC.  When she gets VSYNC she'll copy the first set of tile and sprite color data to scan line buffer A.  Then, when she gets HSYNC she'll populate the next line on scan line buffer B.  She'll continue doing that alternating between scan line buffer A and B throughout the entire frame.  In essence, Ginger is always preparing the scan line buffer for the next line to be drawn. 

    Meanwhile, Mary Ann is our work horse.  She'll be responsible for maintaining the composite sync pulses, grabbing the color data from the scan line buffer for the current pixel being rendered, and loading it into shift registers for the composite out.

    Why shift registers?  Well Mary Ann will run at 8mhz, this is not fast enough to load a color from RAM and write it to the composite output each pixel.. I won't get into NTSC timings at the moment but with the resolution we're running at I have approximately 10.5us to have each pixel displayed.

    So I will have 4 8 bit shift registers which will output the line of a tile.  Each of the 8 bits will be a pixel in that line.  The 4 registers will represent colors, 1 register for the red pixels, 2 for the green pixels, 1 for the blue pixels.  This will allow me to output 4 bit color in the form of RGGB (I posted the possible colors this will display in a previous log entry).

    To say this another way, each shift register represents a color channel (R, G1, G2, or B) for the 8 pixels in the current line of a tile.  Each register consists of 8 on or off bits, each bit representing whether the color channel is active or not for each of the 8 pixels.  For each pixel, the video clock pulse will cause the register to shift the next bit out.  If this bit is on then voltage will be sent to its respective color channel pin on the composite video chip and that color will be on for the pixel, otherwise it will be off.

    Technically I'll have two sets of these registers (A and B) so Mary Ann can be filling one set with the next tile while the current set is outputting to the composite video chip.

    Anyway - that was a long way of saying I'm going to start with Mary Ann first, I figure she will be the most difficult part of the project because of the video timings.  Here is a picture of the current version of my schematic (which will most likely change many times as I figure things out, you can also download the dch file on my github):

    To start with, I'm going to simply wire up Mary Ann talking to the composite video chip so I can get the timings and ASM code working correctly - my goal is for her to output red, green, and blue color bars.

    My current plan is to use an AD724, as I understand it I'll still need to provide HSYNC and VSYNC timings, but it will handle the color burst required by composite video.  I'll update the log when I've done a bit more research and ordered my components - hopefully before the end of the week!


  • Starting on The Ocean (Graphics Board)

    trapper.mcferron05/25/2018 at 05:55 0 comments

    The Ocean is the graphics board for this project.  It will consist of two parts: Ginger, who will translate the display lists into tiles and sprites and place them into scan line buffers, and Mary Ann who will take the scan line buffers and output them to composite color (NTSC).


    I will be starting on Mary Ann first, I have the schematic mostly designed and I'll be posting it here after a final review.  The goal will be for her to output color bars for each of the 16 colors.  To do this, she'll start up and write tiles to the scan line buffer, each tile will be a solid block of one of the supported colors.  From that point on she'll loop, reading the scan line buffer and outputting the NTSC compatible format.


    In the future it'll be Ginger who writes to the scan line buffers (they will be double buffered) and Mary Ann will simply read from them - but to remove complexity I'll focus purely on Mary Ann for now.

    I think Mary Ann will be the toughest part of the project, she'll have to be in pure assembly and match NTSC timings perfectly - and I plan to only run her at 8mhz which means adding some additional HW functionality to help meet the timing requirements of NTSC (I'll go into more of that later).

    So that's it for tonight - exciting times of joy and salty tears lie ahead!

View all 19 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates