From: Francesc Borrell Ros (se04729@salleURL.edu)
Date: Tue Jul 23 2002 - 03:10:15 EDT
Hi Greg, and thanks for your quick answer,
I've checked CRTSCTS flags and they are not set. I've disabled
them explicitly but I still have got the same behavior, after 10 ms RTS
is down,
although UART keeps sending chars until it has finished.
I was thinking, may be wrongly, that perhaps the uClinux scheduler
is putting RTS back to the level previous to the UART receiver interrupt
after 10 ms. I really don't know. Holding an interrupt for more than 10 ms
should be dangerous, but I have to take that risk.
Any suggestions will be GREATLY appreciated, i'm very lost. Thanks
to all
Best regards
Francesc
> >----- Original Message -----
> >From: gerg <gerg@snapgear.com>
> >To: <uclinux-dev@uclinux.org>
> >Sent: Monday, July 22, 2002 5:08 PM
> >Subject: Re: [uClinux-dev] Newbie question about mcfserial.c and scheduling
> >
> >
> > > Hi Francesc,
> > >
> > > Can you check if the serial port you are using (UART1) has
> > > the CRTSCTS flags set?
> > >
> > > The ColdFire serial driver uses the auto flow control
> > > modes of the ColdFire UARTs. If you have CRTSCTS set
> > > in the stty flags then perhaps that is interferrsing
> > > with your manual control of RTS.
> > >
> > > Regards
> > > Greg
> > >
> > >
> > >
> > > Francesc Borrell Ros wrote:
> > > > I'm stucked in a problem. I'm using MCF5272 eval board and uclinux
> > > > 2.0.x. I need to react to characters received from UART very quickly
> >and
> > > > send response to them. I'm working with UART1 because UART 0 is now
> >used
> > > > by the console. What I do, I'm sure it's not very "clean" is catch the
> > > > character I receive from mcfserial.c. So I react immediatly to the
> > > > reception of some character. So I put my code on (mcfserial.c) the
> > > > function:
> > > >
> > > > static _INLINE_ void receive_chars(....)
> > > >
> > > > (...)
> > > >
> > > > if (info->line) { /*I'm on UART1*/
> > > > if (ch==EXAMPLE)
> > > > send_message(info);
> > > > }
> > > >
> > > >
> > > > As you can see, I'm trying to react immediatly. In send_message
> >function
> >I
> > > > send a response to the char I'm receiving. Here goes send_message
> >code:
> > > >
> > > > void send_message (struct mcf_serial * info) {
> > > >
> > > > volatile unsigned char * uartp;
> > > > int i;
> > > >
> > > > uartp=(volatile unsigned char *)info->addr;
> > > >
> > > > info->sigs|=TIOCM_RTS; /*i need to raise RTS, as I'm on a 485*/
> > > > uartp[MCFUART_UOP1]=MCFUART_UOP_RTS;
> > > >
> > > > for (i=0;i<number_of_bytes;) {
> > > > if (uartp[MCFUART_USR] & MCFUART_USR_TXREADY)
> > > > uartp[MCFUART_UTB]=message[i++];
> > > > }
> > > >
> > > > while (!(uartp[MCFUART_USR] & MCFUART_USR_TXEMPTY));
> > > >
> > > > /* I wait until I don't have any character in UART */
> > > >
> > > > info->sigs &=(alt+126)TIOCMRTS /*sorry I can't write alt+126*/
> > > > uartp[MCFUART_UOP0]=MCFUART_UOP_RTS;
> > > >
> > > > }
> > > >
> > > > And here arises the main question. If I send chars for less than 10 ms
> >I
> > > > RTS remains up for all the time. But if message longs more than 10 ms
> >it
> > > > falls and i can't understand why. I was thinking it could be some
> > > > scheduling affaire but I'm not sure on that point.
> > > >
> > > > Another thing is that if I call send_message from a kernel timer
> >(using
> > > > add_timer and all those functions) RTS remains up all the necessary
> >ms.
> > > > But I'm reacting too slow to the char and I'm losing the tx.
> > > >
> > > > I think I have concept problems and some of you know what I'm doing
> >bad.
> > > > Does anyone have a clue? I'm VERY stucked.
> > > >
> > > > Thanks to everybody for listening, it's been long, i know it.. :)
> > > >
> > > > Best regards
> > > >
> > > > Cesc
> > > >
> > > > This message resent by the uclinux-dev@uclinux.org list server
> >http://www.uClinux.org/
> > > >
> > >
> > >
> > > --
> > > ------------------------------------------------------------------------
> > > Greg Ungerer -- Chief Software Wizard EMAIL: gerg@snapgear.com
> > > Snapgear Pty Ltd PHONE: +61 7 3279 1822
> > > 825 Stanley St, FAX: +61 7 3279 1820
> > > Woolloongabba, QLD, 4102, Australia WEB: www.snapgear.com
> > >
> > > This message resent by the uclinux-dev@uclinux.org list server
> >http://www.uClinux.org/
> > >
> > >
>
>
>
>
> _________________________________________________________________
> MSN. Más Útil cada Día. http://www.msn.es/intmap/
>
This message resent by the uclinux-dev@uclinux.org list server http://www.uClinux.org/
This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:21:35 EDT