I just plugged in this board and to test it out. My intent is to use it in a RS422 format, but will need to understand what changes I need to make later.

I've opened up the arduino sketch and uploaded it to my AST-CAN485 from Sparkfun. I modified Digilent's the code so it uses the alternative software serial library. Other than that, it's all the same.

When I run the code and open up the serial monitor, the loopback is actually happening in the hardware. I can unplug the looped wires and still get a message back. So the echo example code seems to not work properly.


Any aid in understanding this would be great.


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @[email protected],

It looks like the demo material written years ago by interns is coming back to bite us. @Ana-Maria Balas is correct in that the buffer is not getting cleared; in this case it is the tempString variable.

I have attached a fixed version that properly clears the variables (and uses different variables for Serial and Serial1 to make things easier to understand/debug), though I do not have a Pmod RS485 with me to test this.

Let us know if you have any questions.




Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now