Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A4 ,RS232 can not communicate with Max232
#1
Tongue 
Big Grin 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 .
          Big Grin 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 .
Reply
#2
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.
Reply
#3
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  .
Reply
#4
if you want to test RS232, you just use a USB-RS232 cable connect board with PC, you can send and receive command.
Reply
#5
(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);

}


Attached Files Image(s)
   
Reply
#6
yes, this is test ok, then if you want to use RS485, just connect a RS232-RS485 adapter is ok.
   
Reply
#7
(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 ?.


Attached Files Image(s)
   
Reply
#8
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.
Reply
#9
(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) .
Reply
#10
this week when have free time, make a video tour for you. how to use KC868-A4 RS232->RS485 communicate with third device.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)