-1

well I using topway brand HMI display it is very easy to use with Arduino nano or UNO with rs232 converter. this my converter:

enter image description here

. for example this code is writing "63" number on display. it is working with arduino nano but not with ESP32 do you have any idea? HMI dispaly connected to uart2 pins which is RX2 and TX2 on ESP32 (also I am using 30 pin WROOM-32 model) . Even I have changed 16pin to 17 and 17pin to 16 in "ss.begin..." code still not working.

// TOPWAY Smart LCD interface with esp32

#include <HardwareSerial.h>
HardwareSerial ss(2);

void setup() {

  ss.begin(9600, SERIAL_8N1, 17, 16);
  Serial.begin(9600);
}

void loop() { 

  ss.write(0xaa); // packet head
  ss.write(0x3d); // VP_N16 write command
  ss.write(0x00); // VP_N16 address
  ss.write(0x08);
  ss.write(0x00);
  ss.write(0x02);
  ss.write(0x00); // VP_N16 data high byte
  ss.write(63);    // There should be writen on display "63"
  ss.write(0xcc);       // packet tail
  ss.write(0x33);       // packet tail
  ss.write(0xc3);       // packet tail
  ss.write(0x3c);       // packet tail

  delay(1000);
  Serial.println("ok");

}
mehmet
  • 1,049
  • 11
  • 32
  • 1
    Some more info would be useful - can you post a wire diagram of how you have the ESP and the display connected? My first thought is that Arduino logic is 5v and ESP32 is 3.3V, so check that the ESP and the display are both on the same logic voltage level. If the display communicates using 5V you may have already blown the ESP32 UART2 bus – InBedded16 May 02 '22 at 21:01

1 Answers1

0

I found the problem FFC socket was reversed. I have changed FFC and problem solved

also code should be that

ss.begin(9600, SERIAL_8N1, 16, 17);
mehmet
  • 1,049
  • 11
  • 32