Interrupts Revisited
In my last post I had two approaches for fixing the issue with transmit interrupts. As I was sorting out the configuration for my Fezportal device and SS20100 Dev board(both sockets) with a Cascologix MikroBus LoRa click I had similar issues with both receive and transmit.


I noticed the extra RegIrqFlags 0X58, Receive-Message in the debugging output.
The thread '<No Name>' (0x2) has exited with code 0 (0x0). Sending 13 bytes message Hello LoRa 1! RegIrqFlags 0X08 Transmit-Done Sending 13 bytes message Hello LoRa 2! RegIrqFlags 0X08 Transmit-Done RegIrqFlags 0X58 Receive-Message Received 23 byte message �LoRaIoT1N3WT 20.5,H 86 Transmit-Done Sending 13 bytes message Hello LoRa 3! RegIrqFlags 0X08 Transmit-Done
This was with the modified device write methods so I tried changing the Serial Peripheral Interface(SPI) configuration.
public RegisterManager(string spiPortName, int chipSelectPin, int clockFrequency = 500000) { GpioPin chipSelectGpio = GpioController.GetDefault().OpenPin(chipSelectPin); var settings = new SpiConnectionSettings() { ChipSelectType = SpiChipSelectType.Gpio, ChipSelectLine = chipSelectGpio, Mode = SpiMode.Mode0, ClockFrequency = clockFrequency, ChipSelectActiveState = false, ChipSelectHoldTime = new TimeSpan(1), }; SpiController spiController = SpiController.FromName(spiPortName); rfm9XLoraModem = spiController.GetDevice(settings); }
When I added the ChipSelectHoldTime (even the smallest possible one) the code worked as expected.
The thread '' (0x2) has exited with code 0 (0x0). Sending 13 bytes message Hello LoRa 1! RegIrqFlags 0X08 Transmit-Done Sending 13 bytes message Hello LoRa 2! RegIrqFlags 0X08 Transmit-Done RegIrqFlags 0X50 Receive-Message Received 23 byte message �LoRaIoT1N3WT 20.5,H 87 Sending 13 bytes message Hello LoRa 3! RegIrqFlags 0X08 Transmit-Done Sending 13 bytes message Hello LoRa 4! RegIrqFlags 0X08 Transmit-Done
At this point I have run out of ideas so I will release the code this fix.