Reading from SSD1306 VRAM?

Long shot… I’m doing a game targated for for the attiny-arcade (also uses SSD1306), with a view to using an Arduboy as an intermediary pletform for testing etc. Anyway, one thing that would help would be being able to read bytes from the SSD1306 instead of just writing them… the data sheet says this is possible in theory, although maybe not in serial mode… I was just wondering if anybody has tried doing this on Arduboy, or if it’s just not physically possible. (reason for trying this is that the attiny85 only has 512 bytes RAM, so screen buffering is a no-no).

(also, attiny-arcade uses I2C instead of SPI for comms if that matters)

I might try it anyway, but don’t have much hope just now.

Do try it. You may find inspiration from a similar trick here

I was thinking it might be good to use the display RAM on the SSD1306 especially for the 128x32 displays, where half of the screen is unused so you don’t even need to put data on there that is going to be viewed.

After some more chewing of the datasheet, looks like there has to be a physical R/W pin to set in order to read the data, so I’m going to go ahead and assume it’s just not possible to do. I’ve got a plan B anyway, (rendering each of the 8 rows separately using a 128 byte buffer), so not too concerned anyway.

I’ll post the game code for Arduboy once it’s working anyway to add to the corpus.

Depending on what you’re planning to do you might be able to get away with just writing directly to the screen.

Alternatively you could use a tile map instead.
If you use 8x8 tiles and have 256 tiles then you’d use 128 bytes of RAM.
If you use 16x16 tiles and have 256 tiles then you’d use 32 bytes of RAM.
That’s also a decent option if you only need to display text.
(I’ve actually been thinking about trying to create a tilemap display mode for the Arduboy for some time now, but my todo list is ever growing.)

(You could also just not bother with the ATtiny Arcade and just get an Arduboy. :P)


LOL, I’ve already got 2 Arduboys, a years-old devkit and a Keystudio knock-off.

Want to do a keyring-level game though and like the challenge of the smaller space to work in.

Yes, doing direct bit bashing to the screen, similar to the Mazogs game I did ages ago.

The game code I’m doing is already mostly written now, but in pits and pieces, I jujst hope it all fits in the 8K flash :slight_smile:

That’s the way to go. I used a 128 byte displaybuffer in my x-mas mini game conversion for AttinyArcade and it works very well.

Here’s the source in case you’re interested. Just remove the .pdf extension (18.7 KB)

Thanks for the code Mr Blinky.
Hope you don’t mind, I ‘borrowed’ the I2C code to use in my attiny game, and did a sort-of port of the library for Arduboy. Here’s the Arduboy version of the game. It builds and fits in the atttiny-arcade - just! (I’m still messing around with it. warning - It grabs about 25 bytes of EEPROM space at address 100 by default) (10.6 KB)

1 Like

I don’t mind at all. It’s nice to see it’s been useful.

For Arduboy the 1st 16 bytes are reserved for system use.

oops! changed it to address 100.

1 Like