Atom Lite - Serial Port access
-
Hi gang. A bit stumped here. I have a M5 Atom Lite. I've looked at the PICO datasheet and can see that it supports 3 UART connections. Understanding that this board only has a few pins broken out... However, I've seen the GROVE documentation suggest that 2 of those pins can also be RX and TX (normally SDA, SCL)? Has anyone been able to find a way to get access to RX0/TX0 or Serial1 (RX1, TX1)? Any luck re-mapping the breakout ports in code for serial use? I've tried to use some examples found at Google and can't get anything working.
-
You can get serial over usb, or am I missing something, you want to use another device to receive serial communication from the atom other than a pc
-
Yes. To clarify, I've got a Nextion HMI display that uses UART to communicate. On an typical ESP(8266/32) I'm using hardware Serial, but this unit does not have any hardware serial ports broken out, so looking for other ways. Also tried Software Serial options and not having much luck...
-
on Arduino, You are try something like this??:
Serial1.begin(115200, SERIAL_8N1, 32, 26);pin32 and pin26 on grove connector as RX and TX
I haven't tested it...
-
@reaper7 said in Atom Lite - Serial Port access:
Serial1.begin(115200, SERIAL_8N1, 32, 26);
Thanks. Tried that and causes a crash. I thinned out my code to bare min and this can replicate the crash (sorry not sure if this site has <code> tags. Crash details are further down, but it looks like an issue with the Nextion library. Challenge is this library works fine on other ESP32s. Only difference here is calling out Seria1 with the defined ports. Usually I have ESP32 boards where I can connect direct to UART1 pins, so no need to do pin mapping.
#include <Nextion.h>
//PRODUCTION: Use this when using the physical MCU + Nextion TFT LCD Hardware or MCU + Serial Window.
#define nextion Serial1
boolean debug = true; //Be sure to set to false when done debugging!!Nextion myNextion(nextion, 115200); //create a Nextion object named myNextion using the nextion serial port @ 115200bps
void setup()
{Serial.begin(115200); //Standard Serial comms
Serial1.begin(115200, SERIAL_8N1, 26, 32); //Comms to Nextionif (debug) {Serial.println(F("Connected. Processing loop..."));}
}// END SETUP
void loop(){}
000000
A10 : 0x1dd4848c A11 : 0x0000001c A12 : 0x3ffba49c A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000001c EXCCAUSE: 0x0000001c
EXCVADDR: 0x1dd4848c LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000Backtrace: 0x40080f75:0x3ffb1ec0 0x400d1986:0x3ffb1ee0 0x400d1d45:0x3ffb1f00 0x400d0e22:0x3ffb1f40 0x400d0bb9:0x3ffb1f80 0x400d13ab:0x3ffb1fb0 0x40088215:0x3ffb1fd0
Rebooting...
ets Jun 8 2016 00:22:57rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x40080f75 PS : 0x00060530 A0 : 0x800d1989 A1 : 0x3ffb1ec0
A2 : 0x00000020 A3 : 0x00000002 A4 : 0x00000000 A5 : 0x00000001
A6 : 0x00060520 A7 : 0x00000000 A8 : 0x3f405808 A9 : 0x00000000
A10 : 0x1dd4848c A11 : 0x0000001c A12 : 0x3ffba49c A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000001c EXCCAUSE: 0x0000001c
EXCVADDR: 0x1dd4848c LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000