<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: puru</title>
    <description>The latest articles on DEV Community by puru (@esplo).</description>
    <link>https://dev.to/esplo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1486539%2Fcc374095-92c2-4528-bde4-ee1b8eefe72b.png</url>
      <title>DEV Community: puru</title>
      <link>https://dev.to/esplo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/esplo"/>
    <language>en</language>
    <item>
      <title>Running I2C on Pro Micro (2) - Connecting with I2C</title>
      <dc:creator>puru</dc:creator>
      <pubDate>Sat, 25 May 2024 07:09:27 +0000</pubDate>
      <link>https://dev.to/esplo/running-i2c-on-pro-micro-2-connecting-with-i2c-1l44</link>
      <guid>https://dev.to/esplo/running-i2c-on-pro-micro-2-connecting-with-i2c-1l44</guid>
      <description>&lt;p&gt;In this second article of the series, we will look at the basics of I2C and its use on the Pro Micro.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basics of I2C
&lt;/h2&gt;

&lt;p&gt;Although it is actually I²C (I-squared-C), it is commonly referred to as I2C for convenience.&lt;/p&gt;

&lt;p&gt;Using two lines, the clock signal (SCL) and the data signal (SDA), communication can be established by simply connecting each IC. It seems to be a good standard for systems that require scalability. There is also a &lt;a href="https://eetimes.itmedia.co.jp/ee/articles/1411/17/news058.html" rel="noopener noreferrer"&gt;compatible higher version called I3C&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1713003829%2Fwp_assets%2Fn77c6ff740c6b_1711340522518-O7SvM1kGng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1713003829%2Fwp_assets%2Fn77c6ff740c6b_1711340522518-O7SvM1kGng.png" alt=""&gt;&lt;/a&gt;Citation: &lt;a href="https://www.rohm.co.jp/electronics-basics/micon/mi_what7" rel="noopener noreferrer"&gt;https://www.rohm.co.jp/electronics-basics/micon/mi_what7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The IC that operates the connected devices is called the master, and the connected devices are called slaves. It is common to process in a 1:many configuration.&lt;/p&gt;

&lt;p&gt;For more details on the standard: &lt;a href="https://www.nxp.com/docs/ja/user-guide/UM10204.pdf" rel="noopener noreferrer"&gt;https://www.nxp.com/docs/ja/user-guide/UM10204.pdf&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Communication Speed and Standards
&lt;/h3&gt;

&lt;p&gt;The communication speed depends on which I2C standard the connected devices support and the design of the circuit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903930%2Fwp_assets%2Fimage.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903930%2Fwp_assets%2Fimage.png" alt=""&gt;&lt;/a&gt;Citation: &lt;a href="https://en.wikipedia.org/wiki/I%C2%B2C" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/I%C2%B2C&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Among the I2C standards, there are significant differences depending on the standard. The slower the communication speed, the more relaxed the constraints, but they become stricter gradually, and in the case of Ultra-fast mode, it becomes unidirectional communication.&lt;/p&gt;

&lt;p&gt;The Pro Micro (ATmega32U4) seems to support Fast mode at 400kbit/s and 1Mbit/s (citation needed). For custom keyboard applications, 400kbit/s is likely sufficient, so we will consider using the less restrictive Fast mode.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connection Method
&lt;/h3&gt;

