ATmega128 Conundrum

Status
Not open for further replies.

Papabravo

Well-Known Member
Can any AVR expert explain why the TXD1(PD3) line of an ATmega128 is allowed to toggle multiple times (high-low-high) for several tens of milliseconds just prior to the rising edge of RESET from a power off condition? This does not happen with a manual (push button) external reset. It shows up on the terminal emulator as a BREAK condition which is a START Bit followed by a long string of zeros with no STOP bit which also generates a framing error.

Says me -- a processor should hold the configuration of its port pins in the default reset condition during RESET, until after RESET rising, when the firmware gets around to configuring the ports. Since the port configuration happens long after RESET rising my choice of pin configuration is not relevant and it is overridden as soon as I configure the serial port. But the damage has already been done.

I observed this multiple times with a logic analyzer, not a scope. We all know logic analyzers can lie an trick you into thinking that something is there when it is not. The best explanation I can come up with is that the pins are floating inputs prior to RESET and I'm consistently observing a predictable pattern of excursions on this line that looks to the terminal emulator like a BREAK condition.
 

Why don't you try a high value pull up or down resistor on that pin and try again. That should tell you if it's coming from the processor or just noise induced.
 
Last edited:
I would have an easier time believing random noise if the timing wasn't so predictable: 8.3 milliseconds high and 9.65 milliseconds low and a rising edge about 200 microseconds after the rising edge of RESET which is consistent with the time it takes to get past the CodeVision initialization and to the instructions which configure the ports. I was going to try the external pullup today but I was looking for an explanation that made sense before throwing a component at the problem. I'll let you know what happens.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…