Uno R3 USB / serial reset

Hi all,

Just to clarify something here... unlike the old Uno and Duemilanove - as the Uno R3 dosen't use an FTDI chip, how does it perform the reset when you open a serial port from a USB host?

Is it the 16U2 pulling the reset pin line when it recognises there's a USB host connected? It must be...

Is it the 16U2 pulling the reset pin line when it recognises there's a USB host connected?

Yes just look at the UNO R3 schematic.

Yes I had a good look at the schematic and saw the connection - I presume this is done then in the bootloader like with the Due, where opening and closing of the port triggers a reset.

Cheers!

In firmware, Yes, but in the 8U2

http://arduino.cc/en/Hacking/DFUProgramming8U2

It's nothing to do with the bootloader. The 8U2 responds to the DTR signal and brings DTR low, which becomes a pulse because of the capacitor (C5 on my schematic) in series.

jtw11: Is it the 16U2 pulling the reset pin line when it recognises there's a USB host connected? It must be...

The 16U2 (that's what it is called on the R3 schematic and my Uno "clone", though my genuine Arduino Uno has an 8U2) is emulating the FTDI chip insofar as it faithfully decodes the USB commands to control a virtual DTR line which it outputs to that A6 line.

Thanks for the replies, one thing I'm unsure about however.

The 8/16U2 is waiting for a certain signal over USB (what is this signal, opening and closing of the serial port?), to pull the main MCUs reset pin low with a virtual DTR pin?. However, how does the host know that the cable has been connected to send out the DTR signal anyway?

As in, I know how avrdude sends a command to the 16U2 which resets the main MCU, but why does it reset when you open a serial monitor?

EDIT - I think i've just answered my own question whilst typing this - I haven't got a board with me at the moment, but I think I've been stupid... the board dosen't reset when you connect a cable, but when you open a serial monitor in the Arduino IDE?

It's nothing to do with the bootloader. The 8U2 responds to the DTR signal and brings DTR low, which becomes a pulse because of the capacitor (C5 on my schematic) in series.

Why the series cap though? Programmers like the ISP Mk2 don't need that cap in series?

Is it possible to remove the cap and the diode in the reset circuit, I don't see why it needs to be there? If a chip like an FTDI230X can just pull the line low, surely a reset occurs?

jtw11: The 8/16U2 is waiting for a certain signal over USB (what is this signal, opening and closing of the serial port?)

That is it.

jtw11: to pull the main MCUs reset pin low with a virtual DTR pin?. However, how does the host know that the cable has been connected to send out the DTR signal anyway?

The host knows when a USB device is connected. That's an essential part of the whole USB protocol. But enabling DTR is part of the port opening/ closing protocol.

jtw11: As in, I know how avrdude sends a command to the 16U2 which resets the main MCU, but why does it reset when you open a serial monitor?

EDIT - I think I've just answered my own question whilst typing this - I haven't got a board with me at the moment, but I think I've been stupid... the board doesn't reset when you connect a cable, but when you open a serial monitor in the Arduino IDE?

Indeed - when you open the port, DTR goes active. The download does that and closes it again, then opening the serial monitor does it also.

jtw11: Why the series cap though? Programmers like the ISP Mk2 don't need that cap in series?

Because they temporarily activate and de-activate the reset according to the ISP protocol precisely as needed, which is not the same protocol as the serial interface to the bootloader.

jtw11: Is it possible to remove the cap and the diode in the reset circuit, I don't see why it needs to be there? If a chip like an FTDI230X can just pull the line low, surely a reset occurs?

You have an attitude problem there. If the system is designed in a certain way, there is a critical reason for it to be designed that way, so it is very unwise to imagine "improvements" before you have thought it all out.

In this case the reason is perfectly straightforward - you do want to reset the chip, but the chip will not operate whilst reset - you have to allow the chip to "un-reset" before it will execute code, including running the bootloader.

I don’t see why it needs to be there?

… This is also a very frequent comment on bypass capacitors too.
And the reason why it needs to be there is beyond your level of electronics education… making it impossible for you to understand.
Consider though that Every Arduino board except the Due uses the same circuit with the same parts values and all the other copies do the same thing as well. So why was it done?.. Mainly it is, as explained Here:

Quote from: jtw11 on Today at 02:10:04 am
Why the series cap though? Programmers like the ISP Mk2 don’t need that cap in series?
Because they temporarily activate and de-activate the reset according to the ISP protocol precisely as needed, which is not the same protocol as the serial interface to the bootloader.

The DTR line isn’t a short pulse, It can’t be because of the RS-232 Protocol that is borrowed for communications, has no easy means to produce a short pulse for properly resetting the AVR. The capacitor shapes the DTR line’s output to something that can properly reset the Arduino controller. There are many here in the forum that know a great deal more about electronics theory and practice than you do… You would do well to simply copy what you see and are told to do, when you ask for advice. Then IF it doesn’t work ask why…
Personally when I run up against a question like that I look for a consensus… I search for similar questions and read the responses before I act… It saves me a lot of potential embarrassment… And I don’t need to wait for someone to answer what I couldn’t be bothered to research on my own.
You have Never seen a comment about how well an Arduino operates when you remove that part just as you have Never seen a comment about the advisability of removing bypass caps from the Arduino boards or about not using bypass capacitors on breadboards because they “Don’t do anything”…
You are right to question but you should consider that others might know more than you do. I’ve been designing embedded controllers
for 20 years and I still make mistakes from time to time… IHTH…

Doc

Hi all...

Is it possible to remove the cap and the diode in the reset circuit, I don't see why it needs to be there? If a chip like an FTDI230X can just pull the line low, surely a reset occurs?

It seems that may have been worded wrong, and that people may be misinterpreting it... it was in no way a dig at the team that designed the boards at all, but rather my way of simply asking how it really works, after all - that's how I learn.

You would do well to simply copy what you see and are told to do, when you ask for advice. Then IF it doesn't work ask why...

Do you really mean that, if it dosen't go wrong - so you don't ask how it works, how to you know to apply it elsewhere if you don't understand how it works?

Anyway, thanks for the replies - they have indeed helped. :)

