Timer3 interrupt not work with LAM6 and LIS3MDL

Hi, everyone.
I’m Japanese user.

I’m developing the Balboa32U4 robot, and trying to use timer3 interruption with LSM6 and LIS3MDL liblaries.
But, the interrupt function does not work well in my implemented program.

my code

So, please let me know what’s wrong in my code.

Timer3 interruption was work well with “Balboa32U4Buzzer” liblary.

Hello.

Did you resolve your issue? It’s not clear from your recent post.

- Amanda

Hi, AmandaS.

Not yet.
In my tests, timer3 worked with only “Balboa32u4Buzzer”.
But, I want to use timer3 with “LSM6” and “LIS3MDL” libraries.

Can you better describe how the TimerThree library does not work as you expect and post a screenshot of your output showing the issue? Can you also post a link to the TimerThree library you are using?

- Amanda

I’m using this library as TimerThree.

If you upload a program using the TimerThree library and the LSM6 and LIS3MDL libraries to Balboa, the serial port connected to Balboa will be disconnected and Balboa will not be able to connect to the serial port unless it is in bootloader mode.

Even if Balboa could connect to the serial port, when I checked the IMU value using a serial monitor (eg here), there was no response.

The goal of this issue is to make the LSM6 and LIS3MDL libraries available via timer interrupts.

thank you

It sounds like your program is locking up, probably because your interrupt service routine (ISR) is trying to call functions that also use interrupts. The Arduino Wire and Serial libraries and delay() function require interrupts to work, so they will not or unreliably work if called in an ISR. You should consider finding different way to make the sensors’ readings available outside of an ISR.

- Amanda

Thank you very much.

In other words, does it mean that “LSM6 and LIS3MDL libraries that use wire.h cannot be used in interrupt processing?”

Yes.

- Amanda