I've been using the Ra-02 LoRa modules for a while now, very impressed by its performance. In a recent device I made I combined a 4-20mA transmitter with the LoRa module on an UNO. This specific mA transmitter uses I2C to connect to the UNO so this together with the LoRa module my device works well together.
Lately I've been moving more towards pro-minis, in order to cut out the need for logic level converters for the LoRa radio. then I bought a different mA transmitter that also runs off 3.3V. Challenge is that this mA transmitter uses SPI, same as the LoRa radio. Both devices work beautifully when connected seperately, but I'm having a hard time getting them to work together on the same pro-mini.
The LoRa default setup: NSS - D10, MOSI - D11, MISO - D12, SCK - D13.
The mA transmitter default setup: SDI - D11, SCK - D13, CS - D10. For CS I just changed the sketch to CS = D08, changed the lead onto D08, and the mA transmitter works fine like this..... Until I initialise the LoRa radio. Then the transmitter stops responding to commands - this is with the LoRa SS pin connected to D10
The LoRa library () allows to change the SS pin to whatever you want, and I've changed it to D07 as a test, and the radio works fine with this setting.
But when I run the code with LoRa and mA transmitter together, no joy. When I comment out the LoRa initialisation the mA transmitters works fine. When I do initialise and use the radio it works fine, but mA transmitter does not work.
I read somewhere that when using multiple SPI devices I need to keep D10 as an output, even when doing this I can't get both devices to work on this board.
I suspect there's something simple which I'm missing - can anyone nudge me in the right direction?