Nextion Basic NX4832T035 - Generic 3.5'' HMI 480*320 Touch Display for Arduino Raspberry Pi

I’ve connected the screen to the RX/TX ports on the boards. That method works for those other boards as I’ve mentioned. Is there something extra that needs to be done?

Hi there,

C’mon man… Really? So if I connect a terminal to the USB serial port of a Xiao and then connect the (second)serial port to another Xiao’s (second serial port) BACK to BACK (2nd Serial to 2nd Serial) then the data will come out of the SECOND Xiao’s USB port.
Works like a charm… What’s the problem?
Do, You have a picture how this apparatus is connected.
Serial port 101 :nerd_face:

HTH
GL :slight_smile: PJ :v:

No need to be so rude just because YOU have no issues. I have had others working on this who are way smarter than me as I have said (one is an assembly developer) and can’t work it out.

They know the basics and how it works and have guided me on troubleshooting, which is why I have listed a small sampling of what we’ve tried. I was hoping someone might politely suggest something we all have possibly overlooked.

Hi there,

SO, I wasn’t being rude forsure,(snowflake) just amazed that it’s a basic thing with serial ports and it does work.
Relax we are all here to help, You may need to start with the basics first.
Which Xiao are you wanting to use? I works on them All BTW.
can you post a picture of how you have it connected?
and the Actual code you have tried? Can you do that? Do you know how to post those items?
The code you posted is NOT what your asking is why it makes little sense?

HTH
GL :slight_smile: PJ :v:

1 Like

Are you sure you’re here to help or patronize? I’m far from a snowflake, but you can assume whatever you’d like. If you don’t understand the tone of how you replied, then maybe that’s a you problem.

I have stated we have been over the basics as you put it. I have also stated which boards I have tried (see above) and a simple piece of code that works on other boards. The only thing I have NOT posted is a picture of the setup which is simply the screen connected to pins 6/7 to each board, powered separately.

Hi there,

Ok, my tone was intentional…
So I don’t see the code? the code to use 2 serial ports?
What you posted will NEVER work , hope that is not too harsh on you. :grin:
You must define the pins to use the second serial port.
I don’t see that anywhere?
Post the picture…too.
Post the actual code you are using if you have some?
You actually think you are the first one to do this?
You’re not, at All… been done many times before don’t worry. :grin:

HTH
GL :slight_smile: PJ :v:

Edit:
Something like this…
YMMV

#include <SoftwareSerial.h>

// Define RX and TX pins for SoftwareSerial
#define SOFT_RX 6
#define SOFT_TX 7

// Create a SoftwareSerial instance
SoftwareSerial softSerial(SOFT_RX, SOFT_TX);

void setup() {
    // Start USB Serial (Serial1) at 115200 baud
    Serial1.begin(115200);
    
    // Start SoftwareSerial at 9600 baud
    softSerial.begin(9600);
}

void loop() {
    // Forward data from USB Serial to SoftwareSerial
    if (Serial1.available()) {
        char data = Serial1.read();
        softSerial.write(data);  // Send to secondary serial
        Serial1.write(data);     // Echo back for debugging
    }

    // Forward data from SoftwareSerial to USB Serial
    if (softSerial.available()) {
        char data = softSerial.read();
        Serial1.write(data);
    }
}

:+1: Enable the echo first time around… should get you squared away.
I’m using the Nrf52840 Xiao BTW :v:

Key Features:

  • Reads data from USB serial (Serial1).
  • Sends data to SoftwareSerial (Pins 6 and 7).
  • Also echoes the received data back to USB for monitoring.

Notes:

  • USB Serial: On the Xiao nRF52840, Serial1 is used for USB communication.
  • SoftwareSerial Limitations: The maximum reliable baud rate is around 9600–38400, so adjust if needed.
  • Pin Assignments:
    • Pin 6: RX
    • Pin 7: TX

This should work for basic serial data forwarding between USB and the secondary serial port. :rocket:

the XIAO has multiple serial interfaces… what PJ is trying to say… in his monkey way… is you need to understand how serial works on the XIAO… you will need to customize your code to adjust to the robust features of the XIAO

