Sunday, September 4, 2011

Custom Display

Let me first start out by announcing the game.  It is the scrolling race car game, the car is at the bottom of the screen and the track comes down at you and shifts left and right, you know the one.  My fist thought was to make something that could play Doom, but I don't feel 6 weeks is enough time and it would then be out of my budget to stick with only 7400 chips so race car game it is!

Today I simulated the memory using High triggered D-flip-flops.  All the memory is just video memory, 8 bits for the car's location and 64 bits for the current view of the map.  Some things I had not though about is how to control the memory.  Addressing, input, output... all these things I have taken for granted in MCUs I am now having to design.  I am gaining a much deeper appreciation for real computer engineers.

The first challenge is making the screen scroll.  To accomplish this I made the memory resemble an 8 bit wide shift register with separate clock inputs for every row. Then I made a ring counter using rising edge flip flops and a very clever one shot device to load the initial high into it.  Each piece of the counter is tied to a row's clock pin.  The ring counter cascades the memory one row at a time starting from the bottom and moving up then repeating after reaching the top.  I need to add some sort of variable delay at this point.  The variable delay will allow the current screen to show for a moment before shifting the whole screen down again.  The delay can be decreased every so often to make the game more challenging the longer you play.  I'll come back to this.

Next is how to get the new top row of the screen into the video memory.  This is easy, the top row already has an 8 bit wide input so the signal just needs to be there when the clock is toggled.  Now I just need something to load in there... I have some Ideas for this but more on that next post.

Lastly how do I get 64 bits of data that does not have any sort of addressing system into a LED matrix that uses a row/column input?  Well, I would need 8x 8bit wide multiplexers and additional logic to drive it... NOPE, too much.  Ok, I would need to add an enable pin to every custom bit of SRAM so it could float when not in use.  This seems a little more feasible.  As I thought about how to implement this I began to notice how small the LED matrix I have is. I also began to notice how many LEDs I have laying around... a little over a hundred greens and 80 or 90 reds.   That is more then enough to build a custom matrix.  That would make it much easier to design so I think I will go with that.

No comments:

Post a Comment