![]() |
rs232 problem - Printable Version +- Smart Home Automation Forum (https://www.kincony.com/forum) +-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20) +--- Forum: KC868-A6 (https://www.kincony.com/forum/forumdisplay.php?fid=22) +--- Thread: rs232 problem (/showthread.php?tid=6761) |
RE: rs232 problem - sistemasyusa - 10-01-2024 (09-24-2024, 12:42 PM)admin Wrote: tomorrow when i have free time, write a test code for you. Me puedes apoyar con el codigo de ejemplo del puerto rs232 gracias RE: rs232 problem - admin - 10-01-2024 sorry, these days very busy. after finished it, i will upload to here. RE: rs232 problem - alex989 - 10-01-2024 I have used this code // Imposta i GPIO a cui sono connessi TX e RX del chip SP3232EEN #define RXD2 16 // Pin RX #define TXD2 17 // Pin TX void setup() { // Inizializza la porta seriale principale per il debug a 115200 baud Serial.begin(115200); // Inizializza la seconda porta seriale (Serial2) per comunicare con il chip SP3232EEN Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); // 9600 baud per esempio // Messaggio di avvio Serial.println("Test della comunicazione con il chip SP3232EEN tramite GPIO 16 e 17."); } void loop() { // Controlla se ci sono dati disponibili da Serial2 if (Serial2.available()) { // Legge i dati ricevuti da Serial2 String dataFromSP3232 = Serial2.readString(); // Stampa i dati ricevuti sulla Serial per il monitoraggio Serial.print("Dato ricevuto dal chip SP3232EEN: "); Serial.println(dataFromSP3232); } // Se ci sono dati disponibili sulla Serial (ad esempio dal monitor seriale dell'IDE Arduino) if (Serial.available()) { // Leggi il dato dalla Serial String dataToSend = Serial.readString(); // Invia il dato a Serial2 (SP3232EEN) Serial2.print(dataToSend); Serial.print("Dato inviato al chip SP3232EEN: "); Serial.println(dataToSend); } } Tell me if is right. The pin 16 and 17 works. The serial chip no RE: rs232 problem - sistemasyusa - 10-01-2024 (10-01-2024, 04:40 AM)GRACIAS alex989 Wrote: lo probare y comparto las pruebas, una pregunta si tengo el serial 2 direccionado al rs485 como le hago para usar el tercer puerto serie RE: rs232 problem - admin - 10-02-2024 use this arduino code to test RS232: Code: // Define GPIO pins for RS232 interface short RXD,TXD of RS232 port. You will send TEXT sent by RS232 and received, it will print by USB. here is BIN file can directly to download at 0x0 address. ![]() RE: rs232 problem - alex989 - 10-02-2024 I don't receive any answer RE: rs232 problem - admin - 10-03-2024 can you weld U14 chip: SP3232EEN RE: rs232 problem - alex989 - 10-03-2024 Do you mean remove it? Or what? RE: rs232 problem - admin - 10-03-2024 can you weld it again, if also can't work, maybe need replace a new one. RE: rs232 problem - alex989 - 10-03-2024 I don't understand what I have to do. I have to bridge tx and Rx? |