[En-Nut-Discussion] DMA-style read functionality for USARTAVR
Matthias Ringwald
mringwal at inf.ethz.ch
Tue Jan 11 15:06:24 CET 2005
hi dusan
I'm responding to the second part of your email. the first one I don't
understand.
On 11.01.2005, at 14:33, Dusan Ferbas wrote:
> Hi Matthias,
>
> here it is: http://www.arp-sk.org/files/winarp_sk-0.9.2.zip
>
> I am sending this link to you not to conference to save some bandwidth
> of existing networks :-)
> ...
> Best regards
>
> Matthias
>
> ===
>
> you contributed blocking read for USART in April 2004. I noticed that
> for unix_devs.c module UART_SETBLOCKREAD, USART_MF_BLOCKREAD was added
> to Nut/OS. How is it with your modification for ATmega128 ?
>
> Do you know how much time it saves e.g. for 10 byte packets, 9600Bd ?
> (Event is not posted and thread is not waked up for nearly every
> byte).
>
> Dusan
I still have the working version for atmega128 lying around. I never
really used it until we recently did run into
uart trouble if we're using bluetooth with 115200 baud (on an 7.328 Mhz
processor with external RAM).
we are loosing bytes, so I tried the blocking read operation which does
save processing time, but unfortunately not
where its needed (still loosing bytes).
Asking for time saving is tough. the point is, if there is not much
other load, then every byte might trigger a
thread switch but, as there is not much load, it is not so important.
if there is high load, the thread switch
might occur less often and later.
we still couldn't fix our basic problem but are lacking real testing.
In my opinion the NutEventPostAsync should be implemented
differently and not at all do anything with the thread queues but just
set a flag (or a linked list) similar to the re-use of
timers in the avr rtc timer interrupt. but, still no hard facts on that.
regards,
matthias
>
> Date: Thu, 15 Apr 2004 18:36:20 +0200
> From: Matthias Ringwald <mringwal at inf.ethz.ch>
> Subject: [En-Nut-Discussion] Follow-Up: DMA-style read functionality
> for USARTAVR
>
> Hi
>
> I didn't get much feedback to my posting, so I there's not much
> interest.
> Nevertheless, I did implement a block read mechanism and it works as
> expected.
> A read (uart, buffer, 1000) will only return if a timeout occured or
> the 1000 bytes are read.
>
> To use this feature, you have to issue the call
> _ioctl(_fileno(uart), UART_SETBLOCKREAD, &block_read)
> whereas block_read = 1 enables block read mode and block_read = 0
> disables it.
>
> you can download the changed file for now here:
> http://www.inf.ethz.ch/~mringwal/downloads/usart_block_read-2004-04
> -15.zip
>
> those are otherwise up-to-date with the cvs as of 15.04.2004.
>
> I guess depending on interest, this would either make it into the
> main
> cvs or
> will go to the ethernut projects page.
>
> Have fun,
> Matthias
More information about the En-Nut-Discussion
mailing list