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?
Magtag board does not have RX, TX, or UART
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15831
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Magtag board does not have RX, TX, or UART
The Tx/Rx connections are for debugging the ESP32-S2. It is not exposed in the board module.
Dave
Dave
- planxty312
- Posts: 2
- Joined: Mon Jul 25, 2016 3:28 pm
Re: Magtag board does not have RX, TX, or UART
darn. Any good way to connect to a RS232 device?
- dastels
- Posts: 15831
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Magtag board does not have RX, TX, or UART
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
Dave
- tannewt
- Posts: 3315
- Joined: Thu Oct 06, 2016 8:48 pm
Re: Magtag board does not have RX, TX, or UART
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. :-)
`board` is only showing you names that are present on the physical board. You don't have to stick to those uses. :-)
- Gradymo
- Posts: 1
- Joined: Fri Oct 22, 2021 11:49 am
Re: Magtag board does not have RX, TX, or UART
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)
- kevinjwalters
- Posts: 1026
- Joined: Sun Oct 01, 2017 3:15 pm
Re: Magtag board does not have RX, TX, or UART
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?.
- dastels
- Posts: 15831
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Magtag board does not have RX, TX, or UART
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.
Please be positive and constructive with your questions and comments.