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
CSpin 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?
-
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
CSpin 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)?
-
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
CSpin 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 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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login