How to use additional SPI device with RFM69 repeater node?
-
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 toD9
.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?
-
@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)?
-
@jkandasa have you tried using software spi? For the slow device, it should work quite well I think.
-
@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....
-
@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
Suggested Topics
-
💬 MDMSNode "xRoom"
OpenHardware.io • 1 Mar 2019, 13:38 • openhardware.io 1 Mar 2019, 13:38 -
Arduino & CC3000 Wifi & NRF24L01+ over SPI
Hardware • 12 Sept 2014, 22:16 • jesse 6 Jan 2016, 01:28 -
[SOLVED] NodeMCU ESP8266 and SPI with NRF24L01 + SD card module - sanity errors?
Troubleshooting • 26 Apr 2017, 20:53 • Kokosnoot 28 Apr 2017, 17:33 -
NRF24L01 and rfm69 in one gateway
General Discussion • 29 Dec 2016, 10:32 • Omemanti 29 Dec 2016, 14:46 -
💬 RFM69(H)W Arduino Mini Pro Shield
OpenHardware.io • 8 May 2017, 21:46 • openhardware.io 13 Aug 2018, 20:08 -
💬 MDMSNode "Lighting" Rev 1.1
OpenHardware.io • 27 Jul 2017, 06:45 • openhardware.io 30 Nov 2018, 11:56