Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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 date 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!

I originally posted this question on StackOverflow before I knew of electronics.stackexchange.com

share|improve this question

4 Answers 4

up vote 5 down vote accepted

You need to put a RS-485 transceiver on your USART. Maybe a TI SN65HVD11, looks like it works with 3.3V IO.

As you you need to transmit, any sample that writes out the USART in asynchronous mode will do.

As you don't mention having to share a RS-485 bus, tie the TX enable on on the transceiver.

That way RS-232 example code will work for you.

share|improve this answer
    
This simple logic chip looks like it will do the trick. I appreciate your solution. I will try this and I will let you know how it works out. I also like the size as size truly matters in micro-controller development. –  Michael Eakins Nov 3 '10 at 13:09
    
This is a nice chip, small footprint. I like that its simple in that its just a logic and amplifier together. Good answer. –  Jimmie Clark Nov 3 '10 at 13:10
    
And for the software side, look in the excellent AVR32 Software Framework available from Atmel which has drivers and examples for the USARTs. –  Austin Phillips Jan 17 '11 at 11:42

Are you asking about the RS-485 physical connection or the data protocol that you have to use? From the phrasing of the question I will assume that it is the former.

RS-485 specifies the signal levels and number of wires used to send the data together with the maximum transmission distances for the various data rates used, in much the same way as RS-232. All that you need to do, from a physical point of view, is to replace any RS-232 driver with an RS-485 transceiver. These are available from many suppliers (Maxim, TI, ON-semi...) As you say you only have to transmit to the remote device, you can just leave the receive side open and use 3 wires to connect to the remote device (TxA, TxB and Gnd).

The commands sent to the remote device are defined in its protocol spec and will be sent in exactly the same way as on any other async serial interface.

share|improve this answer

3 led on/off by one swoft switch to 8051 in asm51 code.

share|improve this answer
    
I don't understand your answer. Could you clarify? –  tyblu Jan 16 '11 at 19:23

Try the MAX485 or MAX483 from Maxim IC: http://www.maxim-ic.com/datasheet/index.mvp/id/1111 Very cheap and easy to use. Plus they can send data up to 4000 feet.

Here's someone's tutorial on using them with Arduino: http://pskillenrules.blogspot.com/2009/08/arduino-and-rs485.html

share|improve this answer
    
I've written a blog post about these chips: tmatthew.net/blog/long_distance_serial –  tybro0103 Jun 27 '11 at 19:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.