diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2026-04-24 14:17:11 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2026-04-24 14:17:11 +0800 |
| commit | 2ac486ca5cb6b81c3755ec0bb8194e88952dcb40 (patch) | |
| tree | ebd839cce2bd874629f3665bce3b63369442afd0 /_log/arduino-uno.md | |
| parent | 7ea27406fbaa22e4b077d8614cd17f2729d956a0 (diff) | |
| download | www-2ac486ca5cb6b81c3755ec0bb8194e88952dcb40.tar.gz | |
Improve Uno configurations post.
Diffstat (limited to '_log/arduino-uno.md')
| -rw-r--r-- | _log/arduino-uno.md | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/_log/arduino-uno.md b/_log/arduino-uno.md index 84ecb69..d726c1f 100644 --- a/_log/arduino-uno.md +++ b/_log/arduino-uno.md @@ -1,11 +1,11 @@ --- -title: ATmega328P at 3.3 V and 5 V +title: ATmega328P 3.3 V and 5 V configurations date: 2025-06-10 layout: post --- Quick reference for wiring ATmega328P ICs at 5 V and 3.3 V. 5 V uses 16 MHz -crystal, 3.3 V uses 8 MHz. +crystal. 3.3 V uses 8 MHz. <table style="border: none; width: 100%;"> <tr style="border: none;"> @@ -22,34 +22,51 @@ crystal, 3.3 V uses 8 MHz. ## 5 V - 16 MHz -Standard setup. How Arduino Uno boards are wired. +Standard setup. How Arduino Uno boards are wired: -Connections: Pin 1 → 5 V via 10 kΩ resistor. Pins 9/10 → 16 MHz crystal via 22 -pF capacitors to ground. Pins 7/20/21 → 5 V supply. Pins 8/22 → ground. Add 0.1 -μF decoupling caps between pins 7/20/21 and ground. +<pre class="pre-no-style"> + Pin 1 --> [ 10k Resistor ] --> 5V + Pin 7 --> 5V (w/ 0.1uF Cap to GND) + Pin 8 --> GND + Pin 9 --> [ 16MHz Crystal ] --> [ 22pF Cap ] --> GND + Pin 10 --> [ 16MHz Crystal ] --> [ 22pF Cap ] --> GND + Pin 20 --> 5V (w/ 0.1uF Cap to GND) + Pin 21 --> 5V (w/ 0.1uF Cap to GND) + Pin 22 --> GND +</pre> Sample Makefile: [Makefile](Makefile) ## 3.3 V - 8 MHz -Electrical connections identical to 5 V circuit. Replace 5 V with 3.3 V supply, +Electrical connections are identical to 5 V circuit. Replace 5 V with 3.3 V supply, 16 MHz crystal with 8 MHz. -Problem: ATmega328P ships configured for 5 V. Must modify fuses (BOD level, -etc.) and replace bootloader. Standard Arduino bootloader expects 16 MHz—needs -8 MHz version. +ATmega328P ships with its fuses(BOD level, etc.) configured for 5 V. Need to +modify them. The standard Arduino bootloader requires a 16 MHz clock. Replace +the default bootloader with one that works witha 8 MHz clock. -Solution: Use Arduino Uno as ISP. Upload 'ArduinoISP' sketch from Arduino IDE. -Connect SPI pins (ATmega328P ↔ Uno), Uno's SS pin → ATmega328P RESET pin. Power -ATmega328P from Uno's 5V pin during programming. +Upload the 'ArduinoISP' sketch from the Arduino IDE to an Arduino Uno to use it +as an ISP. -Arduino IDE: Select 'ATmega328P (3.3 V, 8 MHz)' processor, 'Arduino as ISP' -programmer. Burn bootloader via tools menu. +<pre class="pre-no-style"> + ARDUINO UNO (ISP) ATMEGA328P + +-------------------+ +-------\/-------+ + | D13 |-------------->| 19 PB5 (SCK) | + | D12 |<--------------| 18 PB4 (MISO) | + | D11 |-------------->| 17 PB3 (MOSI) | + | D10 |-------------->| 1 RESET | + | | | | + | 5V |-------------->| 7 VCC | + | GND |-------------->| 8 GND | + +-------------------+ +----------------+ +</pre> -Sample Makefile (8 MHz): [Makefile.3v3](3v3.Makefile) +From the Arduino IDE, select 'ATmega328P (3.3 V, 8 MHz)' processor, 'Arduino as +ISP' programmer. Upload the bootloader from the tools menu. -## Remarks +Sample Makefile (8 MHz): [Makefile.3v3](3v3.Makefile) -Don't connect AREF (pin 21) to V<sub>cc</sub> if using ADC with internal 1.1 V -or AV<sub>cc</sub> reference. See datasheet section 23.5.2. +Note: Don't connect AREF (pin 21) to V<sub>cc</sub> if using ADC with internal +1.1 V or AV<sub>cc</sub> reference. See datasheet section 23.5.2. |
