Does anyone have any sample code or suggestions to help me to interface my 100 pin uc3a1512to a device via RS-485? [closed]
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this questionI 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开发者_如何学Python 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.
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.
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!
精彩评论