Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: RTS control in RS-485 mode for SAM9G45
PostPosted: Mon Nov 14, 2011 9:10 pm 
Offline

Joined: Fri Oct 28, 2011 7:25 pm
Posts: 29
I am using the SAM9G45 with Linux kernel 3.0.4. For our device we will be using all four USARTs in RS-485 mode. I was planning on setting up each port to have a ½ character delay (5 bits, or about 45 us at a baud rate of 115,200) on releasing RTS at the end of each message, and I was planning on doing this by setting the delay_rts_after_send value in the serial_rs485 structure. However, after digging through the atmel_serial.c source it looks like this doesn’t do what I thought. delay_rts_after_send sets the value of the Transmitter Timeguard register (US_TTGR), which sets a delay after *each character* that is transmitted. This is not what I had in mind. From looking around, I don’t see a straight forward way to set such a small delay without modifying the driver. Has anyone else done this before? Or, have you seen the USARTs control of RTS is tight enough that no extra control has been necessary in your application?


Top
 Profile  
 
 Post subject: Re: RTS control in RS-485 mode for SAM9G45
PostPosted: Wed Nov 23, 2011 10:25 pm 
Offline

Joined: Fri Oct 28, 2011 7:25 pm
Posts: 29
Just wanted to give an update of what I did for my situation. I hijacked the 'delay_rts_before_send' variable in the serial_rs485 struct to set the Receive Time-Out (RTOR register). In my situation with DMA on, I will never fill the DMA buffer for a transfer, so the Receive Time-Out will always interrupt after a message completes. Also, my device is the master, so this is enough for me to ensure that my device will let receive complete before trying to transmit. I think it's enough of a hack that it's not applicable to the mainline driver, but it works for my situation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: