KC868-A4 ,RS232 can not communicate with Max232 - 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-A4 (https://www.kincony.com/forum/forumdisplay.php?fid=21) +--- Thread: KC868-A4 ,RS232 can not communicate with Max232 (/showthread.php?tid=1130) |
KC868-A4 ,RS232 can not communicate with Max232 - Nantawit - 11-15-2021 Could you help me about rs232 port for your product that desighed RS232 female on board so I want to connect with modbus 485 devices that is ,must convert rs232 to TTL (use max232) nad then use max 485 so I try to connect but can not show the data Rx ,TX . firstly ,testing the rs232 alone by pin 2 (tx) connect to LED series with resistor 1 k the result was LED blinking and also verified by connecting pin RX and TX together then checking the serial monitor so its can shows the data and then conneecting rs232 with Max 232 after that the result can not show as the last . RE: KC868-A4 ,RS232 can not communicate with Max232 - admin - 11-15-2021 you can just use RS232 to RS485 adapter. our RS232 use pin2,3,5 just TXD,RXD,GND. you just need connect these 3 lines is ok. why you need convert to TTL level? you just chose RS232 <-> RS485 adapter is ok. RE: KC868-A4 ,RS232 can not communicate with Max232 - Nantawit - 11-15-2021 I also used that converter (RS232 to 485 ) the results still did not show the data then I back to test step by stey from RS232 . RE: KC868-A4 ,RS232 can not communicate with Max232 - admin - 11-15-2021 if you want to test RS232, you just use a USB-RS232 cable connect board with PC, you can send and receive command. RE: KC868-A4 ,RS232 can not communicate with Max232 - Nantawit - 11-15-2021 (11-15-2021, 10:57 AM)admin Wrote: if you want to test RS232, you just use a USB-RS232 cable connect board with PC, you can send and receive command. THank you ,I think as the same as I done by the program to test rs232 port is working or not : #define RXD2 16 #define TXD2 17 void setup() { // Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin); Serial.begin(115200); //Serial1.begin(9600, SERIAL_8N1, RXD2, TXD2); Serial2.begin(300, SERIAL_8N1, RXD2, TXD2); Serial.println("Serial Txd is on pin: "+String(TX)); Serial.println("Serial Rxd is on pin: "+String(RX)); } /*void loop() { //Choose Serial1 or Serial2 as required if (Serial.available()) Serial2.write(Serial.read()); while (Serial2.available()) Serial.write(Serial2.read()); delay(500); } */ void loop() { Serial2.print("hello"); Serial2.write("hellowrite"); Serial.println(String(Serial2.readString())); //ทดสอบ port rs232 โดยการส่งค่าwrite(hellowwrite) แล้วอ่านค่ากลับ read //ผ่านทาง serial2 (Tx ขา 2 ,Rx ขา 3 ต่อกัน และ Tx ต่อ LED ,R 1K แสดงติดๆดับๆ Serial.println("Tested"); delay(2000); } RE: KC868-A4 ,RS232 can not communicate with Max232 - admin - 11-16-2021 yes, this is test ok, then if you want to use RS485, just connect a RS232-RS485 adapter is ok. RE: KC868-A4 ,RS232 can not communicate with Max232 - Nantawit - 11-16-2021 (11-16-2021, 12:23 AM)admin Wrote: yes, this is test ok, then if you want to use RS485, just connect a RS232-RS485 adapter is ok. Thank you ,is female adapter ?. I also used as this to read modbus huminity and temerature but the value results were 0 so that I tested backward from rs232 to TTL (Max232) then connecting TX,RX at the MAX232 to verify ,the result did not show as the last so I think the result must be same as at the rs232 port so in this case can use MAX232 or can any ?. RE: KC868-A4 ,RS232 can not communicate with Max232 - admin - 11-16-2021 just find a RS232-RS485 adapter is ok, some seller will have female-male convertor, if not have, you can use 3 line connect with PIN2,3,5 from two interface. RE: KC868-A4 ,RS232 can not communicate with Max232 - Nantawit - 11-16-2021 (11-16-2021, 03:02 AM)admin Wrote: just find a RS232-RS485 adapter is ok, some seller will have female-male convertor, if not have, you can use 3 line connect with PIN2,3,5 from two interface. I have done by RS232 9 Pin Male to Male 1.5 M Conductor connecting to RS232/485 read modbus device but no result and then used Max232 to verify ,still no output display ,in the first time I think may be Max232 has the problem then trying new one Max232 ,still no output display ,the process testing as the same testing at RS232 port the result should be the same , I will ask you this , why ?. I focus for RS485 because it can communicate many devices , long range ,stable that suitable in all applications even if the product A4 has 4-20 mA (ADC) . RE: KC868-A4 ,RS232 can not communicate with Max232 - admin - 11-16-2021 this week when have free time, make a video tour for you. how to use KC868-A4 RS232->RS485 communicate with third device. |