Arduino due erase button and power switching

Hello,

Last days I have been investigatin schematics of arduino due board. The purpose of proper understanding of schematics in crucial for me, beacuse I indend to build myself my own board with some minor modifications.

I would really want to learn something from it and not just blindly copy stuff that are already done. In schematics there are two things that I do not understand. First is the working principle of erase button (see: erase_button). I have my own idea how does it work, but would like to clarify the working principle from someone that know exactly what is the purpose of all the elements that are connected to erase button. Second thing is switching of power supply between external power and both usbs (see: usb_switch). Again, would someone please just brifly describe working principle? Here I really do not undertand why is there op amp added?

Thank you in advance.

erase_button.png

FYI, there is a DUE compatible board with a smaller footprint and more broken out pins (essentially the ethernet pins), the DUE CORE:

https://fr.aliexpress.com/item/32681732855.html

The erase pin has to be activated before uploading a new .bin file.

If a power bank (between 7V and 12V) is connected thru the jack, the power needed for the board is taken from this source and no more from the USB (either the Native USB or the other one).

The maximum total current you can draw when the board is powered via external power supply is 800mA for the Due (500mA max if powered with a USB cable).

Hello,
thank you for your answer, but this is not really what I was looking for. I am more interested in working principle of both pieces in schematics. So what the components do and what is their purpose. How is signaling from both processors made etc.

From:

Automatic (Software) Reset

The SAM3X microcontroller differs from AVR microcontrollers because the flash memory needs to be erased before being re-programmed. A manual procedure would involve holding the erase button for a second, pressing the upload button in the IDE, then the reset button.
Because a manual erase-flash procedure is repetitive, this is managed automatically by both USB ports, in two different ways:

Native port
Opening and closing the ''Native' port at the baud rate of 1200bps triggers a “soft erase” procedure: the flash memory is erased and the board is restarted with the bootloader. If, for some reason, the MCU were to crash during this process, it is likely that the soft erase procedure wouldn't work as it's done in software by the MCU itself.
Opening and closing the Native port at a baudrate other than 1200bps will not reset the SAM3X. To use the serial monitor, and see what your sketch does from the beginning, you'll need to add few lines of code inside the setup(). This will ensure the SAM3X will wait for the SerialUSB port to open before executing the sketch:
while (!Serial) ;
[Get Code]
Pressing the Reset button on the Due causes the SAM3X reset as well as the USB communication. This interruption means that if the serial monitor is open, it's necessary to close and reopen it to restart the communication.

Programming port
The Programming port uses a USB-to-serial chip connected to the first UART of the MCU (RX0 and TX0). The USB-to-serial chip has two pins connected to the Reset and Erase pins of the SAM3X. When you open this serial port, the USB-to-Serial activates the Erase and Reset sequence before it begins communicating with the UART of the SAM3X. This procedure is much more reliable and should work even if the main MCU has crashed.

To communicate serially with the Programming port, use the "Serial" object in the IDE. All existing sketches that use serial communication based on the Uno board should work similarly. The Programming port behaves like the Uno's serial port in that the USB-to-Serial chip resets the board each time you open the serial monitor (or any other serial communication).
Pressing the Reset button while communicating over the Programming port doesn't close a USB connection with the computer because only the SAM3X is reset.

Hello,

can you please tell me why is for programming port devider used and for native port comperator? See the attachment.