Community Forum
    • Blog
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. Edward7L
    E
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Groups 0

    Edward7L

    @Edward7L

    195
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Edward7L Unfollow Follow

    Latest posts made by Edward7L

    • RFM12_arrsi adding atmega 2560

      @charleshallard
      Hello, I am trying to add the atmega 2560 to the libraries RFM12B_arrsi.h and RFM12B_arssi.cpp. What do I need to change or add to get this to work? I have tried adding
      #elif defined(AVR_ATmega2560) || defined(AVR_ATmega1280)
      #define RFM_DEFAULT_IRQ 2
      #define SS_DDR DDRB
      #define SS_PORT PORTB
      #define SS_BIT 0
      #define SPI_SS 53 // PB0, pin 19
      #define SPI_MOSI 51 // PB2, pin 21
      #define SPI_MISO 50 // PB3, pin 22
      #define SPI_SCK 52 // PB1, pin 20

      to RFM12B_arssi.h and

      #elif defined(AVR_ATmega2560) || defined(AVR_ATmega1280)
      if (irq_pin==10 || irq_pin==11 || irq_pin==2)
      {
      // 1st detach the existing one
      detachInterrupt(irq_pin==2?2:irq_pin-10);

      irq_pin = irqPin;
      

      }
      else
      {
      // Set new pin
      irq_pin = RFM_DEFAULT_IRQ;
      }

      to the function void RFM12B::SetIRQ(uint6_t irqPin) in RFM12B_ arssi.cpp and

      #elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
        //  IRQ authorized are D10 (INT0), D11 (INT1) or D2 (INT4) added by me :) 
        if (irq_pin==10 || irq_pin==11 || irq_pin==2)
        {
          if (nodeID != 0)
            // INT0 or INT1 for pin D10/D11 and INT2 for pin D2
            attachInterrupt(irq_pin==2?2:irq_pin-10, RFM12B::InterruptHandler, LOW);
          else
            // INT0 or INT1 for pin D10/D11 and INT2 for pin D2
            detachInterrupt(irq_pin==2?2:irq_pin-10);
        }
      

      to RFM12B_arssi.cpp in the function RFM12B:: ConfigureInterrupts(); This does not work and it fails the detection in radio.isPresent. Any help would be greatly appreciated.

      posted in ArduiPi
      E
      Edward7L