Page 1 of 1

Weird compass data on UART

Posted: Thu Sep 26, 2019 10:39 am
by BenC
Hello,
I bought marvelmind system recently and I try to get compass data on Arduino. I obtain weird data, higher than 65000 but it will be 12 bits so under 4096, right?
I use a modified version of hedgehog_sample_uart_v3 to get compass data and I have also the same issue with hedgehog_sample_uart_imu_raw_v1 that I have been finding on forum.
Thanks in advance

Re: Weird compass data on UART

Posted: Thu Oct 03, 2019 7:44 pm
by smoker77
Hello,

It looks like negative values.
Compass values are signed 16 bit represented in two's complement code.
https://en.wikipedia.org/wiki/Two%27s_complement

Value -1 is represented as 65535 and so on.
Generally, if "V" is received 16-bit value and high bit of this value is 1, you should treat the result as (V-2^16)

Re: Weird compass data on UART

Posted: Fri Jun 26, 2020 10:29 am
by hunteril
Hello
could you please specify the pin connection between arduino and marvelmind modem ?

Re: Weird compass data on UART

Posted: Sun Jun 28, 2020 7:17 pm
by smoker77
Hello,

You should connect USART2_TX pin of modem to UART RX pin (digital pin 0) on Arduino and modem's ground pin to Arduino's GND.
Modem's pinout is shown in section 8.3 of the manual:
https://marvelmind.com/pics/marvelmind_ ... manual.pdf

Re: Weird compass data on UART

Posted: Sun Jun 28, 2020 8:58 pm
by hunteril
Hello smoker77,
again thanks for your reply.

I tried both ways: connecting the arduino to modem and then to mobile beacon.

No compass information is available

any advice please ?

Re: Weird compass data on UART

Posted: Thu Jul 02, 2020 9:04 pm
by smoker77
Hello,

Please check presence of IMU in your beacon as I described in the topic:
https://marvelmind.com/forum/viewtopic. ... 178#p40178