[En-Nut-Discussion] Time needed to get packet from RTLonATmega128
Bengt Florin
bengt at florin.se
Tue Jan 11 16:02:14 CET 2005
Dusan,
Yes, sorry, I merely meant NIC interrupt, but wrote "your".
Maybe I should have get some sleep before answering?
Right now I don't have any Ethernut HW on my desk so measuring interrupt
time is not feasible. But looking into the code tells that normal
NIC interrupt handling should be fairly short.
However when NIC overflows this may take some time to clean up.
The overflow handling is not done with global interrupts off, so
your UART interrupts should be handled anyway.
Enabling nested interrupts is done by just enabling interrupts inside
a interrupt function, i.e. calling sei().
I can't tell if Nut/OS behaves well, but all critical sections are still
protected.
But remember I said, things may easily and quickly go bad when doing this.
Extensive reading of the code is the cure (of all evil!).
/bengt
-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de]On Behalf Of Dusan Ferbas
Sent: den 11 januari 2005 14:56
To: en-nut-discussion at egnite.de
Subject: Re: RE: [En-Nut-Discussion] Time needed to get packet from
RTLonATmega128
Hi Bengt,
my idea is not to reduce number of NOPs. But exchange them with a PE7 test.
We tested 3.5 nicrtl driver - device hangs and due to a watchdog system
restarts. It yields very often (in absolute time units). With our tick
based yielding we still are not able to respond during packet storms but we
remain alive and effortlessly continue to respond.
I am not talking about "my" interrupt. I am talking about
dev/nicrtl.c:NicInterrupt() routine. There is not so much code in it. How
long you think it can take ?
IOCHRDY can save only time in NicGetPacket(). But this can help in ARP
packet recognition.
How can I enable nested interrupt ? Nut/OS no longer supports it.
Thanks
>From: "Bengt Florin" <bengt at florin.se>
>
>Dusan,
>
>I'm sorry to say I never succeeded finding a clever solution to use
IOCHRDY.
>The 16 NOP's were inserted by pure experimenting.
>Hook a scope or logic analyzer to IOCHRDY pin.
>Then reduce the amount of NOP's until IOCHRDY is asserted. Then add one.
>The 16 NOP's were tested for running at 16MHz so if you are running at
lower
>speeds you could cut some off.
>
>However not much speed is gained in doing this. If your current interrupt
>takes
>50us or 735 cycles at 14.7MHz a cut of 8-10 cycles will not do the job.
>
>If you dare to, you could try enabling nested interrupts in the nic
>interrupt.
>Then the uart interrupt may get a chance to run.
>Things may easily and quickly go bad when doing this, but careful coding
>normally
>sorts it out.
>
>God luck,
>bengt
Dusan
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
More information about the En-Nut-Discussion
mailing list