How to enable/disable INT1/INT2 in the RAK1904?

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

  • What product do you wish to discuss? RAK463

  • What firmware are you using? VSCode/latformIO

  • What firmware version?

  • Computer OS? (MacOS, Linux, Windows) Windows

  • What Computer OS version? Windows 11

  • How often does the problem happen? Always

  • How can we replicate the problem? Yes

  • Provide source code if custom firmware is used or link to example if RAKwireless example code is used.

I read in a ST forum that the Device Register responsable by INT2 it is LIS3DH_CTRL_REG6. The value is defined at he library SparkFunLIS3DH.h. Could I redefine the value using Platformio.ini as the example below? What is the best method to do these configurations?

I found the LIS3DH documentation and there I found the INT1/INT2 registers status behavior control:

I am trying to do this avoid, when it is possible, the conflicts in the nRF52840 pins.




build_flags =
; LEDs
; calibração das variáveis ambientais
; Desabilitar INT2 no RAK1904 para evitar conflito com RAK5801
; -D LIS3DH_CTRL_REG6=0x25


The library SparkFunLIS3DH.h

//Device Registers
#define LIS3DH_STATUS_REG_AUX 0x07
#define LIS3DH_OUT_ADC1_L 0x08
#define LIS3DH_OUT_ADC1_H 0x09
#define LIS3DH_OUT_ADC2_L 0x0A
#define LIS3DH_OUT_ADC2_H 0x0B
#define LIS3DH_OUT_ADC3_L 0x0C
#define LIS3DH_OUT_ADC3_H 0x0D
#define LIS3DH_WHO_AM_I 0x0F

#define LIS3DH_TEMP_CFG_REG 0x1F
#define LIS3DH_CTRL_REG1 0x20
#define LIS3DH_CTRL_REG2 0x21
#define LIS3DH_CTRL_REG3 0x22
#define LIS3DH_CTRL_REG4 0x23
#define LIS3DH_CTRL_REG5 0x24
#define LIS3DH_CTRL_REG6 0x25
#define LIS3DH_REFERENCE 0x26
#define LIS3DH_STATUS_REG2 0x27
#define LIS3DH_OUT_X_L 0x28
#define LIS3DH_OUT_X_H 0x29
#define LIS3DH_OUT_Y_L 0x2A
#define LIS3DH_OUT_Y_H 0x2B
#define LIS3DH_OUT_Z_L 0x2C
#define LIS3DH_OUT_Z_H 0x2D
#define LIS3DH_FIFO_SRC_REG 0x2F
#define LIS3DH_INT1_CFG 0x30
#define LIS3DH_INT1_SRC 0x31
#define LIS3DH_INT1_THS 0x32
#define LIS3DH_INT1_DURATION 0x33

#define LIS3DH_CLICK_CFG 0x38
#define LIS3DH_CLICK_SRC 0x39
#define LIS3DH_CLICK_THS 0x3A
#define LIS3DH_TIME_LIMIT 0x3B


I never disabled both interrupts due to the way I am using the RAK1904, but from the code I see

	// Select interrupt pin 1
	data_to_write = 0;
	data_to_write |= 0x40; // AOI1 event (Generator 1 interrupt on pin 1)
	data_to_write |= 0x20; // AOI2 event ()
	rak1904_writeRegister(LIS3DH_REG_CTRL3, data_to_write);

	// No interrupt on pin 2
	rak1904_writeRegister(LIS3DH_REG_CTRL6, 0x00);

from that I guess just

	// no interrupt on pin 1
	rak1904_writeRegister(LIS3DH_REG_CTRL3, 0x00);

	// No interrupt on pin 2
	rak1904_writeRegister(LIS3DH_REG_CTRL6, 0x00);

should work.

We are looking for possibility to disable RAK1904 interruption, because in some modules arrange in our solutions (RAK19007, RAK4631, RAK12500, RAK1904, RAK1906, RAK15007, RAK5801), we will have a INT conflict between RAK1904 and RAK5801. To disable one of RAK1904 could be a possibility to do a workaround in the conflict.

What do you think?


Yes, that could work.
I checked the schematics, unfortunately both INT are hardwired to the connector without 0 Ohm resistors. So we cannot disconnect them complete.

Maybe you can try to disable the INT’s with the code I showed above.

1 Like

I will do your suggestion.

Thank you by your support.


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.