rs232 to rs485

This forum is used for discussing hardware, software, and technical details of the AVRcam embedded system.

rs232 to rs485

Postby tinybot » Mon Aug 21, 2006 12:55 pm

I am looking to interface the avrcam with the lego mindstorm nxt. The lego's 4th port is capable of rs485 communication.

Can anyone suggest the best way to communicate from an rs232 port to an rs485 port?
tinybot
 
Posts: 2
Joined: Mon Aug 21, 2006 12:53 pm

hmm

Postby tinybot » Tue Aug 29, 2006 4:40 pm

it looks like the solution is to go from the ttl port straight over to the rs485, instead of from rs232 to rs485. This causes a problem though, since rs485 uses two wires to communicate one direction of data flow, it means that instead of being full duplex ill have to run it at half duplex. This would be fine if i could increase the ttl clock on the avrcam side. Does anyone know if this is possible?

Thanks.
tinybot
 
Posts: 2
Joined: Mon Aug 21, 2006 12:53 pm

Postby davedave » Thu Nov 16, 2006 7:06 am

To change the ttl clock you'll need to change the prescaler in the init function. I don't have the code handy at the moment, but the mega8 documentation from atmel has all the details. Then all you have to do is work out what the prescaler needs to be with a 17Mhz clock.
Bear in mind that the clock is changed when dumping a frame so you'll have to change that too.
davedave
 
Posts: 15
Joined: Wed May 10, 2006 11:02 pm
Location: Canberra Australia


Return to AVRcam Embedded System

Who is online

Users browsing this forum: No registered users and 17 guests

cron