0
\$\begingroup\$

I am getting readings from CS5463 power monitoring chip using SPI on the feather. I want to transmit these readings onto the LoRa gateway I have setup. I have no problems only transmitting the values.

However when I am trying to transmit and get the power readings simultaneously, I am facing problems.

It seems that LoRa radio also uses the CLK, MOSI and MISO pins which are being used for SPI transactions as well. Could anyone help me with this? I want to read power and transmit simultaneously.

\$\endgroup\$
1
  • \$\begingroup\$ Technically you could be taking another reading while to LoRa chip is transmitting from its buffer, but that's a bad idea. First you'd exceed duty cycle regulations. Next, you probably don't want to be measuring while the radio transmitter is active. \$\endgroup\$ Dec 13, 2020 at 14:57

1 Answer 1

0
\$\begingroup\$

Only one device can be addressed at one time. You need to provide separate SS(slave select) pins for each device. It is then up to your code to manage who is being talked to at one time. Alternately, provide another SPI interface = this can be bit-bashed (code to toggle the required gpio pins) vs the SERCOM/SPI peripheral. As for 'simultaneously', I dare say reading the CS5463 only takes a short amount of time vs the LoRa stack actually transmitting the data, so as long as the system can send your data at the required update rate, this is a close to 'simultaneous' as you'll get. Remember, you only have one processor that can run only one bit of code at a given time.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for taking time to answer my question. I need to setup both CS5463 and LoRa respectively to work individually. so do I keep setting them up each time it takes a reading or do I just pull up(turn off) the SS pin of LoRa radio before I turn the SS of cs5463 low(turn on)? Just wanted to check if I my understanding is right? \$\endgroup\$ Dec 14, 2020 at 6:00
  • \$\begingroup\$ Only one SS signal can be low at one time. As for ‘setting them up’ I’m not sure what you mean. Your spi code works in terms of transactions. The transaction begins when SS is pulled low and finishes when SS is set high. \$\endgroup\$
    – Kartman
    Dec 14, 2020 at 6:10
  • \$\begingroup\$ So the backside of feather says it uses SCLK, MOSI,MISO and pin 8 as CS, 4 as RST and 3 as IRQ. I am using pin number 12 as CS for CS5463. What I did is, I always pulled pin 8 high before pulling 12 Low. and after I pulled 12 back to high, I set 8 to low again. I am still not able to get the readings out. But my LoRa packets are being transmitted perfectly. I am just getting 0s from CS5463. \$\endgroup\$ Dec 14, 2020 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.