On Sat, Dec 20, 2008 at 6:25 PM, Sid Price
I am working on a design using the one UART0 on a mega164p and I am
an issue with initialization of the UART. I notice that when I enable the TX
a byte of all zeros is transmitted. I even see this if I assert the TX
enable bit with the debugger. Is this normal? Is there a way to avoid it?
>> I recall
running into something similar.
>> I don't have
data sheets here in front of me to give you specific bit names.
>> In some of the
older parts the Tx Empty bit is set by default and the bit
>> is Read
Only. So as soon as you enable the UART IRQ a byte is sent.
>> On the
newer parts the bit is Read/Write so you can manipulate it
>> to prevent
>>However I would
not go with that solution. You need to expect
>>that there will
be bouges values on your serial line at power up
down. This could be completely outside of the control of the CPU,
>>for example the
power supply slew rate to your RS232 driver. There could
>>also be random
bytes at anytime due to someone walking by with a Cell Phone
>> or ESD events.
you Bob, I absolutely agree that the communications protocol needs to cope with
malformed messages and random data events. My interest in posting this was
two-fold, firstly was the behavior of the microcontroller “normal”
and secondly if it was not then was it a symptom of some other issue with my
appears that data emitted is well formed and not a noise event, I find that a
rather odd “design feature”.
for the thoughts,