2

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.

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

10 Rep
  • 2,217
  • 7
  • 19
  • 33
Michael Eakins
  • 4,149
  • 3
  • 35
  • 54
  • 3
    You might also try asking here: http://electronics.stackexchange.com/ It is more HW centric than this question, but they might be able to help. – BCS Nov 06 '10 at 20:56
  • RS485 is not a format but a hardware line standard. You can choose any format that fits, i.e. some asynchronouse 8N1 format. Use the UART of your device to send and receive data. See chapter 26 of http://www.atmel.com/dyn/resources/prod_documents/doc32058.pdf – harper Nov 06 '10 at 22:35

3 Answers3

2

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.

starblue
  • 55,348
  • 14
  • 97
  • 151
1

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.

lothar
  • 19,853
  • 5
  • 45
  • 59
  • The question stated that he wants to talk from the Microcontroller to an RS485 device. There is no PC involved, therefore no USB to RS485 can be used. – Jimmie Clark Nov 03 '10 at 13:01
  • To create and debug the communication (probably with an emulator) a host PC RS 485 interface is very useful. The data to use must be specified in the data sheet, though. – lothar Nov 03 '10 at 13:24
  • Yes but not required or requested. – Jimmie Clark Nov 04 '10 at 15:12
1

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!

Community
  • 1
  • 1
Michael Eakins
  • 4,149
  • 3
  • 35
  • 54
  • I didn't know about electronics.stackexchange.com before, too and it's great that you got good answers there. I'll check it out, so that I can suggest it for similar questions in the future. – lothar Nov 08 '10 at 14:25