Electronics > Microcontrollers

Estimating Program Size

(1/5) > >>

admiralk:
I never put much thought into it before, and never had to, until now. I am not really sure what parts of a program go into the different memories.

I have been wanting to do something with a display for a while, other than printing text, and got interested in The Game of Life. I do not feel like relearning OGL and doing this on a PC right now, so I thought why not get a reasonably sized display and use a microcontroller. This I would consider reasonable sized and at the top of my budget. It also means I need to maintain two arrays at 320 x 240. Which means my trusty AVRs are not going to work, as far as I can guess. I need to initialize the grid array randomly, I think I can do that in hardware. And then whatever I need to do to control the display, I have yet to figure out what is involved in that.

I have a EK-TM4C123GXL, ARM board, but its memory does not look much bigger than a large AVR, unless I am missing something and why I am asking this question. So, what do I need to calculate for what type of memory?

mariush:
Well, you have a 320x240 pixel display, but you probably don't have to track every pixel.

Your game of life probably has some sprites / icons / figures for cells , you won't have 320x240 cells on the display.  So let's say you'll have 8x8 pixel cells and you'll have maybe 240 x 240 "game area" on screen, leaving a vertical column for score, instructions, various crap. 

So with a 240x240 pixel "game area" and 8x8 cells you'll have 30x30 cells and now you only need an array of 900 cells ... but you can store the state of each cell as a bit in a byte ... so now you only need 113 bytes to store all the information

jpanhalt:
Do you really have to map both X and Y, or can X (or Y)  be calculated?

admiralk:
Unless I am missing something, I do need to modify every dot/pixel.

https://web.stanford.edu/class/sts145/Library/life.pdf

The second array is to track the neighbors.

Here is the console version -
https://youtu.be/QgwDMoGdP_A

Just to add the inspiration for this project:

amyk:
Find a display that has internal RAM and readback ability.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version