MPU accessing busy memory

Thread Starter

lexected

Joined Jul 8, 2014
3
Hello!

I want to build a simple system that would be able to work with basic peripherals (UART, keyboard, VGA monitor). I would like to use MPU instead of MCU as a ´main unit´, so there would be more memory for processing data. This ´main´ chip would use a single SDRAM to store its data.

For the VGA output, I want to use an Atmel AVR chip, that would request data from another memory, which would contain screen data in 8-bit RGBS format. Here is where I get to problems.

I don't need much of VGA memory (less than 512KB), therefore I want to use SRAM memory, which is also simple to access compared to SDRAM. The VGA resolution I chose uses 25 MHz pixel clock, which means that I have only ~40ns time to retrieve a single pixel from SRAM to DAC. That's good as most of the memories that match my search input (>=4Mbit memory, <40ns access time) can do this.

Back to the MPU memory, I would like to ask my first question: when is it necessary to send a refresh command to SDRAM? Do I have to do it, or is it possible to get a memory that would need any external magic to refresh it?

Now I get to the problem how to access that SRAM VGA memory from the main chip, as it is almost always accessed by my VGA controller (not mentioning that I need yet another chip for mapping this memory nicely to MPU´s address space). I thought of reserving some pins of the VGA controller for MPU´s requests for SRAM access, which would mean that some video frames would have to be skipped leaving this SRAM accessible to MPU without interruptions.

I'm stuck here. I could only think of these possible solutions:

  1. I can use SDRAM on VGA chip instead of SRAM, but I will also need a better controller for the video output. This SDRAM will be compatibile with the one on MPU, and I will need to think about a special tactic for clock stealing, where I could access video memory from the video controller and main processing unit at once.
  2. I can add another chip that will use time when video memory is not accessed (sync pulses, porches etc.) for copying blocks of data from the main memory to video memory.
  3. I can use only one SDRAM memory, and request access to it from the MPU everytime VGA needs another pixel. That would slow down the whole system, but it would be simpler.
What do you think of this? What other ways (tricks, designs?) are here to have two units (main and video processing unit), from which one is being managed by another?

Thanks.
 

joeyd999

Joined Jun 6, 2011
5,287
A Google search for "Home Brew Computer" should adequately answer all your questions, and provide some design solutions that will be helpful.
 

MrChips

Joined Oct 2, 2009
30,823
So you want to build your own "Home Brew Computer".

Once you add VGA it gets a bit complicated. What's wrong with using a Raspberry Pi?

Define what you want to do with this computer and lay out your requirements.
What software will you run on it?
How will you develop the software?

If you want VGA output, is 640 x 480 adequate?
Do you need colour or is monochrome good enough?
 

Papabravo

Joined Feb 24, 2006
21,227
You can use a dual port memory. They have separate address and data lines; they are often referred to as the left port and the right port. Interfacing is drop dead simple.

You can build a synchronous state machine that multiplexes requests to/from two sources. If you have an SRAM with an access time of 100 nsec, then your "dual port" simulation will have an access time of 200 ns., because it runs two 100 ns. accesses every 200 ns. We used to use this technique in disk controllers all the time.

You could use FIFO memories. Very useful in communications controllers.
 
Top