Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino IDE demo source code for KC868-A6]--#09-RS485_code
#1
Heart 
[Arduino IDE demo source code for KC868-A6]--#09-RS485_code

Code:
void setup(){

  Serial2.begin(9600);
}

void loop() {
Serial2.println("KinCony");

}

.zip   9.RS485.zip (Size: 469.3 KB / Downloads: 429)
Reply
#2
Hello,
I've looked at the A6 schematic and it doesn't seem the DE/RE pins of the RS485 chip ( MAX13487E) are connected to the ESP32.

Does this mean the A6 can only transmit RS485, or am I missing something obvious?

Thanks in advance,

alex
Reply
#3
DE/RE not need to use, MAX13487 will auto control the signal direction. for ESP32 just use RXD,TXD pins is ok.
Reply
#4
(02-16-2023, 12:13 AM)admin Wrote: DE/RE not need to use, MAX13487 will auto control the signal direction. for ESP32 just use RXD,TXD pins is ok.

Hello, thanks for the quick reply!

I had a quick look at the MAX13487 datasheet and assumed it was the same as all the other 485 chips I have used.  Wrong!

Thanks again!

Cheers,

alex
Reply
#5
DE/RE pin just connect together with 10k resistance to Vcc is ok.
Reply
#6
(02-16-2023, 01:31 AM)admin Wrote: DE/RE pin just connect together with 10k resistance to Vcc is ok.

Hmm, I still don't seem to be getting any data out of the RS485 port.  I have it connected to a known working RS458 to USB on my computer, and I'm not seeing any data on my serial terminal (all set for 9600, 8N1).

What board definition should I be using in the Arduino IDE?  I'm currently using 'ESP Dev Module'.  I'm wondering if Serial2 is using the correct TX and RX pins for this board.

Thanks again!
Reply
#7
do you have define the Serial2 pin in your arduino config fle firstly?
   
this is RS485 pin define for KC868-A6
Reply
#8
(02-16-2023, 03:46 AM)admin Wrote: do you have define the Serial2 pin in your arduino config fle firstly?

this is RS485 pin define for KC868-A6

Ah!  Ok.  I made that change and my Modbus read is now working!  Excellent, thankyou very much.

Did I miss some documentation / wiki that tells me to change the RX2 and TX2 pins?  Is there other defines that I should be changing?

Thanks again, I'm really enjoying working with this board.  It's a really nice layout.

Cheers,

alex
Reply
#9
ok, only serial port and IIC bus SDA and SCL pins need set by arduino config file firstly.
Reply
#10
The RS485 code you posted is empty, the compressed file contains an empty .ino
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)