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. General Discussion
  3. How to use additional SPI device with RFM69 repeater node?

How to use additional SPI device with RFM69 repeater node?

Scheduled Pinned Locked Moved General Discussion
ade7763rfm69hwspi
5 Posts 3 Posters 2.2k 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.
  • J Offline
    J Offline
    jkandasa
    Plugin Developer
    wrote on last edited by
    #1

    My Hardware: Moteino R4, ATMEGA328P + RFM69HW

    I have an issue when communicating with an additional SPI device. I have ADE7763 energy monitor SPI chip which operates on low clock speed.

    When I read data from ADE7763, I reconfigure SPI settings as follows,

    ADE7763 CS pin connected to D9.

    void loop() {
      updateVoltageCurrentData();
      .....
      .....
    }
    
    void updateVoltageCurrentData() {
      SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE1));
      uint8_t status = ADE_sampleRMS(&vrms, &irms); // reads VRMS and IRMS from ADE7763
      SPI.endTransaction();
    }
    

    This settings working ok, but after some time, this particular node lost from RF network. Looks like RFM69 SPI settings corrupted.

    Any recommended way to communicate with additional SPI device?

    skywatchS mfalkviddM 2 Replies Last reply
    0
    • J jkandasa

      My Hardware: Moteino R4, ATMEGA328P + RFM69HW

      I have an issue when communicating with an additional SPI device. I have ADE7763 energy monitor SPI chip which operates on low clock speed.

      When I read data from ADE7763, I reconfigure SPI settings as follows,

      ADE7763 CS pin connected to D9.

      void loop() {
        updateVoltageCurrentData();
        .....
        .....
      }
      
      void updateVoltageCurrentData() {
        SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE1));
        uint8_t status = ADE_sampleRMS(&vrms, &irms); // reads VRMS and IRMS from ADE7763
        SPI.endTransaction();
      }
      

      This settings working ok, but after some time, this particular node lost from RF network. Looks like RFM69 SPI settings corrupted.

      Any recommended way to communicate with additional SPI device?

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

      @jkandasa - Maybe this helps? Perhaps a speed issue causing packet collision?

      https://www.raspberrypi.org/forums/viewtopic.php?p=347073

      Are the devices using the same clock freq? Mught be worth adding a delay between command send/request to allow a change in clock to settle (if dynamic clock is even allowed in SPI)?

      1 Reply Last reply
      0
      • J jkandasa

        My Hardware: Moteino R4, ATMEGA328P + RFM69HW

        I have an issue when communicating with an additional SPI device. I have ADE7763 energy monitor SPI chip which operates on low clock speed.

        When I read data from ADE7763, I reconfigure SPI settings as follows,

        ADE7763 CS pin connected to D9.

        void loop() {
          updateVoltageCurrentData();
          .....
          .....
        }
        
        void updateVoltageCurrentData() {
          SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE1));
          uint8_t status = ADE_sampleRMS(&vrms, &irms); // reads VRMS and IRMS from ADE7763
          SPI.endTransaction();
        }
        

        This settings working ok, but after some time, this particular node lost from RF network. Looks like RFM69 SPI settings corrupted.

        Any recommended way to communicate with additional SPI device?

        mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by mfalkvidd
        #3

        @jkandasa have you tried using software spi? For the slow device, it should work quite well I think.

        skywatchS 1 Reply Last reply
        0
        • mfalkviddM mfalkvidd

          @jkandasa have you tried using software spi? For the slow device, it should work quite well I think.

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

          @mfalkvidd That is a good idea to try.

          @jkandasa Are you using pull up resistors on the CS lines to each device - that might be worth a try too....

          J 1 Reply Last reply
          0
          • skywatchS skywatch

            @mfalkvidd That is a good idea to try.

            @jkandasa Are you using pull up resistors on the CS lines to each device - that might be worth a try too....

            J Offline
            J Offline
            jkandasa
            Plugin Developer
            wrote on last edited by
            #5

            @skywatch @mfalkvidd Thank you for your comments.

            I am using Moteino R4 and RFM69 connected to hardware SPI pins. I tried the same pin with softSPI, but I could not get success.

            Now I have altered the ADE7763 Arduino library to update SPI settings on every call. And added code to update the only flag on ADE7763 interrupt(like we have in RFM69_new library). Seems all look somewhat ok.

            I think for RFM69 we use a default clock speed. for ADE7763: SPI_CLOCK_DIV4

            Are you using pull up resistors on the CS lines to each device - that might be worth a try too....

            Yes, I have

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


            20

            Online

            11.7k

            Users

            11.2k

            Topics

            113.0k

            Posts


            Copyright 2019 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