SV: SV: [Icc-avr] Debug using Jtag
John Baraclough
j_baraclough at zetnet.co.uk
Fri Sep 28 03:25:30 PDT 2007
Hi Steven,
Yes, that's a tricky one. The TXC interrupt flag
is set every time a complete character is
transmitted, regardless of whether there is
another character waiting in the buffer. What you
have to do is clear the TXC flag every time you
hit the UDRE interrupt and only enable the TXC
interrupt in the UDRE interrupt handler once
there are no more characters to be sent. As the
RS485 can be switched very quickly, it is also a
good idea to add an extra stop bit to the last transmitted character.
You're welcome to contact me directly if you need any more help.
All the best for now,
John
At 10:26 28/09/2007, you wrote:
>Content-class: urn:content-classes:message
>Content-Type: multipart/alternative;
> boundary="----_=_NextPart_001_01C801B1.B41FA12D"
>
>Hi.
>
>I got a little further, and found out that The
>write seems to be the legal function anyway, I
>just didn't caught it because TXC complete int.
>is getting served before the Tx Buffer is empty.
>
>In 0.003% of the transmissions, as soon as the
>UDRE interrupt is finished filling the last
>bytes in Txbuffer and disables itself, TXC int
>is served before buffer is finished transmitting.
>
>Result is that the last or the 2 last bytes in
>Txbuffer is not transmitted because TXC sets the
>RS485 driver back in Input mode.
>
>So now I just have to find out why!
>It's nothing but fun.
>
>Med venlig hilsen / Best regards / mit freundlichen Grüßen
>
>EC POWER A/S
>
>Steven Lose
>
>Software Ingeniør
>
>Tlf.: +45 87434100
>
>Direkte tlf. +45 58286608
>
>Email: sl at ecpower.dk
>
>www.ecpower.dk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070928/2ed4b2ae/attachment-0001.html
More information about the Icc-avr
mailing list