&lt;p&gt;Communication can be established by simply connecting SCL and SDA. It is also possible to &lt;a href="https://ja.wikipedia.org/wiki/%E3%83%87%E3%82%A4%E3%82%B8%E3%83%BC%E3%83%81%E3%82%A7%E3%83%BC%E3%83%B3" rel="noopener noreferrer"&gt;daisy chain&lt;/a&gt;, i.e., extending the cable from one IC to another. The important thing here is to &lt;strong&gt;insert a pull-up resistor of appropriate size&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In Fast mode, the rise time (time to change from low to high) is a maximum of &lt;code&gt;300ns&lt;/code&gt; (&lt;a href="https://www.nxp.com/docs/ja/user-guide/UM10204.pdf" rel="noopener noreferrer"&gt;reference&lt;/a&gt;). The resistor is placed to meet this requirement, but the calculation is quite difficult. In short, it should not be too large or too small. It also depends on the cable and devices. The maximum capacitance is &lt;code&gt;400pF&lt;/code&gt;, which corresponds to about 3-4 meters of (typical) cable (&lt;a href="https://vabc.hatenadiary.jp/entry/2022/09/04/173253" rel="noopener noreferrer"&gt;reference&lt;/a&gt;). It is difficult, so I used a calculation site. Convenient.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://keisan.casio.jp/exec/user/1649986426" rel="noopener noreferrer"&gt;I2C Bus Pull-up Resistor Calculation keisan.casio.jp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When calculating as a test, it turns out that 1kΩ is just right for a large estimate of 350pF. If you are assuming long cables, it is good to place 1kΩ. If the cable is short, a larger resistor is fine (requires calculation).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903924%2Fwp_assets%2Fimage-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903924%2Fwp_assets%2Fimage-1.png" alt=""&gt;&lt;/a&gt;&lt;a href="https://keisan.casio.jp/exec/user/1649986426" rel="noopener noreferrer"&gt;https://keisan.casio.jp/exec/user/1649986426&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Communication Method
&lt;/h3&gt;

&lt;p&gt;The master specifies the address for sending and receiving. Therefore, it is necessary to know the address of the slave device in advance. You can also write a program to scan the addresses of connected devices, so it is good to handle it properly during initialization. We will look at this in detail when creating the program.&lt;/p&gt;

&lt;p&gt;According to the standard, 7 bits are used for the address. Therefore, theoretically, it supports 2^7=128 devices. However, it is limited or increased by various methods. This will be discussed later.&lt;/p&gt;

&lt;h2&gt;
  
  
  I2C Module Used This Time
&lt;/h2&gt;

&lt;p&gt;There are various I2C-compatible modules in the world, but this time we will use an &lt;strong&gt;IO expander&lt;/strong&gt; to increase the number of pins.&lt;/p&gt;

&lt;p&gt;An IO expander is an IC for expanding IO pins. The Pro Micro has about 18 general-purpose pins, but it is useful when you want more.&lt;/p&gt;

&lt;p&gt;This time we will use the &lt;a href="https://akizukidenshi.com/goodsaffix/mcp23017_mcp23s17.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;MCP23017&lt;/strong&gt;&lt;/a&gt; (&lt;a href="https://akizukidenshi.com/catalog/g/g109486/" rel="noopener noreferrer"&gt;190 yen at Akizuki&lt;/a&gt;), which can increase by 16 bits (16 pins). However, only 3 bits of the address can be set, and the upper 4 bits are fixed (0x20-0x27). Therefore, it is limited to 8 devices when connected normally.&lt;/p&gt;

&lt;p&gt;The MCP23017 can use internal pull-up resistors for the I/O pins. It is convenient because you do not have to prepare them yourself, but since they are weak at 100kΩ, it is often necessary to add your own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parts to Prepare
&lt;/h2&gt;

&lt;p&gt;Let's actually try to operate it on a breadboard. First, let's connect one and see if it works. To confirm operation, we will connect a switch to an appropriate pin and see if it responds when pressed.&lt;/p&gt;

&lt;p&gt;This time, we will use I2C communication with a 1kΩ pull-up resistor to confirm the operation of the MCP23017.&lt;/p&gt;

&lt;p&gt;The parts used in the first session are assumed to be already available. We will briefly overview the necessary parts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MCP23017 x1&lt;/li&gt;
&lt;li&gt;1kΩ resistors x2&lt;/li&gt;
&lt;li&gt;Breadboard (&lt;a href="https://akizukidenshi.com/catalog/g/g105294/" rel="noopener noreferrer"&gt;BB-801&lt;/a&gt; etc.) x1

&lt;ul&gt;
&lt;li&gt;If you want to separate the breadboard. If it fits on one, that is fine too.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Items Used in the First Session
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Breadboard (&lt;a href="https://akizukidenshi.com/catalog/g/g105294/" rel="noopener noreferrer"&gt;BB-801&lt;/a&gt; etc.) x1&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://shop.yushakobo.jp/products/3905" rel="noopener noreferrer"&gt;Pro Micro + Pin Header&lt;/a&gt; x1&lt;/li&gt;
&lt;li&gt;Reset switch x1&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://akizukidenshi.com/catalog/g/g105159/" rel="noopener noreferrer"&gt;Jumper wires&lt;/a&gt; x many&lt;/li&gt;
&lt;li&gt;Cable to connect Pro Micro to PC&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wiring
&lt;/h2&gt;

&lt;p&gt;Check the pin assignment of the Pro Micro, which you will see many times, and check the positions of SCL/SDA.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903964%2Fwp_assets%2FScreenshot_2024-03-26_at_15.44.44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903964%2Fwp_assets%2FScreenshot_2024-03-26_at_15.44.44.png" alt=""&gt;&lt;/a&gt;Citation: &lt;a href="https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/ProMicro16MHzv1.pdf" rel="noopener noreferrer"&gt;https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/ProMicro16MHzv1.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While looking at the &lt;a href="https://akizukidenshi.com/goodsaffix/mcp23017_mcp23s17.pdf" rel="noopener noreferrer"&gt;MCP23017 datasheet&lt;/a&gt;, decide which pin to insert what. Be careful not to mix up the positions of SCL and SDA. Also, connect a test switch to GPB0 (pin 1) of the MCP23017, connect VCC and GND, and connect #RST to VCC. This completes the standard work. This time, set all addresses to low and make it &lt;code&gt;0x20&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1713879109%2Fwp_assets%2Fi2c_bb_sw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1713879109%2Fwp_assets%2Fi2c_bb_sw.png" alt=""&gt;&lt;/a&gt;Actual: Connected one I2C device&lt;/p&gt;

&lt;p&gt;We will look at the details of the datasheet in the next article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Program Creation (I2C Scanner Edition)
&lt;/h2&gt;

&lt;p&gt;When using I2C, check which devices are connected at the setup stage and process them accordingly.&lt;/p&gt;

&lt;p&gt;First, let's simply check if the connection is successful. There is a convenient program called &lt;strong&gt;I2C Scanner&lt;/strong&gt; for such occasions. Copy and paste it and try running it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://playground.arduino.cc/Main/I2cScanner/" rel="noopener noreferrer"&gt;Arduino Playground - I2cScanner playground.arduino.cc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If successful, the following display will appear on the Serial Monitor. Change the address wiring and check if the display changes.&lt;/p&gt;

</description>
      <category>i2c</category>
      <category>arduino</category>
      <category>keyboard</category>
    </item>
    <item>
      <title>Running I2C on Pro Micro (1) - Pro Micro Setup</title>
      <dc:creator>puru</dc:creator>
      <pubDate>Fri, 24 May 2024 08:14:03 +0000</pubDate>
      <link>https://dev.to/esplo/running-i2c-on-pro-micro-1-pro-micro-setup-2jb7</link>
      <guid>https://dev.to/esplo/running-i2c-on-pro-micro-1-pro-micro-setup-2jb7</guid>
      <description>&lt;p&gt;In custom keyboards and sensor modules, it is common to connect multiple ICs using &lt;strong&gt;I2C&lt;/strong&gt; for processing. In this series, we will use the I2C port on the Pro Micro to operate an IO expander. In this first article, we will set up the Pro Micro on a breadboard. Although I2C is not involved yet, this is an important step for the future. Note that this is an experiment, so we will implement it on a breadboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parts to Prepare
&lt;/h2&gt;

&lt;p&gt;Only the items used in the first part are listed. If you want to buy in bulk, please refer to other articles.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Breadboard (e.g., &lt;a href="https://akizukidenshi.com/catalog/g/g105294/" rel="noopener noreferrer"&gt;BB-801&lt;/a&gt;) x1

&lt;ul&gt;
&lt;li&gt;Planning to use a combination of half sizes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://shop.yushakobo.jp/products/3905" rel="noopener noreferrer"&gt;Pro Micro + Pin Header&lt;/a&gt; x1

&lt;ul&gt;
&lt;li&gt;The Type-C version is less likely to break, so it's more expensive but safer. If you can fix it with a glue gun or have other Pro Micros, those are also fine.&lt;/li&gt;
&lt;li&gt;As mentioned later, there are various types of Pro Micro, so be careful.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Reset switch x1

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://shop.yushakobo.jp/products/a0800ts-01-1" rel="noopener noreferrer"&gt;Yushakobo's 2-pin tactile switch&lt;/a&gt; is cheap and convenient, but anything that can be inserted into the breadboard is fine.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://akizukidenshi.com/catalog/g/g105159/" rel="noopener noreferrer"&gt;Jumper wires&lt;/a&gt; x many

&lt;ul&gt;
&lt;li&gt;You will need a lot as they are used frequently.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Cable to connect Pro Micro to PC

&lt;ul&gt;
&lt;li&gt;It seems that charging-only cables may not be properly recognized.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This is all you need for a simple operation check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rough Terms / Reference Information
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Types of Pro Micro: There are many compatible models. It is important to know which Pro Micro you have and to understand the chip and pin assignments.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The following article is helpful: &lt;a href="https://zenn.dev/koron/articles/9fee38469a8acc" rel="noopener noreferrer"&gt;Pro Micro and its Variations - zenn.dev&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Pin assignment of Pro Micro: Information on what the pins coming out of the Pro Micro are. You can check which leg of the chip (&lt;a href="https://akizukidenshi.com/catalog/g/g109835/" rel="noopener noreferrer"&gt;ATmega32U4&lt;/a&gt;) is coming out from where. This also varies by type, so look at the printing on the board to find the same one. We will proceed with the general one shown below.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903964%2Fwp_assets%2FScreenshot_2024-03-26_at_15.44.44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903964%2Fwp_assets%2FScreenshot_2024-03-26_at_15.44.44.png" alt=""&gt;&lt;/a&gt;Reference: &lt;a href="https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/ProMicro16MHzv1.pdf" rel="noopener noreferrer"&gt;https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/ProMicro16MHzv1.pdf&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Software to Prepare
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Arduino IDE

&lt;ul&gt;
&lt;li&gt;The environment for burning firmware to the Pro Micro. This is convenient.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Solder the Pro Micro and Pin Header
&lt;/h3&gt;

&lt;p&gt;To insert the Pro Micro into the breadboard, attach the pin header.&lt;/p&gt;

&lt;p&gt;You need to consider &lt;strong&gt;which side to face up&lt;/strong&gt; and whether the height of the pin header is sufficient (whether cables can be inserted). To make it less likely to break, I am trying to fix it with the cable insertion port facing down. However, generally, it seems to be the opposite, and the circuit diagram will be mirrored, so be careful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903953%2Fwp_assets%2Fpromicro_bb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903953%2Fwp_assets%2Fpromicro_bb.png" alt=""&gt;&lt;/a&gt;Probably reversed&lt;/p&gt;

&lt;p&gt;For soldering, just solder the pins you will use this time. The targets are GNDx3, RST, and VCC. If you need more pins later, solder them as needed. In the next part, we will also use 2 (SDA) and 3 (SCL), so if you want to solder them all at once, do so.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Wiring on the Breadboard
&lt;/h3&gt;

&lt;p&gt;Place the Pro Micro at the top and wire the necessary pins. As shown below, connect the + and - lanes on the left and right of the breadboard, connect GND and VCC, and connect the switch to #RST (RST with an upper line) and GND to complete. It will be easier later if you make the side with pins 2 and 3 of the Pro Micro wider.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903946%2Fwp_assets%2Fbb_1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903946%2Fwp_assets%2Fbb_1.png" alt=""&gt;&lt;/a&gt;Pro Micro and Reset Switch&lt;/p&gt;

&lt;p&gt;As is common with Reset, the #RST pin is high if left alone and low when resetting. Therefore, it is connected to GND and the switch to run the reset process. This is described in the following Hookup Guide.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/troubleshooting-and-faq" rel="noopener noreferrer"&gt;Pro Micro &amp;amp; Fio V3 Hookup Guide - SparkFun Learn - learn.sparkfun.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By the way, #RST is internally pulled up, so it will be high if left alone. Internal pull-up is a convenient feature that will appear frequently in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903936%2Fwp_assets%2Fimage-2-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fpurucloud%2Fimage%2Fupload%2Fv1712903936%2Fwp_assets%2Fimage-2-1.png" alt=""&gt;&lt;/a&gt;Reference: Figure 8-1: &lt;a href="https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf" rel="noopener noreferrer"&gt;https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Burning the Program with Arduino IDE
&lt;/h3&gt;

&lt;p&gt;Launch the Arduino IDE, copy and paste the sample code from the following link, and compile it. It's good because the LED blinks and is easy to understand.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/example-1-blinkies" rel="noopener noreferrer"&gt;Pro Micro &amp;amp; Fio V3 Hookup Guide - SparkFun Learn - learn.sparkfun.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Arduino IDE, you need to select which board to target. You may despair that there is no Pro Micro, but as mentioned in the &lt;a href="https://zenn.dev/koron/articles/9fee38469a8acc" rel="noopener noreferrer"&gt;previous article&lt;/a&gt;, it is compatible with &lt;strong&gt;Arduino Leonardo&lt;/strong&gt;, so select that. Depending on the model, it may not work well, so refer to &lt;a href="https://ht-deko.com/arduino/promicro.html" rel="noopener noreferrer"&gt;this article&lt;/a&gt; and select another board to burn.&lt;/p&gt;

&lt;p&gt;To burn, double-click the reset switch (single-click for some types of Pro Micro), and the bootloader will start for &lt;code&gt;&amp;lt; 750ms&lt;/code&gt;, during which you burn it. Press the upload button (Cmd+U) in the Arduino IDE in advance, and it will automatically recognize and burn during the bootloader.&lt;/p&gt;

&lt;p&gt;You also need to select the target (Port). If you have never burned a program before, it may not be recognized. The bootloader should be recognized, so reset and see if the list of ports increases. If found, select it quickly and burn it.&lt;/p&gt;

&lt;p&gt;If it doesn't work well, first check if the bootloader is recognized. On a Mac, run &lt;code&gt;ls /dev/tty.*&lt;/code&gt; without the Pro Micro connected. On a MacBook, &lt;code&gt;/dev/tty.Bluetooth-Incoming-Port&lt;/code&gt; may already be there. On Windows, it may be visible from something like Device Manager (unverified). Next, connect and double-click reset, and check if the display increases with the same command. In my case, it appeared as &lt;code&gt;/dev/tty.usbmodem12101&lt;/code&gt; (via USB hub). If it doesn't appear, the Pro Micro itself may be defective, or the reset button may not be functioning properly. In the latter case, try shorting #RST and GND on the Pro Micro with tweezers (x2 times) to see if it starts.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Viewing the Output in Arduino IDE
&lt;/h3&gt;

&lt;p&gt;If you successfully burn it and the Pro Micro starts blinking, you're almost there.&lt;/p&gt;

&lt;p&gt;First, check if it appears in &lt;code&gt;/dev/tty&lt;/code&gt; etc. even in a non-bootloader state. This is to confirm that it is correctly recognized by the PC in normal state. In the case of Arduino Leonardo, it seems that the USB firmware is also burned together when burning from the IDE, allowing good communication with the PC. If not found, you may not have selected the appropriate board to burn. Refer to the previous article and try other boards besides Arduino Leonardo.&lt;/p&gt;

&lt;p&gt;If it seems to be connected well, open "Tools" -&amp;gt; "Serial Monitor" and check if you can see a "Hello world!" message. There is a &lt;code&gt;Serial.println(…)&lt;/code&gt; statement in the program, which can be confirmed from the Arduino IDE. This means you can do print debugging.&lt;/p&gt;

&lt;p&gt;If you get a message like "Cannot connect to Serial Monitor," check if you have selected a different port, and try reconnecting and observing.&lt;/p&gt;

&lt;p&gt;In this state, you can update the program just by pressing the upload button without entering the bootloader. This is convenient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The initial setup part can be tricky, so if you get it working smoothly up to this point, it's worth celebrating. I also spent a whole day not realizing I needed to select the Arduino Leonardo board.&lt;/p&gt;

&lt;p&gt;Next time, we will get into the main topic of I2C.&lt;/p&gt;

</description>
      <category>i2c</category>
      <category>arduino</category>
      <category>keyboard</category>
    </item>
  </channel>
</rss>
