summaryrefslogtreecommitdiffstats
path: root/_site/log/arduino-uno/index.html
blob: 66fff37bb36e08e127416af0f891fde48c6ccf35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>ATmega328P at 3.3V and 5V</title>

    <head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>ATmega328P at 3.3V and 5V</title>
  <link rel="stylesheet" href="/assets/css/main.css">
  <link rel="stylesheet" href="/assets/css/skeleton.css">
</head>



  </head>
  <body>

    <div id="nav-container" class="container">
  <ul id="navlist" class="left">
    
    <li >
      <a href="/" class="link-decor-none">hme</a>
    </li>
    <li class="active">
      <a href="/log/" class="link-decor-none">log</a>
    </li>
    <li >
      <a href="/projects/" class="link-decor-none">poc</a>
    </li>
    <li >
      <a href="/about/" class="link-decor-none">abt</a>
    </li>
    <li>
      <a href="/cgi-bin/find.cgi" class="link-decor-none">sws</a>
    </li>
    <li>
      <a href="/feed.xml" class="link-decor-none">rss</a>
    </li>
  </ul>
</div>



    <main>
      <div class="container">
        <div class="container-2">
          <h2 class="center" id="title">ATMEGA328P AT 3.3V AND 5V</h2>
          <h6 class="center">10 JUNE 2025</h5>
          <br>
          <div class="twocol justify"><p>Quick reference for wiring ATmega328P ICs at 5V and 3.3V. 5V uses 16MHz
crystal, 3.3V uses 8MHz.</p>

<table style="border: none; width: 100%;">
  <tr style="border: none;">
    <td style="border: none; width: 50%; vertical-align: top;">
      <img src="pinout.png" alt="Pinout" style="width: 100%" />
      <p style="text-align: center;">Pinout</p>
    </td>
    <td style="border: none; width: 50%; vertical-align: top;">
      <img src="breadboard.jpeg" alt="Circuit" style="width: 100%" />
      <p style="text-align: center;">Breadboard</p>
    </td>
  </tr>
</table>

<h2 id="5v-16mhz">5V-16MHz</h2>

<p>Standard setup. How Arduino Uno boards are wired.</p>

<p>Connections: Pin 1 → 5V via 10kΩ resistor. Pins 9/10 → 16MHz crystal via 22pF
capacitors to ground. Pins 7/20/21 → 5V supply. Pins 8/22 → ground. Add 0.1μF
decoupling caps between pins 7/20/21 and ground.</p>

<p>Sample Makefile: <a href="Makefile">Makefile</a></p>

<h2 id="33v-8mhz">3.3V-8MHz</h2>

<p>Electrical connections identical to 5V circuit. Replace 5V with 3.3V supply,
16MHz crystal with 8MHz.</p>

<p>Problem: ATmega328P ships configured for 5V. Must modify fuses (BOD level,
etc.) and replace bootloader. Standard Arduino bootloader expects 16MHz—needs
8MHz version.</p>

<p>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.</p>

<p>Arduino IDE: Select ‘ATmega328P (3.3V, 8MHz)’ processor, ‘Arduino as ISP’
programmer. Burn bootloader via tools menu.</p>

<p>Sample Makefile (8MHz): <a href="3v3.Makefile">Makefile.3v3</a></p>

<h2 id="remarks">Remarks</h2>

<p>Don’t connect AREF (pin 21) to V<sub>cc</sub> if using ADC with internal 1.1V
or AV<sub>cc</sub> reference. See datasheet section 23.5.2.</p>

</div>
          <p class="post-author right">by W. D. Sadeep Madurange</p>
        </div>
      </div>
    </main>

    <div class="footer">
  <div class="container">
    <div class="twelve columns right container-2">
      <p id="footer-text">&copy; ASCIIMX - 2025</p>
    </div>
  </div>
</div>


  </body>
</html>