1 Like

Thanks for the reply. I do understand that. As I have been saying I have been working with OTHERS who understand this process better than I do and have not been able to solve the issue, even with various sorts of code. For instance, the pass through that used a D1 to send the code through to the screen with the Xiao in the middle repeating it should in theory work. It would show up in the SM, but not the screen. We also tried having the Xiao send the code through to the screen, with the D1 in the middle, same results.

An example of ONE of the code snippets we have tried over weeks. And I want to stress this is ONE example, JUST ONE of the numerous tries we have attempted. Which is why I’m here, to possibly see if there’s anything else that hasn’t been tried yet.

//#define DEBUG_OUTPUT    // Comment out this line to disable all debugging outputs,
                        //  enable it to see debugging messages from the relay-board in Serial.

/*   Multiple Serial test for XIAO ESP32C3 */
HardwareSerial MySerial(0);   //Create a new HardwareSerial class.
HardwareSerial MySerial2(1);

#ifdef DEBUG_OUTPUT
uint32_t lastmillis = 0, timenow = 0;
#endif

void setup() {
  // initialize both serial ports:
  Serial.begin(9600);
  MySerial.begin(9600, SERIAL_8N1, RX, TX); // UART0 on pins 20 & 21
  MySerial2.begin(9600, SERIAL_8N1, 9, 10);  // UART1 on pins 0 & 1

  #ifdef DEBUG_OUTPUT
  Serial.println("ESP multi pass-through Ready.");
  #endif
}

void loop() {
  static uint8_t index = 0, bytes = 0, currbyte = 0;

  // read from port 1, send to port 0:
  bytes = MySerial.available();
  if (bytes) {
    for(index = 0; index < bytes; index++){
      currbyte = MySerial.read();
      Serial.write(currbyte);
      MySerial2.write(currbyte);
    }
    bytes = index = 0;
  }

  // read from port 0, send to port 1:
  bytes = MySerial2.available();
  if (bytes) {
    for(index = 0; index < bytes; index++){
      currbyte = MySerial2.read();
      Serial.write(currbyte);
      MySerial.write(currbyte);
     }
    bytes = index = 0;
  }

#ifdef DEBUG_OUTPUT
  timenow = millis();
  if(timenow > lastmillis + 10000){
    Serial.println("ESP multi relay active.");
    lastmillis = timenow;
  }
#endif

}

Hi there,

So ,sorry I don’t know who “OTHERS” are but that code won’t work…
You can’t do it that way. (do you have compiler output of this code)?
first 3 lines and the last 10 lines b4 it uploads? Verbose output.
:flushed:
I’m sorry , but over “weeks” seriously not trying to be a tool but It doesn’t take that long, Show the picture of it connected and then show the software you are trying to use, nothing you post makes much coherent sense, mixing in what worked and adding the other is just more confusion for you.
Please : POST a picture and Post a code example you can successfully upload to the device. Serial terminal----> USB_C (Xiao)(pin6 & 7)----> Display Device.
START there. Do you know what string to send to the display ?
Does it have it’s own POWER?

HTH
GL :slight_smile: PJ :v:

So on second glance, I guess you will get the message of “ESP multi pass-through Ready.” LOL? if it’s plugged in. :wink: :+1: but no data.

Finally, the #1 question… do you know what it is? @cgwaltney you want to guess what I would ask next? :blush:

Hint it doesn’t compile if you use the wrong one(new)… :+1:

Ok, #1 you obviously didn’t read the code well enough to notice the line:
// #define DEBUG_OUTPUT
…or the #ifdef lines.

I understand catching a bit of attitude if you think someone’s not properly paying attention to the help you’re offering, but if you can’t pay better attention than this to the code you’re helping fix, then I’m afraid the larger problem is not with the OP. :wink:

Hi there,

First time poster Huh… Sus

