Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. ArduinoShrink

ArduinoShrink

Scheduled Pinned Locked Moved Development
5 Posts 3 Posters 108 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tssk
    wrote on last edited by
    #1

    Today I came across interesting project https://github.com/nerdralph/ArduinoShrink that promises smaller and faster code for ATmega168 and 328 MCUs at 4 to 16 MHZ.

    But the library is not compatible with mysensors

    wiring.c.o (symbol from plugin): In function `delayMicroseconds':
    (.text+0x0): multiple definition of `main'
    sketch/mys-868-node.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
    collect2: error: ld returned 1 exit status
    exit status 1
    Error compiling for board Arduino Pro or Pro Mini.
    

    Would it be possible to make it compatible? Is the problem maybe in the know limitation that when the pin is not known at compile time?

    1 Reply Last reply
    0
    • bjacobseB Offline
      bjacobseB Offline
      bjacobse
      wrote on last edited by
      #2

      I'm sure ATmega 168 have too little memory to be used for run the mysensors code... so don't buy a ATmega168

      ATMega 168
      Program Memory Size (KB) 16
      SRAM (B) 1,024
      Data EEPROM/HEF (bytes) 512

      ATMega 328
      Program Memory Size (KB) 32
      SRAM (B) 2,048
      Data EEPROM/HEF (bytes) 1024

      skywatchS 1 Reply Last reply
      0
      • bjacobseB bjacobse

        I'm sure ATmega 168 have too little memory to be used for run the mysensors code... so don't buy a ATmega168

        ATMega 168
        Program Memory Size (KB) 16
        SRAM (B) 1,024
        Data EEPROM/HEF (bytes) 512

        ATMega 328
        Program Memory Size (KB) 32
        SRAM (B) 2,048
        Data EEPROM/HEF (bytes) 1024

        skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by
        #3

        @bjacobse That is a bit of a myth that 168 is not useable in mysensors.... ATmegs 168 was enough for me to run a door/window node with 2 switch coneacts and temp and humidity with htu21D - it all just about fitted!

        So it is OK for small security nodes and simpler projects. But it does have half the memory so don't expect all example to fit on it.

        i use 168 for all door/window and similar as they are cheaper and do the job just as well..... ;)

        bjacobseB 1 Reply Last reply
        1
        • skywatchS skywatch

          @bjacobse That is a bit of a myth that 168 is not useable in mysensors.... ATmegs 168 was enough for me to run a door/window node with 2 switch coneacts and temp and humidity with htu21D - it all just about fitted!

          So it is OK for small security nodes and simpler projects. But it does have half the memory so don't expect all example to fit on it.

          i use 168 for all door/window and similar as they are cheaper and do the job just as well..... ;)

          bjacobseB Offline
          bjacobseB Offline
          bjacobse
          wrote on last edited by
          #4

          @skywatch
          I'm amazed that you made it work, which is good in your case
          But in most cases it might not work, and your MCU will crash RAM/stack and you will have troubles to understand what goes wrong.
          https://electronics.stackexchange.com/questions/146298/what-happens-when-microcontrollers-run-out-of-ram

          So to be on se the safe side for most people, then buy 328 as it from Mouser only cost 1,92€ and the 168 costs1,40€ for the cheapest variant of each, so for a hobbyist this price is nothing compared to the troubles you might have. Naturally if you have production and manufactures thousands devices this price different is extra money in your pocket

          skywatchS 1 Reply Last reply
          0
          • bjacobseB bjacobse

            @skywatch
            I'm amazed that you made it work, which is good in your case
            But in most cases it might not work, and your MCU will crash RAM/stack and you will have troubles to understand what goes wrong.
            https://electronics.stackexchange.com/questions/146298/what-happens-when-microcontrollers-run-out-of-ram

            So to be on se the safe side for most people, then buy 328 as it from Mouser only cost 1,92€ and the 168 costs1,40€ for the cheapest variant of each, so for a hobbyist this price is nothing compared to the troubles you might have. Naturally if you have production and manufactures thousands devices this price different is extra money in your pocket

            skywatchS Offline
            skywatchS Offline
            skywatch
            wrote on last edited by
            #5

            @bjacobse I was surprised too as like you I had seen that they would not work with mysensors and definitely not with debug output - with 2 switches I was able to use debug output, but not after adding the htu21d (which I expected to fail, but after a little code change worked well). We live, We learn! :)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            17

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular