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  [ 1 post ] 
Author Message
 Post subject: RS485 - initialise to keep RTS silent
PostPosted: Thu Mar 17, 2011 11:40 am 
Offline

Joined: Thu Mar 17, 2011 11:19 am
Posts: 1
Hi,

I'm writing my own serial RS485 driver on an at91sam9260 running Linux 2.6.32.

Everything works fine except, that I'm not able to keep RTS low after initialisation of the UART. As soon as I mux the RTS-Pin to its UART-RTS role -> it goes high.

[code]
/* Disable interrupts */
UART_PUT(vbaseaddr, ATMEL_US_IDR, ATMEL_US_TXEMPTY );

/* Resetting serial mode to RS232 (0x0) */
mode = UART_GET(vbaseaddr,ATMEL_US_MR);
mode &= ~ATMEL_US_USMODE;
mode |= ATMEL_US_USMODE_RS485;

UART_PUT(vbaseaddr, ATMEL_US_MR, mode);

/* force rts to be low */
/* write control flags */
control = 0;
control |= ATMEL_US_RSTTX; /* Reset TX (transceiver) */
control |= ATMEL_US_RTSEN; /* Reset RX (receiver) */
UART_PUT(vbaseaddr, ATMEL_US_CR, control);

control = ATMEL_US_TXEN; /* Enable TX (transceiver) */
UART_PUT(vbaseaddr, ATMEL_US_CR, control);
[/code]

What's wrong with that? I thought once I set the RS485 mode, the RTS will be controlled by the UART and only driven, if there is data to transmit.

thanks for your support


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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:  
cron