"Arduino" autoreset circuit

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

Hey! I've been fighting to get this to work on selfmade PCB for quite some time, now I have to ask for some assistance.

 

So I have basically the same circuit.

Ftdi RTS -> 100nf -> (pullup) avr reset, so it's supposed to be the exact same it was on first arduinos, besides that my ftdi230xs does have 3.3v level signals.

 

Proplem is that autoreset only works if I have scope attached to the reset pin or atmel Ice on the ISP header.

As soon as there is no scope or ice the autoreset stops working.

 

Devices(scope,programmer) connected to the reset pin seems to add something since it enables the reset to happen, but what? Maybe one could point me to right direction.

 

Edit: avr is powered from 5v via computer PSU, ftdi powered from USB, and have internal 3.3v regulator.(I/O are 3.3v level, but 5v tolerant)

Uart communication itself via USB is working all the times, without or with the scope/programmer attached.

 

What I've found out so far(mostly blindly trying different things)

  • Reset pullup needs to be +20k or autoreset never works, I have gone up to 68k with no difference to that.
  • Bootloader(optiboot with modification to work with 328pb uart1) is 100% working, tested up to 1000000 baud with success.
  • 10nf.....100nf cap did not do difference.
This topic has a solution.
Last Edited: Wed. Mar 29, 2017 - 03:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A grounding problem somewhere ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A grounding problem somewhere ?

Ie, if you forget to connect the ground between the ftdi (connected to your computer) and avr (battery powered and thus isolated), it shouldn't work.  But if you connect a scope to the Arduino, there is a ground path that goes through scope probe to scope earth power cord to computer earth to computer ground, and things magically start working...

 

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

I think that you should not pull the reset line low on the FTDI to start the bootloader.  Use the DTR line instead.

 

The Arduino IDE itself cannot create a reset to start the bootloader.  The Arduino IDE gets around this by connecting the DTR line of the USB-serial IC through a series capacitor to the Arduino AVR's reset line.  Then setting the DTR line to LOW pulls the reset pin  LOW for a short interval.   The DTR line gets held low but the AVR reset line on the other side of the capacitor sees only a short pulse.

 

DTR (Data Terminal Ready)  is an output pin from the FTDI USB-serial IC.  It is one of a set of extension lines that were used for serial communications between a computer and a telephone modem in the years before the Internet became widely used.  The modem pulled this line low when it was ready to receive data from the computer.  It isn't used in modern computers, so the Arduino designers use it to restart the bootloader.

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

Attaching a device is possibly pulling your AVR inputs to +5V.  These inputs may be floating or high-impedence which means they are not putting out 3.3 or 5 volts.  The other device can't 'see' 3.3V as a logic high.  It is in an indeterminate range between logic low (max 0.4v) and logic high (slightly higher than +3.3V).  --OR-- When your AVR is asserting LOW one of the lines connected to +3.3 through the pullup resistor, it is only pulling the other line to +1.7V (5.0V - 3.3V).  Again, this is in the indeterminate-logic voltage zone.

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

awneil wrote:

A grounding problem somewhere ?

 

Possible, but I would doubt it. there is ground plane(copper fill gnd) both sides of the PCB under the power connector and usb.

(Minimal components soldered only) 

According to multimeter gnd is found from every it's supposed to be with 0.0 ohm(or well 0.2ohm resist, but it does show that even when I short the cords together)

 

Simonetta wrote:
Use the DTR line instead.

Sadly there is no DTR on this FTDI. Only RTS/CTS, idea of going RTS instead of DTR was to avoid autoreset when opening terminal window, but that was short sight and now I know windows is God knows why pulsing RTS when another USB device is plugged in -.-

 

Simonetta wrote:
  The other device can't 'see' 3.3V as a logic high.

 

If this was the case shouldn't it affect uart in general? IE. No communication was working since since avr couldn't see logic lows, thus all bits appeared as 1.(or I misunderstood what you say)

 

communication via USB is working fine all the times which I forgot to say initially, it's only the autoreset misbehaving if nothing attached to reset, actually this should work as evidence about GND being there as it should?

 

And I also forget to say avr is powered from 5v via the computer PSU, while the ftdi gets it power from USB.

 

Simonetta wrote:
it is only pulling the other line to +1.7V (5.0V - 3.3V).

 

This is actually true, I can inspect it when the scope is attached that reset does not get to 0v, but instead pulses to around 1.75v when avrdude issues the reset via RTS, which seems to be enought atleast when the scope is attached, but how can I know what does the pulse look like without the scope, since it might be that it doesn't get that low which means no reset which is exactly what I'm seeing, but have noway(?) to measure it.

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

 guess that with little bit of luck/accident i found out that, by touching reset and gnd with my fingertip from the isp header, autoreset works??? Do i have magic fingers? :)

 

(Theres the pulse btw, from led blinking i can observe that avr resets to the bootloader)

 

 

Managed to find a solution, reason is still bit uknown to me. Because of finger between reset and gnd did allow autoreset i tested capasitor and then resistor in there, 20k(first one i actually got on my hands) resistor between gnd and reset seems to cure the issue, final circuit would be like this

 

I just dont really understand how the resistor to the ground helps in there, and if there's some proplems that it might bring along

Edit: okay I figured that the resistor to ground does form a voltage divider in there, but with these values it drops voltage quite alot more close to 1v, so the avr should be in reset, but I guess the inline cap aids this situation and holds the line bit higher?
.

 

Last Edited: Tue. Mar 28, 2017 - 07:17 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The green dot point is at @+0.9V if Vcc is +5.   Pulling RTS\ low causes a short pulse to 0V on the reset line.   If the RST\-generating device is running at 3.3V, then the pulse would have gone from 5 to 1.7 if the reset's bias voltage (this is the voltage that the 'pull-up' resister makes the reset pin be when it is not active) was 5V.  But in this case, adding the resistor to ground causes the reset voltage to be about +1V ( (20K/ (68K +20K)) * 5V).  Now the pulse that is coming from the capacitor on the RTS\ line can pull the reset\ line below its threshold voltage for LOW.