[En-Nut-Discussion] sam7x + rs485

Szemző András saam at kometa.hu
Fri Oct 26 19:34:31 CEST 2007


Hi,

Thanks for your help, meanwhile I found out that I don't enabled the
peripherial control of the RTS, it works now.

For answer to my original post, I was able to add xysslib to ethernut with
minor tweaking, and it seems working, at least 
the client sample code.

For ppp on sam7x. I enabled the ahdlc driver (just avr's skeleton, not
usable yet) and PPP was successfully compiled in.
The next task is to write the uart functions in the ahdlc driver. I found on
sourceforge feature request that maybe
this task is started (hw handshake), my question is how it's going? :)
(Maybe the simplest is using sam7x uart with no PDC and hw handshake,
instead like on avr, controlling it with GPIO.)

Regards,
Andras

-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Mingshu Wang
Sent: Friday, October 26, 2007 5:31 PM
To: en-nut-discussion at egnite.de
Subject: Re: [En-Nut-Discussion] sam7x + rs485 (Szemz? Andr?s)

Hi Andras,

To make RS485 mode work, you have to setup the uart mode register in
rs485 mode and also enable the peripheral control of RTS pin.

Here is the code I use to set UART0 as RS485 mode.
    if(NutRegisterDevice(&DEV_UART0,0,0)==-1)
//open the 485 port
    {
        //#ifdef DBG
        printf("%s Registration failed\n",DEV_UART0_NAME);  
        //#endif
    }
	outr(PIOA_PDR, 0x8);	
    reg_value = inr(USART0_BASE + US_MR_OFF);
    outr(USART0_BASE + US_MR_OFF, reg_value | 0x1);

Mingshu




More information about the En-Nut-Discussion mailing list