Playing with SPI RAM

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
uberlinuxguy
Posts: 86
Joined: Sun Jan 04, 2015 4:38 am

Re: Playing with SPI RAM

Post by uberlinuxguy » Mon Mar 16, 2015 9:16 pm

D3thAdd3r wrote: Just read into the ram from the SD, scroll into local ram as needed. Gauntlet seems like a good nail for this hammer.
This was kind of what I was thinking, load the map into SPIRAM and scroll around the map from there. But I don't have nearly as much AVR Assembly experience as the rest of you all do. Your first bit in the first paragraph sounds fun and interesting, but WAAAYYYY out of my current league. I might have to try my hand at a game once I finish the base SPIRAM code and the SPIRAM Emu mods. I think I might post my diffs to the kernel in the next day or so. I still have work to do on the emulator though, since I accidentally re-broke the SD code again... still not sure how though. I'm sure it's pretty simple.

CunningFellow
Posts: 1256
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Playing with SPI RAM

Post by CunningFellow » Mon Mar 16, 2015 11:56 pm

D3thAdd3r wrote:Gauntlet seems like a good nail for this hammer.
Sounds like a good case for a custom video mode where all of VRAM is in SPI RAM and just ROMTiles and RAMTiles are in the AVR

IN Rx, SPDR
OUT SPDR, Rx

is two clocks so thats the exact same time as and LDS

Just gets much slower to manipulate it during game-time

User avatar
D3thAdd3r
Posts: 2474
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Playing with SPI RAM

Post by D3thAdd3r » Wed Mar 18, 2015 7:45 am

Interesting. I have never done anything with SPI directly and I am not sure I understand the timing on a basic level. Lets say the ram is sitting idle, already set to sequential read, the address is set up, and we are just starting a scanline. What would the fastest assembly(naive no tricks approach) look like for back to back 8 bit pixel outs to the video port from that point?

CunningFellow
Posts: 1256
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Playing with SPI RAM

Post by CunningFellow » Wed Mar 18, 2015 9:59 am

Yyou have to

Out spdr

Wait 18 clock cycles

In spdr

There does not need to be any wait between IN and OUT

So you can go

IN SPDR. ;get the next tile from vram in SPI RAM
OUT SPDR ; cue the next byte

You then can do all the normal getting tile data and putting out pixels forthe next 4048/56 or how ever many clocks

User avatar
D3thAdd3r
Posts: 2474
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Playing with SPI RAM

Post by D3thAdd3r » Wed Mar 18, 2015 11:09 pm

CunningFellow wrote:There does not need to be any wait between IN and OUT
Now I get it, thanks for clearing that up.

CunningFellow
Posts: 1256
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Playing with SPI RAM

Post by CunningFellow » Thu Mar 19, 2015 6:12 am

Guessing most of you have seen this by now

http://hackaday.com/2015/03/18/new-part ... ontroller/

Didn't see a price though.

User avatar
uze6666
Site Admin
Posts: 4501
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Playing with SPI RAM

Post by uze6666 » Thu Mar 19, 2015 5:42 pm

I love the first comment in the article:
About 10 years to late.
:)

Nice, but I agree with most commenters, I doubt this will ever see the light of day considering composite is already on its way out.

CunningFellow
Posts: 1256
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Playing with SPI RAM

Post by CunningFellow » Thu Mar 19, 2015 11:49 pm

I think it is aimed at the aurdwino market. You can charge a lot per mm2 in that market.

It can output vga also.

It wont be useful for games I dont think. Even with the parallel interface, the high colour depth makes it impractical.

Nice for static pictures though

User avatar
D3thAdd3r
Posts: 2474
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Playing with SPI RAM

Post by D3thAdd3r » Thu Mar 26, 2015 5:46 am

Alec do you still have the program you used to test your ram around? Even at a basic level I'd like to see this ram in action!

User avatar
uze6666
Site Admin
Posts: 4501
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Playing with SPI RAM

Post by uze6666 » Fri Mar 27, 2015 5:37 am

Sure! Made a video mode using it, 360x240 1bpp. I really don't think the spi ram will fly for video modes in general. Trying to share the spi ram between two asynchronous processes is a mess.

Here's a simple demo that load the spi ram with a picture and scrolls it around. I'm in the process to load the whole 128k from the card sd to make a simple slide show.
IMG_3849.jpg
IMG_3849.jpg (88.67 KiB) Viewed 5175 times
Attachments
Mode13Demo.hex
(48.11 KiB) Downloaded 254 times
mode13demo.zip
(496.26 KiB) Downloaded 261 times

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests