LoRa Fail when connect any other device on the SPI bus (P5,P6,P7)

  • Hi , we are doing a development with the L01 OEM module , and we need to connect others SPI modules in the defualts pin LoRa (P5,P6,P7) and we see that when , you configure the SPI bus on that pins the LoRa modules begin to Fail getting the following error :


    i would like to know if someone, has try something like that working lora module and other SPI device in the same bus , or may be a low level access to the registers of the lora module inside the L01 ,

    Other solution that we are thinking is to use the CS but the pin is internal :


    how can we access to that pins ?

  • thanks @robert-hh im trying but still fail , i will change the pins !

  • @rrodriguezm The link that I sent you points to the configuration, as far as I can tell. But as said, that is just one piece of the game. If the Lora driver does not release the chip, then it will not work. Looking at my LoPy4 here it seems, that the bus is released. In times when the device is not sending, MiSO can be pulled up with a resistor. And the clock frequency is 10 MHz.
    And yes, it seems to be SPI3 which is used for that purpose (line 54 of the referenced file. That one indeed is inaccessible for Python code.

  • @robert-hh could you send me an example of the original config of the LoRa SPI bus , because im trying with the following line and does not work :

    SPI(0, mode=SPI.MASTER, baudrate=8000000, polarity=0, phase=0, firstbit=SPI.MSB, pins=('P5', 'P6', 'P7'))


    SPI(0, mode=SPI.MASTER, baudrate=10000000, polarity=0, phase=0, firstbit=SPI.MSB, pins=('P5', 'P6', 'P7'))


  • @rrodriguezm The CS pin is internal = below the cover.
    It might be possible to use the SPI bus, if
    a) after using it you reconfigure it back to the mode Lora needs, or you use the same mode. The configuration code for Lora is in this file: https://github.com/pycom/pycom-micropython-sigfox/blob/master/esp32/lora/spi-board.c
    b) CS for LoRa is deassigned when de device is not used.
    I did not look for that.

    Anyhow, I have my doubts, because the LoRa chip may trigger an interrupt any time when it requires attention (like a message arrived), and that will break your code too.

Log in to reply

Pycom on Twitter