gillham / logic_analyzer

Implementation of a SUMP compatible logic analyzer for the Arduino
Other
463 stars 99 forks source link

Overusing SRAM on 1024 bytes Arduino (ATMEGA328P) #6

Closed MortenGuldager closed 12 years ago

MortenGuldager commented 12 years ago

It appears to me, after trying to understand the source code, that you are using more SRAM than is available on the atmega328p chip. According to data sheet there is 1024 bytes in total, but you allocate both a global 1024 data buffer and a bunch of variables, globals too. Stack is also in use.

I expect some of this fall over board, and I'm baffled why it does still work...

MortenGuldager commented 12 years ago

Ok, I had apparently misunderstood something vital while reading the data sheet. The atmega328p has 2048 bytes of SRAM, and therefore plenty of room for both data buffer, globals and stack. Sorry for the confusion I may have caused.