Peterschnecke
New member
Hi everyone,
I've got a problem, trying to get my Teensy 4.1 and my Nextion NX8048K070-011C Display to communicate.
The Nextion Display gets programmed with a GUI. In this GUI is a debug Mode, that virtualizes the Display on the PC. This virtual Display can use the USB-Serial Port of the Teensy to communicate with it.
The virtual software display can communicate flawlessly with the Teensy via the USB serial interface.
But when I try to use the actual hardware display, the serial communication between display and Teensy does not work.
The display is powered by a USB powerbank with 5V.
The TX and RX are connected to port 0 and 1 with Serial1 or to 7 and 8 with Serial2.
If I'm not mistaken both the Display and the Teensy use 3,3V on the Serial Connection
https://nextion.tech/datasheets/nx8048k070/#6
I guess it is some kind of Hardware Problem, as it works when it's virtualized and uses the USB-Serial of the Teensy?
Thanks in advance
I've got a problem, trying to get my Teensy 4.1 and my Nextion NX8048K070-011C Display to communicate.
The Nextion Display gets programmed with a GUI. In this GUI is a debug Mode, that virtualizes the Display on the PC. This virtual Display can use the USB-Serial Port of the Teensy to communicate with it.
The virtual software display can communicate flawlessly with the Teensy via the USB serial interface.
But when I try to use the actual hardware display, the serial communication between display and Teensy does not work.
The display is powered by a USB powerbank with 5V.
The TX and RX are connected to port 0 and 1 with Serial1 or to 7 and 8 with Serial2.
If I'm not mistaken both the Display and the Teensy use 3,3V on the Serial Connection
https://nextion.tech/datasheets/nx8048k070/#6
Code:
String BefehlENDE = String (char(0xff)) + String (char(0xff)) + String (char(0xff)); // This is the "EndOfCommand" so that the Display knows the Command ended
char Befehl; // Variable that takes the Display input
#define HWSERIAL Serial2 // Serial=SoftwareUSB Serial1=Pin0&1 Serial2=7&8
void setup() {
HWSERIAL.begin(9600); // Serial with 9600 Baud
}
void loop() {
while(HWSERIAL.available() < 1){}
Befehl = HWSERIAL.read();
if( Befehl == 'A')
{
HWSERIAL.print("AusgabeTXT.txt=\"AN\""); //If Display sends an 'A' , Send Command to print "AN" in the Textbox
HWSERIAL.print(BefehlENDE);
}
if( Befehl == 'U')
{
HWSERIAL.print("AusgabeTXT.txt=\"AUS\""); //If Display sends an 'U' , Send Command to print "AUS" in the Textbox
HWSERIAL.print(BefehlENDE);
}
if( Befehl == 'N')
{
HWSERIAL.print("ZahlIN.val=0"); //If Display sends an 'N' , Send Command to set the Number variable to 0
HWSERIAL.print(BefehlENDE);
}
if( Befehl == '5')
{
HWSERIAL.print("ZahlIN.val=ZahlIN.val+5"); //If Display sends an 5 , Send Command to add +5 to the Number variable
HWSERIAL.print(BefehlENDE);
}
}
I guess it is some kind of Hardware Problem, as it works when it's virtualized and uses the USB-Serial of the Teensy?
Thanks in advance