Arduino freezes when I try to write to a large array

I am working on using a large 64x64 dot matrix. Right now, I have the program working by reading off of the matrix, but to make it faster, I need to have the memory of the matrix. The issue is that even in a new file with a 64x64 array, the Arduino freezes when I try to write on the array. Please help me figure out this problem.

Hi welcome.

So you will need to give us a hint of a few things, like which Arduino board are you using. What is your program (post using the .

You should also trim everything from your program but the 64 x 64 and see if you can boil down the code to just what doesn't work.

Also when you compile look at the compiler output that tells you how many of the processors' resources are being used.

I am using an arduino mega 2560. The compier says im well within the arduino's limits and i have tried the running the areay by itself. I am trying to make a physical Conways game of life board so i need to know the value of each dot. The array is in bool to make it smaller too.

Post an annotated schematic if there is external hardware. If none let us know. To my knowledge the bool is stored as bytes not bits. This would cause you to run out of RAM, you would need 4096 bytes for the array plus more for other things like the stack.

@connory
Please show your code

64 x 64 is 4096. if you were just using a byte array you would need an Arduino with at least 4096 RAM.
What Arduino are you using?
Show your schematic.
Show your code.

Hint the Arduino stores boolean as bytes not bits hence each boolean value needs a byte of storage. Basicly a boolean and byte array take the same amount of space on the arduino. You can use a FRAM memory module, they can be gotten in 32K bytes for a few dollars. More then enough memory but a bit slower. Nice side effect if the power fails the array stays valid.

If I use bits for pixels I need 64 x 8 = 472 bytes to hold the image.
Maybe your code tries to write outside of your array or you did some trick like use re-entrant code that piles the stack until the crash?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.