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.
- I am using the dspi_half_duplex_int_master SDK for communication for K22F
- The Arduino is using the default Arduino LIbray for SPI communication.
This means, that in Arduion I am using the spi->transfer() function, whereas in the K22F I am
- DSPI_MasterInit()
- DSPI_MasterTransferCreateHandle()
- DSPI_MasterHalfDuplexTransferNonBlocking()
to send.
I have already checked the following:
- I have checked the buffers and the sent content is correct.
- I have checked the clock frequency and tested various values. Also to no avail
- SPI-mode is the same as in Arduinos case (CPHA=0, CPOL=0)
- slave-select line (with an oscilloscop) and that's ok. Both are sent in MSB so that's also fine.
- Checked SPI communication between K22F(master) and Arduino(slave) as a test, so sending works.
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!