Community Forum
    • Blog
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    RFM12_arrsi adding atmega 2560

    Scheduled Pinned Locked Moved ArduiPi
    2 Posts 2 Posters 5.5k Views
    Loading More Posts
    • 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.
    • E Offline
      Edward7L
      last edited by

      @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.

      1 Reply Last reply Reply Quote
      • B Offline
        BrockDorf
        last edited by BrockDorf

        Hi...the first option is when AVR and ESP are connect over serial 1. In this mode you can't use USB (upload and monitor are unavailable). You must accept this fact and monitor using serial 2, telnet, LCD, TV out .. . To change the sketch you must select other mode with dip switches. Or use ESP firmware with AVR sketch OTA upload over WiFi.

        pcb assembly process

        1 Reply Last reply Reply Quote
        • First post
          Last post

        6

        Online

        5.7k

        Users

        534

        Topics

        5.0k

        Posts

        Top Topics

        • Denky 4 - Domoticz - Triphasé -
          Nicolas BernaertsN
          Nicolas Bernaerts
          0
          7
          241

        • Denky D4 et Linky Standard TInfo Rx Non Configuré
          CharlesC
          Charles
          0
          5
          280

        • CC1101
          CharlesC
          Charles
          0
          2
          116

        Popular Tags

        teleinfo
        24 topics
        arduino
        19 topics
        remora
        16 topics
        esp8266
        10 topics
        arduipi
        10 topics
        wifinfo
        7 topics
        raspberry
        7 topics
        broadcast
        7 topics
        Copyright © 2022 Charles-Henri Hallard | Return to blog page | Powered by NodeBB