Papilio DUO 2MB, ZPUino Vanilla sketches, max RAM size


Recommended Posts


I'm working with Papilio DUO, Papilio DesignLab 1.0.8 and ZPUino SOft Processor Vanilla v2.0. I'm just testing how much RAM I can use in my sketch. For this reason I increase the size of an array (unsigned char).

The sketch below with an array size of 501*1024 bytes is not running. The same sketch with an array size of 500*1024 is working fine.

static unsigned char bufferRAM[501*1024];
void setup(){
  pinMode(13, OUTPUT);

void loop(){  
  digitalWrite(13, HIGH);
  digitalWrite(13, LOW);

Compiler output:

Binary sketch size: 515.216 bytes (of a 2.048.000 byte maximum) - 1.728 bytes ROM, 513.640 bytes memory, 25% used

Der Sketch verwendet 1.576 Bytes (0%) des Programmspeicherplatzes. Das Maximum sind 2.048.000 Bytes.
Globale Variablen verwenden 152 Bytes des dynamischen Speichers.

What can be the reason?

The Papilio DUO Hardware Guide website says:

The ZPUino Soft Processor integrates the SRAM which gives your ZPUino sketches 512KB or 2MByte of code space! 

Thank you for your help!

Link to comment
Share on other sites

My assumption is that the design you use only maps the first 512KB, despite having a larger SRAM. This is probably due to HDL code not properly driving the two extra address lines.
Jack: can you check the synthesis/map output to see if the two uppermost address lines are actually driven by the HDL code, or just tied to '0' ?


Link to comment
Share on other sites


When you say you are using "ZPUino SOft Processor Vanilla v2.0" can you confirm where you are getting it from? Can you try opening the ZPUino DUO Quickstart sketch and load the ZPUino bit file associated with that sketch to your FPGA and then try your sketch again? Making sure that the board you have selected is the Papilio DUO 2MB... I'm 99% certain that I've run memory tests on that bit file to ensure that all the memory is usable... But it's been a while.


Link to comment
Share on other sites

Ok, I just checked the HDL and the synthesis/map reports and it is definitely mapping 21 pins for a total of 2^21 = 2,097,152 address space...

I'm going to have to do testing with an actual board next but unfortunately I closed down the GadgetFactory office about a month ago and everything is still in boxes in a storage space, so I have to dig through boxes to find a 2MB DUO first... We should be able to get this figured out by this weekend at the latest.


Link to comment
Share on other sites

Hello sgygax,

Please give this attached project a try, it is working for me. Be sure to load the circuit included in the attached project to your Papilio DUO board before loading the sketch.

All I did is resynthesize the "#define circuit ZPUino_Vanilla" circuit. The pre-synthesized version that is included must have been an older version because when I resynthesized it and looked at the synthesis and map reports it shows that all 21 pins are connected and it works. When I tried your same sketch with the default ZPUino_Vanilla circuit it did not work...


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.