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
-
💬 UtiliPi
OpenHardware.io • 27 Aug 2018, 08:27 • openhardware.io 27 Aug 2018, 08:27 -
RFM69 not initialising (required reset could be the cause)
Troubleshooting • 29 Jan 2017, 09:13 • OpticFroggy 24 Mar 2018, 03:29 -
RFM69HW antenna
General Discussion • 4 Jul 2019, 13:42 • tsunami 8 Jul 2019, 09:45 -
Update RF24 library to latest version
Bug Reports • 23 Mar 2014, 23:37 • andriej 24 Mar 2014, 22:52 -
💬 Teleinfo with parasitic power
OpenHardware.io • 7 Feb 2017, 12:54 • openhardware.io 10 Feb 2017, 18:43 -
[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