General Arduino

operation switch on the Arduino RS485 shield function?

userHead InhaleChicken 2022-12-21 22:46:59 240 Views2 Replies

I know it's so that we can programme the arduino, but what does it actually do? like, does turn cut the connection from the RXD and TXD pins the MAX485ESA chip so that the chip doesn't send whatever is being outputted from the RXD and TXD pins out to the RS485 A and B out? 

 

I want to create a shield that sits on top of the rs485 shield, so should I include another switch to maybe cut the signal from the RS485 from the shield to my shield so that when it uploads nothing goes wonky?

2023-02-21 19:57:49

Hi

The Operation/Programming switch on the shield will change the serial port connection. When it is pulled to Programming mode, MAX485ESA is not connected to the serial port, so you can use it as you want.

 

userHeadPic NeloKin
2022-12-22 02:22:19

I have a problem with my new project. The goal is to control my piezo motor with an Arduino MKR Wifi 1010 via RS485. For that reason I have these components:

Arduino MKR Wifi 1010 Arduino MKR 485 Shield Piezo Motordriver PM401 (Manual: https://piezomotor.com/wp-content/uploads/2019/03/150025_PMD401_Technical_Manual.pdf / https://e-chats.com/omegle / https://echat.date) Piezo LEGS motor

I tested the RS485 by using a USB adapter and the piezomotor software. That worked. But if it comes to code, I don't get any further.

The commands I want to send the piezodriver in ASCII Code is:X127M2;X127J200,0,100;(They worked in the PiezoMotor DriveLab Software)

And I try to do it with this code:

#include <ArduinoRS485.h>

int counter = 0;

void setup() { RS485.begin(115200); Serial.begin(115200); RS485.receive();}

void loop() { RS485.beginTransmission(); if (RS485.available()){   Serial.println(RS485.read()); } else {   Serial.write("Not available"); } Serial.println(RS485.available()); RS485.write('X127M2;'); RS485.write('X127J200,0,100;'); Serial.print("Count No: "); Serial.println(counter); RS485.endTransmission(); counter ++; delay(2000);}In the terminal I got something like that:

888Count No: 15015Count No: 26722Count No: 3How do I know, that the MKR 485 Shield is sending the commands to the Piezodriver and not to nowhere? And the numbers of the terminal seems to me random. They also appear even if nothing is connected to the MKR 485 Shield.So how can I find or set the address of the PM401 in the code?Or do I have to send the commands completly different?They have to be in ASCII send at 115200n81. Does the line RS485.write('X127M2;'); provide that?

I'm a bit lost, also cause I don't have a lot experince in that field, and try&error does not work here. Hope there

userHeadPic GrehnanSondra