I have a small project where I need an inverted UART signal and I wanted to solve it with my new Itsy Bitsy M4. I read that it should be possible to invert both RX and TX. I have found that this requires setting bit 10 (RXINV) of the CTRLA register to 1 and bit 9 (TXINV) of the CTRLA register to 1 as well.
Sounds easy, but I have no idea how to do it. I have never dealt with registers. After googling for a while I'm a bit desperate.
Does anyone have any experience with inverted UART on a SAMD51 or know how to change the CTRLA register?
Thanks a lot!
Itsy Bitsy M4 and inverted UART
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- blnkjns
- Posts: 963
- Joined: Fri Oct 02, 2020 3:33 am
Re: Itsy Bitsy M4 and inverted UART
Not totally sure, but I believe this happens if you enable the pull-up resistor.
What happens if you use
What happens if you use
Code: Select all
pinMode(0,INPUT_PULLUP);
pinMode(1,INPUT_PULLUP);
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Itsy Bitsy M4 and inverted UART
Unfortunately, poking around in the SERCOM settings doesn't have an easy option. Too many things are interconnected, and rely on a large chunk of background information.
You can sidestep the problem in hardware by running the TX and RX signals through an inverter like the 74acht14:
https://www.adafruit.com/product/3877
Please be positive and constructive with your questions and comments.