I think you are deliberately glossing over some "Details"

Do you really mean that, if it dosen't go wrong - so you don't ask how it works, how to you know to apply it elsewhere if you don't understand how it works?

No and really no. There are many different uses for a capacitor. What I was suggesting was that you could research the reset circuit.. It's been covered in a half a dozen posts in the past 3 - 4 month's.. Your responses told me that your 'research' if any was half hearted and that if you really wanted to know what a capacitor was good for, You's have made an effort to find out.

Quote Is it possible to remove the cap and the diode in the reset circuit, [u]I don't see why it needs to be there?[/u] If a chip like an FTDI230X can just pull the line low, surely a reset occurs?

The prime indicator... is the emphasized text from your first post... Quoted above.. How many reset circuits did you look at in this forum, Specifically the product page.. That's the easy place to find PDF documents with schematics for all the Arduino devices currently sold. In asking If you really needed it you showed a great disregard for whaat is in fact a good working circuit... Why do you suppose the parts which do cost money.. are placed on every Arduino board and I use the same values on the Tiny's that I love to work with even though I use an ISP programmer for everything but the Mega series of boards where a reset capacitor isn't used.. I do so because it is a debounced single pulse, saves me from having to clean up the reset least the processor has issues with a noisy reset. Son , I'm an old man in the electronics business since I was old enough to lie about my age, It has been my hobby for 55 years and my livelihood for 50 of those 55 years. I don't mean to be hard on you but I won't sugar coat what I see as lack of real effort on your part. The major one is that you seem to be unwilling to learn basic theory You will in time, If you stick with it. Meanwhile if someone with 2500 posts 'suggests' that something be done it in a certain manner... Do it and then you have a place to stand on If in fact you were told wrong.. If I'm not 95% sure about an answer... I don't respond..

Doc