RAK5801 access to MCU

Please include the following information, in order for us to help you as effectively as possible.

  • What product do you wish to discuss? RAK4631
  • What firmware are you using? Arduino BSP
  • What firmware version? Can it be obtained with AT+VER=?
  • Computer OS? (MacOS, Linux, Windows) Windows
  • What Computer OS version? Windows 11

Good afternoon,

I would like to understand better how is the RAK5801 communication with the nRF52840. I was looking in the spreadsheet Wisblock-IO-Pin-Mapper.xlsx(screenshot below). I saw that RAK5801 is connect at pin A0=>P0.04, A1=>P0.31, IO1=>P0.17, I2C_SDA=>P0.13 and I2C_SCL=>P0.14

In the example Hydraulic Pressure Monitoring :

/**
 * @file Hydraulic_Pressure_Monitoring.ino
 * @author rakwireless.com
 * @brief This sketch demonstrate reading data from a P300 hydraulic pressure sensor
 *    and send the data to lora gateway.
 * @version 0.1
 * @date 2020-07-28 
 * @copyright Copyright (c) 2020
 */

#include <Arduino.h>
#include <LoRaWan-RAK4630.h> //http://librarymanager/All#SX126x
#include <SPI.h>
void setup()
{
	pinMode(LED_BUILTIN, OUTPUT);
	digitalWrite(LED_BUILTIN, LOW);

	/* WisBLOCK 5801 Power On */
	pinMode(WB_IO1, OUTPUT);
	digitalWrite(WB_IO1, HIGH);
	/* WisBLOCK 5801 Power On */

  1. Why the code has “#include <SPI.h>”, if RAK5801 is not using SPI, or I am wrong ?
  2. Why RAK5801 is connect to I2C if it is not being used? Could I used I2C instead of a direct pin WB_IO1?

Regards,

Cláudio

Hi @crmrosa ,

To answer your question.

  1. SPI is used to communicate with the Semtech LoRa transceiver.
  2. I2C is there to allow you to attach external sensors/peripherals that that is based on I2C. You can use the I2C pins as you see fit in your application.

Hi @carlrowan ,

The SPI, it is correct, I forgot about the SX1262.

About I2C, I know the in my environment, RAK1904/RAK1906/RAK/RAK15004/RAK12500 are using I2C, but I didn´t see in the code any mention about RAK5801 I2C address, but it is connect with I2C. Why?

The RAK5801 does not have any I2C device on it, but it exposes the I2C bus on its connector.
I guess that’s the only reason why it is in the example codes.

Hi @crmrosa ,

As Bernd said, it is only a connector.

Good use case is for example you need to integrated a temp-humidity probe sensors via I2C to WisBlock, you can easily attach such external sensor probes.

image

Thank you, @carlrowan and @beegee .

Claudio