Re: Unusual USART behaviour on AVR AT90CAN128



Rav wrote:
Hi,

I have found some unusual USART behaviour when i was trying to send
characters from USART1 of my AT90CAN128 to the PC terminal. Below is
the code that i have been using for the same. The problem is, what i
am getting on my PC hyperterminal is some garbage. I did some
calculations and found that there was a difference of 128 between the
characters sent and the character received. For example, if i sent 0 i
received 128 and if i sent 10 i received 10+128 = 138.

The same code works well with the USART0. Also, i checked the
waveforms on my oscilloscope by probing on the controller pin(TXD1)
and on the transmit pins of MAX232 (before RS232). The patterns were
almost identical. What i was wondering is that whether my USART was
corrupt internally?

If you have one that works, and one that does not, try running both
at the same time, and compare the outputs with the scope.
You can also try deliberate skew of the Baud divider to values either
side of ideal, to check margins.

-jg

.