PyBoard: is there a way to expand physical ram on Pyboard

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
MCHobby
Posts: 52
Joined: Mon Jan 26, 2015 2:05 pm
Contact:

PyBoard: is there a way to expand physical ram on Pyboard

Post by MCHobby » Mon Apr 11, 2016 11:05 am

"Graphical application" will consume more RAM than other software.
Indeed, code should be tuned and optimized to consume as less RAM as possible.
However, what can we do if we are reaching the limit of available RAM on a PyBoard?

Is there a way to extend the RAM? (I do already seen some amazing stuff with the PyBoard, I would not be surprised to see it possible).
Should we switch to another board? (and which board?)

Thanks

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: PyBoard: is there a way to expand physical ram on Pyboard

Post by platforma » Mon Apr 11, 2016 12:14 pm

Moved to pyboard forum.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: PyBoard: is there a way to expand physical ram on Pyboard

Post by dhylands » Mon Apr 11, 2016 3:42 pm

Some of the Discovery boards (typically the ones with LCDs) have an external SDRAM.

Its probably possible to modify MicroPython to use some of that SDRAM, although I don't believe that anybody has done this yet. So you'd be making new trails.

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: PyBoard: is there a way to expand physical ram on Pyboard

Post by torwag » Mon Apr 11, 2016 4:13 pm

Instead of having "real" additional RAM, which is as dhylands said rather tricky to add to micropython, one could add RAM as sort of "video-ram". That is you can save all kind of bitmaps, text, etc. in this external RAM. This for sure creates some limitation for the usage. But its kind of an often used practise.
Basically, it comes down to the point that you could also use "smart" displays which come with there own controller, RAM and ROM and hence remove the GPU-workload from micropython. If you do not like that... two micropython-based uC (one does the CPU stuff the other act as GPU with the display) are always better then one ;) This even gives you the chance to work asynchronous.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: PyBoard: is there a way to expand physical ram on Pyboard

Post by pythoncoder » Mon Apr 11, 2016 4:23 pm

@MCHobby If you have a choice of graphics device RAM usage need not be heavy. It depends on whether the driver needs to maintain a frame buffer. Some graphics controllers provide fast access to RAM on the display, see https://github.com/robert-hh/SSD1963-TF ... yBoard.git for an example.
Peter Hinch
Index to my micropython libraries.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: PyBoard: is there a way to expand physical ram on Pyboard

Post by Roberthh » Mon Apr 11, 2016 7:45 pm

@MCHobby: In addition to what pythoncoder mentioned. I did not test that yet for the SSD1963 controller. But it might be possible to use the part of the frame buffer, which is not needed for the actually displayed data, for other data. Other TFT controllers like the MD070 have several pages of frame buffers, which can be displayed alternatively. Then you can use the frame not actually displayed for data. The total memory on the SD070 is 8 MByte, on the SSD1964 it's 1.3 MByte. Still not a lot, and they use many I/O lines, if you do not want to connect a display. You could consider Serial RAM, but that works more or less like an external mass storage.
Regards, Robert

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: PyBoard: is there a way to expand physical ram on Pyboard

Post by pythoncoder » Tue Apr 12, 2016 6:12 am

Roberthh wrote:@MCHobby:... You could consider Serial RAM, but that works more or less like an external mass storage.
Regards, Robert
This driver https://github.com/peterhinch/micropython-fram.git for ferroelectric RAM enables the device to appear as a mass storage device or as a byte oriented device. But this only goes a little way towards solving the problem.

As I see it there are two basic problems with expanding the RAM on the Pyboard, both of which stem from the fact that the processor bus is not available for use. Consequently connections must be either by a serial or parallel interface. So the first issue is bandwidth: serial interfaces are slow (2.5MB/s at best). Parallel interfaces are faster, but still very much slower than the processor bus.

The second problem is that whatever means you use to connect the RAM, there is no way (as far as I know) to incorporate it into the processor's address space so that it appears contiguous to system RAM. This is probably just as well, because having the system arbitrarily allocate fast or slow memory might have unexpected consequences.

My conclusion is that for graphics purposes the best solution is to use a controller which supports its own graphics RAM via a fast parallel interface. Where this option is unavailable (for example with e-paper displays) you are forced to create frame buffers in RAM: this limits the size of display which it's feasible to drive.
Peter Hinch
Index to my micropython libraries.

Post Reply