OpenSprinkler Forums OpenSprinkler Unified Firmware Am I running out of memory?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #22435

    djagerif
    Participant

    I started to ‘fiddle’ with my Opensprinkler by adding two new web queries and also modified the lcd_display_time procedure to ‘flash’ the ‘:’ character every second. Everything works as designed but as soon as I add a third web query page then my unit hangs after a few seconds. Removing my third web query restores everything to normal. Just for interest, I can remove any of the three queries so it’s not a code issue (I think). Here is an example of one of the queries, the other two are exactly the same except to the returned variable:

    boolean print_webpage_rain_sensor (char *p)
    {
    bfill.emit_p(PSTR("0$D"), svc.status.rain_sensed);
    return true;
    }

    My compiled code size, when working, is 32626 bytes and when not working is 32706. Am I running out of memory?

    Ingo

    #23693

    Ray
    Keymaster

    Indeed if the program size is too close to the 32KB limit, you may run into SRAM overflow issue. It’s not because the program itself cannot fit in the flash memory, but it’s because the SRAM size it needs (including temporary variables) at run-time may exceed the 2KB available on mega328. So you have to play around with deleting some code to reduce the SRAM consumption.

    #23694

    djagerif
    Participant

    Thanks for the feedback. I did also check the RAM usage and it’s pretty close to max. I think you guys did a good job of squeezing every ounce of functionality out of limited flash and memory. Can you give us any indication what V2.0 will have for us? Some Tech-Specs would be nice.

    #23695

    Ray
    Keymaster

    V2.0 uses ATmega644, which is basically twice as big as ATmega328 in all aspects (program memory space, RAM, EEPROM). So a lot more features can be added before reaching the limit.

    #23696

    djagerif
    Participant

    I can’t wait…..

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware Am I running out of memory?