# Microstrain 3DMGX5 Interface

Source: https://forum.modalai.com/topic/1422/microstrain-3dmgx5-interface
Category: Flight Core and Legacy VOXL (https://forum.modalai.com/category/9/flight-core-and-legacy-voxl)
Tags: flight-core
Posted: 2022-10-03 17:31:31 UTC by Andrew Keefe
Replies: 2 · Views: 1485

## Andrew Keefe · 2022-10-03 17:31:31 UTC

I'm trying to receive streamed data from a 3DM-GX5 AHRS via UART. I'm re-using a port I've co-opted before.  Last time I ran the interface at 57,600 baud since that was the default already for the port.  This time the AHRS only supports 9600, 19200, 115200, 230400, 460800, 921600.

When I try and connect at 19200 I'm not getting the 21 byte packet I expect, which was separately verified with an Arduino using SoftwareSerial.

I'm seeing a lot of 252's and 28's.  I'm looking for 117,101 or if inverted 138,154.

Is there a baud rate issue with using the UART on J4?  Maybe something to do with USART vs UART?

I have disabled the mapping to TEL3 in default.cmake.

## Reply by modaltb (ModalAI staff) · 2022-10-05 15:28:20 UTC

Hi @Andrew-Keefe we have not experienced anything like this, although I think lowest I've got is 56700.  I am using this J4 currently with a MAVLink instance and it funcions at 115200.  We never use flow control, just Rx/Tx, not sure if that's your same setup?

Sometimes we try to do a loopback, and just write out and read back data at various bauds to prove things out.

## Reply by Andrew Keefe · 2022-10-06 14:51:17 UTC

I verified the UART is working fine using the loopback method, at a few different baud rates.  I think the issue is the sensor itself must be encoding the packets differently than I am reading them. I might need to reduce the baud rate down to 9600 and review the data on the oscilloscope. 

The Arduino's SoftwareSerial library didn't work properly until I inverted the input, but I didn't see that option for the linux UART.
