IrReceiver.decode() uses all ATTiny88 memory?

Hi,
I'm using Windows 11, IDE 2.2.1.

I'm unable to program ATTiny88 which results in the following error:

Sketch uses 7174 bytes (87%) of program storage space. Maximum is 8192 bytes.
Global variables use 545 bytes (106%) of dynamic memory, leaving -33 bytes for local variables. Maximum is 512 bytes.
Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint.
data section exceeds available space in board

Compilation error: data section exceeds available space in board

I've commented everything out one by one to identify the cause of the error. It is only the "if" clause, even if empty that causes the error if (IrReceiver.decode())

This is the complete Sketch with the "switch options commented out:

/*
THESE ARE THE SPECIAL STEPS TO PROGRAM THE ATTINY88:
https://forum.arduino.cc/t/practical-help-uploading-programs-to-attiny88-board/1131392/48
*/
#include <IRremote.hpp>
#define IR_RECEIVE_PIN 7
const int PIN = 10;
unsigned long key_value = 0;

void setup()
{
  IrReceiver.begin(7, ENABLE_LED_FEEDBACK); // Start the receiver
  IrReceiver.enableIRIn();
  pinMode(10, OUTPUT);
}

void toggleLED(int PIN) 
{ 
  digitalWrite(10, digitalRead(10) == HIGH ? LOW : HIGH);
}

void loop()
{
  if (IrReceiver.decode())
  {
    /*
    //key_value = IrReceiver.decodedIRData.decodedRawData;
    switch(0xE31CFF00)
    {
      case 0xE31CFF00: //Keypad button "5"
      toggleLED(10);
    }
    
    IrReceiver.resume();
    */
  }
}

The goal is to use the ATTiny88 to control LEDs with a remote. A Nano board compiles fine. Is there an alternative if what I am experiencing true?

Thank you

A Nano board has 4 times the RAM memory.

What you are doing is like trying to pour a liter of milk into a half-liter pitcher. It's just not going to fit. There's no work-around to that. For each project it is important to choose an appropriate processor. You will need a larger one.

2 Likes

You confirmed my suspicion. I was hoping for a different answer. Thank you for your prompt response.

The IrReceiver library has a special minimal receiver variant for low memory devices, see the Readme

This opens up new opportunities. As a result of this information I've discovered these libraries:

  • IRRemoteControl.h
  • TinyIRReceiver.hpp
  • TinyIRSender.hpp
  • IRRemoteControlInt_h
    At this point I have no idea of the purpose of each of these libraries but it opens up the possibility of using the ATTiny88 after all.

Thank you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.