summaryrefslogtreecommitdiffstats
path: root/_site/archive/arduino-uno/index.html
diff options
context:
space:
mode:
Diffstat (limited to '_site/archive/arduino-uno/index.html')
-rw-r--r--_site/archive/arduino-uno/index.html49
1 files changed, 29 insertions, 20 deletions
diff --git a/_site/archive/arduino-uno/index.html b/_site/archive/arduino-uno/index.html
index 7509267..3b0234d 100644
--- a/_site/archive/arduino-uno/index.html
+++ b/_site/archive/arduino-uno/index.html
@@ -2,12 +2,12 @@
<html>
<head>
<meta charset="utf-8">
- <title>Programming ATmega328P chips</title>
+ <title>ATmega328P chips</title>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Programming ATmega328P chips</title>
+ <title>ATmega328P chips</title>
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="stylesheet" href="/assets/css/skeleton.css">
</head>
@@ -40,15 +40,15 @@
<main>
<div class="container">
- <h2 class="center" id="title">PROGRAMMING ATMEGA328P CHIPS</h2>
+ <h2 class="center" id="title">ATMEGA328P CHIPS</h2>
<h6 class="center">10 APRIL 2025</h5>
<br>
- <div class="twocol justify"><p>This post is a step-by-step guide for wiring up ATmega328P ICs to run at 5V
-with a 16MHz crystal and 3.3V with an 8MHz crystal. While the 5V
-configuration is common, the 3.3V configuration can be advantageous in
-low-power applications and when interfacing with parts that run at 3.3V.</p>
-
-<h2 id="5v-16mhz-configuration">5V-16MHz configuration</h2>
+ <div class="twocol justify"><p>This is a quick reference for wiring up ATmega328P ICs to run at 5V and 3.3V.
+While the 5V configuration is common, the 3.3V configuration can be useful in
+low-power applications and when interfacing with parts that themselves run at
+3.3V. In this guide, the 5V setup is configured with a 16MHz crystal
+oscillator, while the 3.3V configuration makes use of an 8MHz crystal
+oscillator.</p>
<p>The steps that follow refer to the following pinout.</p>
@@ -65,6 +65,8 @@ low-power applications and when interfacing with parts that run at 3.3V.</p>
</tr>
</table>
+<h2 id="5v-16mhz-configuration">5V-16MHz configuration</h2>
+
<ol>
<li>Connect pin 1 to 5V via a 10kΩ resistor.</li>
<li>Connect a 16MHz crystal oscillator across pins 9 and 10.</li>
@@ -73,23 +75,30 @@ low-power applications and when interfacing with parts that run at 3.3V.</p>
<li>Connect pins 8 and 22 to ground.</li>
</ol>
-<p>In addition to the connections described above, it’s a good idea to add 0.1μF
+<p>In addition to the the connections above, it’s a good idea to add 0.1μF
decoupling capacitors between pins 7, 20, and 21 and ground.
<a href="Makefile">Here’s</a> a sample Makefile for avr-gcc and avrdude.</p>
<h2 id="33v-8mhz-configuration">3.3V-8MHz configuration</h2>
-<p>The following steps use Arduino Uno as an ISP and Arduino utilities to program
-ATmega328P’s bootloader and the fuses (e.g., BOD level) for a 3.3V supply.</p>
+<p>Standard ATmega328P chips are preconfigured to run at 5V. To run one at 3.3V,
+we must first modify its fuses (e.g., BOD level). If the chip contains a
+pre-installed bootloader that expects a 16MHz clock (such as the Arduino Uno
+bootloader), it must be replaced with one that is more amenable to an 8MHz
+clock.</p>
+
+<p>In the following steps, we use an Arduino Uno as an in-system programmer to
+replace the embedded bootloader and modify the appropriate fuses.</p>
<ol>
- <li>Upload the ‘ArduinoISP’ sketch to the Uno.</li>
- <li>Wire up the ATmega328P as described in the previous section. Replace the 5V
-supply with a 3.3V supply and use an 8MHz crystal instead of the 16MHz
+ <li>Upload the ‘ArduinoISP’ sketch to the Arduino Uno.</li>
+ <li>Wire up the ATmega328P IC as described in the previous section, while
+replacing the 5V supply with a 3.3V supply and 16MHz crystal with an 8MHz
crystal.</li>
<li>Connect the SPI ports (SCK, MISO, and MOSI) of the two MCUs.</li>
- <li>Connect Uno’s SS pin to the IC’s pin 1 (RESET).</li>
- <li>The IC can be powered by the Arduino Uno’s 5V pin.</li>
+ <li>Connect the Arduino Uno’s SS pin to the IC’s RESET pin (pin 1).</li>
+ <li>Connect the IC’s V<sub>CC</sub> to a 5V supply (e.g., the Arduino Uno’s 5V
+pin).</li>
<li>Burn the bootloader to the ATmega328P:
<ul>
<li>Select ‘ATmega328P (3.3V, 8MHz)’ from Tools &gt; Processor.</li>
@@ -100,14 +109,14 @@ crystal.</li>
</ol>
<p>The ATmega328P is now ready to run at 8MHz with a 3.3V power supply. You can
-upload programs to the ATmega328P as you usually would using avrdude.
+upload programs to the ATmega328P as you normally would using avrdude.
<a href="3v3.Makefile">Here’s</a> a sample Makefile with adjusted parameters (e.g., baud
rate) for an 8MHz clock.</p>
<p>In both configurations, if you intend to use the ATmega328P’s analog-to-digital
converter with the internal 1.1V or AV<sub>cc</sub> voltage as reference, do
-not connect AREF (pin 21) to V<sub>cc</sub>. Refer to section 23.5.2 ADC
-Voltage Reference in the datasheet for more information.</p>
+not connect AREF (pin 21) to V<sub>cc</sub>. Refer to section 23.5.2 in the
+datasheet for more information.</p>
</div>
<p class="post-author right">by Wickramage Don Sadeep Madurange</p>