Hi,
I am currently working with the FRDM-K22F and trying to communicate with a LoRa Module based on the Semtech SX1276 via SPI. I want to read and write from/to the LoRa module. I am sending the address and value in an array in Single access mode. My problem is that the replies from the LoRa module are simply wrong and it is not working.
How do I know that it's wrong? I have a fully functional Setup with Arduino and LoRa SX1276 (also via SPI communication) and can read the outputs.
This means, that in Arduion I am using the spi->transfer() function, whereas in the K22F I am
to send.
I have already checked the following:
At this point I don't know what further error sources to pursue. For the LoRa code I am using these examples: GitHub - sandeepmistry/arduino-LoRa: An Arduino library for sending and receiving data using LoRa ra... and this one GitHub - loraraspi91/LoRa4Raspi
One difference I could observe with the help of the oscilloscop is that in the case of the K22F there are 4 flanks on the MOSI line in one Single access whereas on the Arduino there are only 2. I am not sure if that is of any use.
thanks for any help!
Solved! Go to Solution.
Hello
Hope you are well. I will gladly help you with this.
I suggest you use the function "DSPI_MasterTransferNonBlocking()" you can find an example of how to use it in the SDK example "dspi_interrupt_b2b_transfer_master".
Arduino uses a full-duplex scheme for the SPI so I suggest you refer to that example that is not in half-duplex.
Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar
Hello
Hope you are well. I will gladly help you with this.
I suggest you use the function "DSPI_MasterTransferNonBlocking()" you can find an example of how to use it in the SDK example "dspi_interrupt_b2b_transfer_master".
Arduino uses a full-duplex scheme for the SPI so I suggest you refer to that example that is not in half-duplex.
Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar
Hi Omar
Hope you are well.
Could you please help me find this example or function definition? I have been looking online and can't trace it.
Also, do you think this would work on the KL25Z?
Thank you very much
Ok, I was now able to try it out with the DSPI_MasterTransferNonBlocking() and it works. Thanks a lot!
Hi,
I hope you are also well.
Is this a problem, that the example SDK I use is half-duplex? From what I have read, half-duplex does not exist for SPI, since the master is always responsible for transfer.
Kind regards,
CK