Does anyone have any sample code or suggestions to help me to interface my 100 pin uc3a1512to a device via RS-485?

StackOverflow https://stackoverflow.com/questions/4033256

  •  26-09-2019
  •  | 
  •  

Question

I am attempting to connect and control a device which only accepts RS-485 input. I wish to communicate to this device via my existing UC3A1512. Does anyone have any existing source code or examples that may help me to create this interface?

I need a method of outputting data via RS-485 format.

I do not need to establish round trip communication, I simply need the ability to send commands to the device.

I have looked at Atmel's website and also on AVRFreaks and I see nothing of value to my project.

Any help is welcomed and appreciated!

Please review page 10 of this Adobe PDF from Lin Engineering to understand more about the device I need to communicate with.

Was it helpful?

Solution 3

So far the most relevant answers have come from my question posted on electronics.stackexchange.com

Had I known this existed prior to posting my question on Stack I would have limited my question to Electronics & Robotics ONLY. As I had already asked the question and receive answers, I have opted to keep both questions open.

Thanks for your responses!

OTHER TIPS

RS-485 is just the electrical specification for a differential serial bus. There are many different data formats that can be used. To connect RS-485 to a microcontroller you need some hardware driver IC, there are plenty to choose from (a quick search at Farnell found 39).

The low level serial format may be 9600 8N1, if page 13 of the driver manual is any indication.

The higher level format (how to send commands to the motor) is not specified in the document, and I didn't find it elsewhere.

In the UC3A1512 you need to configure one of the USARTs to RS-485 operation, see Chapter 26 of the data sheet. Once the interface is configured the operation may be similar to RS-232, if a simple command format is used.

RS485 is a simple symmetrical serial bus. The data that you need to send over that serial link must be specified in the reference data sheet for your UC3A1512 device.

To create and debug your application (probably on an emulator it is useful that you can send it from your host PC before you try it from the embedded controller. This is easy, as RS485 allows multiple connections in contrast to RS232 which is point to point.

RS485 can be converted to regular serial RS232. If your computer has no RS232 port anymore (most don't) you can get an USB to RS232 converter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top