basic DMA Example

12 Jul 2011

Is there asimple example of DMA, from RAM to O/P Port, with a clock out line.

I am trying to get a PSP QVGA sereen to work, So far I can display an immage 480 x 272 pixels, with 12 bit resolution, but if I can get DMA working, I intend to use USB Storage, which could free up 4 more pins (from SD on SPI), to give 5,6,5 RGB.

additionaly, I need to read from SD or USB Storage, and push into DMA Memory.

Cheers

Ceri

12 Jul 2011

DMA with a clock pin is going to be tricky as there is no default IO DMA function with a clock line but you can do the following:(you need two databytes/words with the same data but one with the the clock line low and one with the the clock line high). You could setup a small buffer for each line for example and have that 'pushed' out to an IO port with DMA. http://mbed.org/forum/mbed/topic/1138/?page=1#comment-5547

Another trick might be to use the I2S interface (as Ivo van Poorten did with his VGA output) but add an external shift register of 16 bits, connect 12 bits to the display and setup I2S transfers to do 8 bit stereo. Fill a buffer with image data pre-shifted to 16 bits and let DMA send it to the I2S port, I2S has a clock line and a 'word select' line which selects (normally) Left and Right but also signal the end of a data word (one rising and one falling edge) which could be used to latch the output of the shift register.

13 Jul 2011

Ceri,

You might be interested in my suggestions in the thread "Help, PAL video input" for creating a DMA w/ handshake signal. You may have to forego (some of) the library routines to implement them.