[En-Nut-Discussion] sam7x + rs485

Szemző András saam at kometa.hu
Sat Oct 27 11:36:15 CEST 2007


In this case maybe the best is to controll the HW handshake by software,
like on avr.
I'll try to add it to the AHDLC driver, is there anybody with better
knowledge who would like to help? :)

Regards,
Andras 

-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Alain M.
Sent: Friday, October 26, 2007 8:55 PM
To: Ethernut User Chat (English)
Subject: Re: [En-Nut-Discussion] sam7x + rs485

The problem with hardware handshake may be that it is buggy. From Errata:
----------
39.3.11.1 USART: CTS in Hardware Handshaking When Hardware Handshaking is
used and if CTS goes low near the end of the starting bit, a character can
be lost.
Problem Fix/Workaround
CTS must not go low during a time slot occurring between 2 Master Clock
periods before the starting bit and 16 Master Clock periods after the rising
edge of the starting bit.
----------
Revision A
39.4.10.1 USART: CTS in Hardware Handshaking more of the same
----------
And two more UART bugs, all could produce data corruption :( :(

Alain

Szemző András escreveu:
> 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
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 
> 
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list