So #1 if you want to play games and Hijack the thread, It’s NOT about what You think I read or not…
The OP as you put it hasn’t provided enough info to properly get any quality help , What dev environment, Arduino , PLIO. there’s no labels or LIBs defined or included. His approach was a “kitchen Sink” one . I answered what he asked. I don’t see you offer anything in this thread, So really IDC what YOU think.
I didn’t have an attitude other than to help up to now.
GL :slight_smile: PJ :v:

I’m sure you will figure it out, it’s not rocket science. Your first POST imagine that!

Hi there,
Thanx for the translation… Looks like the clown squad showed up.

Gl :slight_smile: PJ :v:

Imagine all you want… you already imagined output that isn’t there, into code that I wrote.

You’re welcome to look me up on github, tek-tips ElectricalEngineering.stackexchange, Arduino.stackexchange, Arduino Discord, Marlin Firmware Discord, etc.

I don’t usually play in “kiddie pool” forums this small, but was asked to come check on what was going on here.
Sure, OP could have given more & better information, and is not blameless here, but your evaluation of my code she posted is far enough wrong to question any C/C++ skills you claim.

Hi there,

So IDC who you are I know why and who told you to come look, Your code doesn’t work YES or NO?
Say what you want about a place you know NOTHING about obviously…
You try to call me out on your lack of knowledge or you wouldn’t be here. SO either take the help or go away.

So you are the “Other” they spoke of no Doubt… LOL :laughing:
stop with the non-sence what’s the question?

Does the code you provided compile or not.
ANSWER the question.

HTH
GL :slight_smile: PJ :v:

What is next , You’re gonna give me a review…LOL :+1:
smash the Like Button… LOL

Back on-topic, OP was able to use the same code on an 8266-based D1 Mini & an orig. esp32 board, but on all of their seed studio boards, while passthrough on any other board reads correctly through USB serial back to the PC, the screen simply does not respond.

OP is using Arduino IDE.

Hi there,

Ok now we are getting somewhere, Not being wise … but forget the 8266 stuff, and even allot of (vanilla)ESP32 stuff , i.e. in case of the C6 true dev kits only. These are different.

You are familiar with a BSP , YES ,NO which are you using on the Xiao?

Go.
:v:

The Board support Package provided by (Espressif) currently it’s 3.1.1 and the code posted DOES NOT compile with it, it can’t.
If you roll back to BSP 3.0.1 it will and should work.

the code compiles & runs on all of their boards, exactly as intended in all ways except the seeed boards still not communicating properly with their UART screen. … Current top suspects on Arduino Discord are voltage-issues (the older boards likely have slightly stronger IO drive) & possibly timing issues with the screen maybe having less tolerance to timing imperfections than the PC or the other boards.

IIRC, she has tried the XIAO C3 board, along with several other seeed studio boards that she listed in her first post or two… iirc the included an S3, a c6 & an rp2040-based board.

Yes, because it’s built for those board support packages
These are different.
You need to specify it when using older LIBRARIES too. it’s the issue ekspresif caused long ago.

:slight_smile: GO

I bet money it has ZERO to do with the Hardware , they are serial port devices, either DTE or DCE. Do they provide the power for the display?

If it works on one it will work on all of the Xiao’s. The C3 has plenty to drive the display. it’s open collector outputs can sink 40ma. or something plenty. I still want to see a picture of this unicorn :slight_smile:

Display is powered from a second, power-only usb adapter that she’s using, so it is quite unlikely that the display would be dragging down the board’s power supply.

Considering that the screen is rated for 5v IO drive, according to the …/nx4024t032 datasheet, my current top suspicion is io-drive strength.

However, as I just opened the package she sent me with the screen & a Xiaoesp32c3 board, I haven’t had a chance to run any tests on it myself yet.

I am planning to test a few different boards talking to the screen with both a logic analyzer & an oscilloscope snooping on the uart lines, if my first couple attempts simply using higher IO drive voltage on the TX line to the screen don’t provide enough answers.

—EDIT—

Wait, which pins are open-collector? If it happens that open-collector pins were getting involved, I see diodes on the RX & TX lines on the screen, so that could explain why other boards & the pc could read the signal, but the screen would literally “see nothing” on open-collector lines without having pullup resistors added somewhere.