need help on understanding uno's design

greetings everyone

i’m designing my own board and faced some problem, so I tried to take reference on uno’s design but get some confusion.

  1. what’s the diode on reset pin for? (attachment 1) I found this on both reset pin, is this a must? I tried to work without, everything seems ok too, so why do I would like to add one?

  2. why there’s a resistor in the crystal? (attachment 2) pretty much the same question as former, why do I need it? If it’s recommended, what’s the best value?

  3. I found resistors on TX and RX pin, (attachment 3) what I understand this as it makes lower priority on the serial connection from 8u2 to the digital pin so that the serial pin will be enabled only when there’s no connection on PD0 and PD1. please correct me if i’m wrong.

  4. based on the former question, will this trick work on SPI pins if I do the same thing? If not, is there an other way to work on the SPI?
    What I want is, the 328p will be connect to a chip via SPI, but I also need to upload sketch with SPI pins and kinda make it ‘automatically’ select the connection.

Any advice will be sincerely appreciated.

Thanks

1.JPG

  1. Diode stops any high voltage spikes on the Reset pin from putting the device into High Voltage Programmimg Mode, and then looking like it is hung. The diode clamps any spikes to VCC at the most.
  2. I don't know, I don't add one on my designs.
  3. The resistors provide some electrical separation to let external devices control the pins if needed, the USB device then can drive only 5mA of current onto the pins. The '328P can overcome that if needed to drive the pins, or an external device can.
  4. If the SPI device is deselected during programming (you have a 10K pullup on it's slave select or chip select input), then the device is not active on the SPI bus and you can program freely.

CrossRoads:

  1. Diode stops any high voltage spikes on the Reset pin from putting the device into High Voltage Programmimg Mode, and then looking like it is hung. The diode clamps any spikes to VCC at the most.
  2. I don't know, I don't add one on my designs.
  3. The resistors provide some electrical separation to let external devices control the pins if needed, the USB device then can drive only 5mA of current onto the pins. The '328P can overcome that if needed to drive the pins, or an external device can.
  4. If the SPI device is deselected during programming (you have a 10K pullup on it's slave select or chip select input), then the device is not active on the SPI bus and you can program freely.

Thanks

My problem is I'm trying to drive a TLC5940, basically it's not a SPI chip, no SS but I can do with MOSI and SCK, so can I add a 1k or 10k resistor on the MOSI and SCK to achieve this?

  1. During +12V high voltage programming, the diode, RST-button, and RST-circuitry is not there.

  2. The question of spikes come only when we have normal operation of the ATmega328 with the reset
    circuitry as shown in the Arduino design.

  3. The spikes (few tens of volts) are generated when we press the RST-button and release it. The RST
    button is a mechanical switch which makes to-and-fro movements for hundreds of times before settling
    down within 200-500 mS.

  4. The diode clamps the spike to 5V; the input circuitry of the MCU is saved from being damaged by spikes.

GolamMostafa:

  1. During +12V high voltage programming, the diode, RST-button, and RST-circuitry is not there.

  2. The question of spikes come only when we have normal operation of the ATmega328 with the reset
    circuitry as shown in the Arduino design.

  3. The spikes (few tens of volts) are generated when we press the RST-button and release it. The RST
    button is a mechanical switch which makes to-and-fro movements for hundreds of times before settling
    down withn 200-500 mS.

  4. The diode clamps the spike to 5V; the input circuitry of the MCU is saved from being damaged by spikes.

//---------------------------------------------------------------------------------------------------------------------------

… nope.

Look at the reset circuit. The reset pin is capacitively coupled to the DTR pin of the external serial adapter - OP hasn’t asked about this so presumably he understands how this will convert the transition of DTR from high to low when the connection is opened into a brief pulse to reset the chip. But what happens when the connection is closed? The DTR pin will be brought high - so the voltage on RST would briefly jump up. This should not cause any damage to the chip as the reset pin is spec’ed for exposure to voltages up to 13v, and you’d get at most twice Vcc (10v) - but it could cause the chip to enter HVSP mode briefly, resetting it again (which wasn’t intended behavior). This HVSP mode on release of DTR has been blamed for bricking - I’m not convinced this happens though.

Nothing to do with switch bounce in any event.

Re the resistor:

Some people put a 1 meg resistor across a crystal, claiming that that helps insure that it starts oscillating properly. I’ve never seen an explanation of why they supposedly help. I have never used one and have had no issues. Many designs also omit the resistor.

"Some people put a 1 meg resistor across a crystal, claiming that that helps insure that it starts oscillating properly. I've never seen an explanation of why they supposedly help. I have never used one and have had no issues. Many designs also omit the resistor. "

Probably because it is required in a SPICE simulation if you use ideal components. 8^)

The diode is explained here:
http://arduino.cc/forum/index.php/topic,64256.0.html
And here: http://code.google.com/p/arduino/issues/detail?id=572

And here:
A Beginner's Guide to the ESP8266 (see the ‘Autoreset’ paragraph)

You need an edge detector to get a short reset pulse on the falling edge of the DTR line, so an RC high-pass filter is used.
Without the diode, you get a nasty peak of 2×Vcc (this example uses a 3.3V circuit, so on a 5V UNO, the voltage would rise up to 10V instead of 6.6V, but the principle remains the same):


If you add a diode, it discharges the capacitor much more quickly, and the high voltage spike is much narrower:


Pieter

  1. what's the diode on reset pin for? (attachment 1) I found this on both reset pin, is this a must? I tried to work without, everything seems ok too, so why do I would like to add one?

Because their wasn't always one. Then the Arduino factory investigated what was then about 1% of boards that failed test. They had previously been tossed in the bin. So they re read the data sheet and found one was recommended.

So if you don't mind some of your boards not working, go ahead and miss it out.

And all the other stuff they say here.

My problem is I'm trying to drive a TLC5940, basically it's not a SPI chip,

But the current libiary uses the SPI hardware in the chip, so it doesn't matter that it is not an SPI chip, the Arduino thinks it is.