DTR reset.

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've built a serial port connected AVR based device that supports configurable baudrates.
Now, if some software screws up and mess up the baudrate to some unknown rate, there's pretty much no way of contacting the AVR device again w/o resetting the power.
Another thing is that sometimes I've noticed that the device doesn't reset properly during powerup.. Guess the +5V line from the PC powersupply is noisy at powerup... Right now my AVR reset line is just tied to VCC with a resistor, no fancy reset circuit.

Now, I've done some minor research and noticed that modems seems to support reset by pulling the DTR signal.
It looks to me like replacing the pullup resistor with a 5V zenerdiode between the AVR reset pin and VCC, and adding a resistor between the AVR reset pin and the DTR line should solve my problems.
I do have a MAX202 (same thing as max232) on board with one spare reciever line, but since the max202 inverts the signal from active low to active high I can't use it w/o adding a extra inverter.

Does this sound like the ideal solution to the problem, or are there any better alternatives? Guess i just want comments and suggestions for even better alternatives.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

10k (metal film) + 100n multilayer (those little blue caps), only an R for reset doesn't work fine I think. (t=RC)

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I know I did a small mistake there... only a R works reliable as long as the power is sufficiently clean during powerup... And that never happens in real life.. :)
A cap would definitely solve the power up instabilities I've had a few times.

But still, I probably need a serial port controlled reset signal anyway, in case some software screws up the baudrate..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would pull the RXD low for a certain period of time to reset the baud rate of the AVR. You can read this input and measure the time it is low. If the other terminal is not capable of switching its TXD-line permanently, you can adjust a very slow baud rate and transfer 0x01 or 0x80. This will give you a "low-time" which normally doesn't appear.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good idea..
How about just checking the frame error bit in the AVR UART?
If a framing error occur, something is abviously wrong, why not reset the baudrate to 9600bps?
Of course, if a frame error for some reason occurs during normal 38400bps operation, this would crash the entire thing... But frame errors shouldn't occur during normal operation, right?

The PC side (yes, the other side is a PC) can easily generate a frame error by transmitting at a very low baudrate, as you just mentioned.

This would be a very good solution, provided that a cap+resistor reset circuit can reliably solve the power up issue.