Jack Purdum
All: In Allard's defense, it's even worse than he's letting on. Using 87% of the Flash memory is running on the edge, but is probably okay. The really scary statistic is the 74% on the SRAM memory. Recall that all of the data is stored in SRAM and the 74% number is the compile-time use statistic, not the run-time use. As the program runs and functions are called, each of which likely passes more data to the function during the call, the stack memory, which is part of SRAM, is getting skinnier and skinner. Think of a stack of dinner plates. The bottom of SRAM is called the "heap" and that were the global data are stored. So Allard may have several hundred plates at the bottom of the stack already used (i.e., dirty dinner plates!). As temporary data are define in functions and during calls, plates are removed from the stack and used...the unused stack of plates is getting skinnier. That 74% figure is the picture of the dinner plate stack before the restaurant doors are even opened...it's a compile-time statistic. When the program runs, it's like opening the restaurant doors to a bunch of football teams.? My own experience was that I started getting erratic behavior when I was running around 72% of SRAM memory for one of my programs. (I was using some large graphics temporary variables in SRAM.) What Allard has shoehorned into the Nano is amazing. So, don't let those percentages fool you. He been doing a tight rope act over the Grand Canyon for quite some time now. Jack, W8TEE? From: Allard PE1NWL <pe1nwl@...> To: [email protected] Sent: Saturday, May 27, 2017 3:48 PM Subject: Re: [BITX20] doTuning() mod, utility, vanity Paul, your idea is a "nice-to-have" one, but unfortunately we're running out of memory: original sketch v1.13: Sketch uses 26886 bytes (87%) of program storage space. Maximum is 30720 bytes. Global variables use 1521 bytes (74%) of dynamic memory, leaving 527 bytes for local variables. Maximum is 2048 bytes. updated sketch: Sketch uses 26944 bytes (87%) of program storage space. Maximum is 30720 bytes. Global variables use 1555 bytes (75%) of dynamic memory, leaving 493 bytes for local variables. Maximum is 2048 bytes. Low memory available, stability problems may occur. It's caused by the 3 printLine2 commands that consume a lot of RAM. 73 Allard PE1NWL |