Magtag board does not have RX, TX, or UART

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
planxty312
 
Posts: 2
Joined: Mon Jul 25, 2016 3:28 pm

Magtag board does not have RX, TX, or UART

Post by planxty312 »

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?

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

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

Post by dastels »

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

Dave

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

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

Post by planxty312 »

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

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

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

Post by dastels »

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

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

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

Post by tannewt »

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. :-)

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

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

Post by Gradymo »

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

Code: Select all

uart = busio.UART(board.SCL, board.SDA, baudrate=9600, timeout=10)

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

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

Post by kevinjwalters »

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?.

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

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

Post by dastels »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”