CMPS12 using serial connectivity

Hi all,

I have been searching high and low, but please point me in the right direction if this has been done before and it is just me being stupid for not finding it.

I have a CMPS12 compass module working beatifully usinf I2C on a Raspberry PI, but now I want to use it on a PI with no GPIO pins left to use. I have a USB UART serial converter and I hvae created a bridge from GND to the mode pin, wrote a mini script using the serial Python module.

To start with I am just trying to send 0x11, receiving 1 byte, which should be the firmware version, but despite using 9600 8N1, I get nothing back.

Any ideas???

1 Like

Hi @mmo and welcome to our forum!

I would first advise that you check electrical connections. Particularly the TX and RX connections. Double-check that the CMPS12 module is powered properly.

Also, verify that the USB UART serial converter is recognized by your Raspberry Pi. You can do this by checking the output of ls /dev/ttyUSB* or dmesg | grep tty to see if it appears when plugged in.

And make sure you’re using the correct serial port in your Python script. It typically looks something like /dev/ttyUSB0.

Let me know if this helps.

Is the signal polarity correct?

1 Like