Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Magtag board does not have RX, TX, or UART
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Magtag board does not have RX, TX, or UART

by planxty312 on Wed Sep 29, 2021 10:39 pm

REPL says Adafruit CircuitPython 7.0.0-rc.1 on 2021-09-02 Adafruit MagTag with ESP32S2

import board
dir(board)

it does not display RX, TX, or UART

What am I doing wrong?

planxty312
 
Posts: 2
Joined: Mon Jul 25, 2016 3:28 pm

Re: Magtag board does not have RX, TX, or UART

by dastels on Thu Sep 30, 2021 9:11 am

The Tx/Rx connections are for debugging the ESP32-S2. It is not exposed in the board module.

Dave

dastels
 
Posts: 7893
Joined: Tue Oct 20, 2015 3:22 pm

Re: Magtag board does not have RX, TX, or UART

by planxty312 on Thu Sep 30, 2021 9:23 am

darn. Any good way to connect to a RS232 device?

planxty312
 
Posts: 2
Joined: Mon Jul 25, 2016 3:28 pm

Re: Magtag board does not have RX, TX, or UART

by dastels on Thu Sep 30, 2021 9:29 am

You might be able to repurpose the I2C interface to be a UART. There's also the D10 and A1 connections. You might be able to use them as a software (i.e. bit-banged) serial connection.

Dave

dastels
 
Posts: 7893
Joined: Tue Oct 20, 2015 3:22 pm

Re: Magtag board does not have RX, TX, or UART

by tannewt on Thu Sep 30, 2021 1:59 pm

You should be able to initialize a `busio.UART` with any of the exposed pins. The ESP32-S2 allows you to route any pin to most internal peripherals (like UART.)

`board` is only showing you names that are present on the physical board. You don't have to stick to those uses. :-)

tannewt
 
Posts: 2676
Joined: Thu Oct 06, 2016 8:48 pm

Re: Magtag board does not have RX, TX, or UART

by Gradymo on Fri Oct 22, 2021 6:42 pm

This worked for me. I hooked up an ultimate GPS, which speaks serial, to the stemma-Qt port like so:

Code: Select all | TOGGLE FULL SIZE
uart = busio.UART(board.SCL, board.SDA, baudrate=9600, timeout=10)

Gradymo
 
Posts: 1
Joined: Fri Oct 22, 2021 11:49 am

Re: Magtag board does not have RX, TX, or UART

by kevinjwalters on Tue Oct 26, 2021 4:36 pm

One thing worth mentioning is a serial connection with an Adafruit MagTag is going to output "TTL" UART at 3.3/0V (not 5/0V) which is a rather different thing to RS232 ~ -12V/+12V. There's a discussion of this on: StackExchange: Electrical Engineering: Difference between UART and RS-232?.

kevinjwalters
 
Posts: 982
Joined: Sun Oct 01, 2017 3:15 pm

Re: Magtag board does not have RX, TX, or UART

by dastels on Tue Oct 26, 2021 4:53 pm

Traditionally, TTL meant 5v. So an Arduino UNO UART is TTL serial. Magtag UART is 3.3v. A more general term would be "logic level" serial vs. RS-232 serial. You can use a MAX232 chip from Maxim to do the conversion between 5v serial and RS232. Maxim also has version of the chip that works with 3.3v.

dastels
 
Posts: 7893
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.


cron