<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Avr on Jamie Montgomerie’s World Wide Web Log</title>
    <link>https://www.blog.montgomerie.net/tags/avr/</link>
    <description>Recent content in Avr on Jamie Montgomerie’s World Wide Web Log</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <copyright>© Jamie Montgomerie</copyright>
    <lastBuildDate>Wed, 30 Aug 2023 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.blog.montgomerie.net/tags/avr/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>&#39;Instant&#39; Resistor Measurer</title>
      <link>https://www.blog.montgomerie.net/posts/2023-08-30-instant-resistor-measurer/</link>
      <pubDate>Wed, 30 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2023-08-30-instant-resistor-measurer/</guid>
      <description>&lt;p&gt;&lt;em&gt;This project is a little old, but now that I have some time, I thought it would be nice to write it up! The device has been serving me well for a few years now.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Being somewhat red/green color blind, I&amp;rsquo;ve always had trouble reading through-hole resistor color codes (though I often wonder if those with full color vision have it much easier - some resistor bands are so &amp;lsquo;muddy&amp;rsquo;!) I make do with labeled pouches holding my resistors, and a multimeter to double-check. The multimeter is &lt;em&gt;so slow&lt;/em&gt;. Surely it shouldn&amp;rsquo;t take seconds to sense a resistor value!&lt;/p&gt;&#xA;&lt;p&gt;For years I dreamt of making a faster resistor measuring device with an instant readout.&lt;/p&gt;&#xA;&lt;p&gt;The &amp;lsquo;final straw&amp;rsquo; that pushed me to actually &lt;em&gt;do&lt;/em&gt; that was that I bought a &lt;a href=&#34;https://www.google.com/search?q=vintage+akro+mils+cabinet&amp;amp;tbm=isch&#34;&gt;beautiful old metal Akro-Mils cabinet&lt;/a&gt;&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; stuffed with old through-hole &lt;a href=&#34;https://www.google.com/search?q=allen+bradley+carbon+composite+resistors&amp;amp;tbm=isch&#34;&gt;carbon composite resistors&lt;/a&gt; at the &lt;a href=&#34;https://www.electronicsfleamarket.com/&#34;&gt;Silicon Valley Electronics Flea Market&lt;/a&gt;. The resistors were obviously sorted in the drawers at one time - but time and chaos had taken their mysterious toll, and they&amp;rsquo;d become pretty substantially mixed up.&lt;/p&gt;&#xA;&lt;p&gt;I needed to sort these hundreds of resistors if I was to ever use them. With the multimeter, that would take &lt;em&gt;for ever&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The &amp;lsquo;resistor measurer&amp;rsquo; I built (call it an ohmmeter if you insist) works really well. It measures the value of a resistor fast enough to seem instant, and it optionally rounds to the nearest &lt;a href=&#34;https://en.wikipedia.org/wiki/E_series_of_preferred_numbers&#34;&gt;E24 or E96&lt;/a&gt; value. I also designed and 3D-printed a benchtop case for it.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m quite pleased with the circuit I came up with to measure the resistance!&lt;/p&gt;&#xA;&lt;video preload=&#34;metadata&#34; width=&#34;100%&#34;  autoplay loop muted playsinline class=&#34;html-video&#34;&gt;&#xA;    &lt;source src=&#34;https://www.blog.montgomerie.net/posts/2023-08-30-instant-resistor-measurer/grabbers.mp4&#34; type=&#34;video/mp4&#34;&gt;&#xA;  &lt;span&gt;Your browser doesn&#39;t support embedded videos, but don&#39;t worry, you can &lt;a href=&#34;https://www.blog.montgomerie.net/posts/2023-08-30-instant-resistor-measurer/grabbers.mp4&#34;&gt;download it&lt;/a&gt; and watch it with your favorite video player!&lt;/span&gt;&#xA;&lt;/video&gt;</description>
    </item>
    <item>
      <title>Switch Dual Shock adapter part 7: Iteration</title>
      <link>https://www.blog.montgomerie.net/posts/2023-05-17-switch-dual-shock-adapter-part-7-iteration/</link>
      <pubDate>Wed, 17 May 2023 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2023-05-17-switch-dual-shock-adapter-part-7-iteration/</guid>
      <description>&lt;p&gt;&lt;em&gt;In this &lt;a href=&#34;https://www.blog.montgomerie.net/tags/switch-dual-shock-adapter-series/&#34;&gt;series of posts&lt;/a&gt;, I&amp;rsquo;m attempting to make a &lt;a href=&#34;https://en.wikipedia.org/wiki/DualShock&#34;&gt;Dual Shock&lt;/a&gt; to &lt;a href=&#34;https://www.nintendo.com/switch/&#34;&gt;Switch&lt;/a&gt; controller adapter. It will plug into the Switch Dock&amp;rsquo;s USB port.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s been a couple of weeks, and I&amp;rsquo;ve still be working on the Dual Shock to Switch adapter in between using it to play Zelda. I&amp;rsquo;m glad to report it is very reliable!&lt;/p&gt;&#xA;&lt;p&gt;I want to write about the changes, but I won&amp;rsquo;t go into as much detail as I did in previous posts. Earlier, I wanted to document the use of V-USB, get into details of the Pro Controller, and just generally document as I explored how to go about a project like this. But the project has now got to the stage where in-depth exploration of the changes is getting less and less interesting.&lt;/p&gt;&#xA;&lt;p&gt;So, instead, I&amp;rsquo;ll just write a little about the latest changes, and you can &lt;a href=&#34;https://github.com/th-in-gs/SwitchDualShockAdapter&#34;&gt;take a look at the source&lt;/a&gt; (or get in touch!) if you&amp;rsquo;re interested.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&lt;img &#xA;    src=&#34;https://www.blog.montgomerie.net/posts/2023-05-17-switch-dual-shock-adapter-part-7-iteration/Shed.jpeg&#34; &#xA;    &#xA;    &#xA;        width=&#34;1024&#34;&#xA;        height=&#34;713&#34;&#xA;    &#xA;    alt=&#34;My workbench, featuring Mac, breadboard with project, dual shock, Switch dock with Switch, and old Gateway monitor&#34;&#xA;     &#xA;     &#xA;/&gt;&#xA;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Switch Dual Shock adapter part 6: Dual Shock</title>
      <link>https://www.blog.montgomerie.net/posts/2023-05-05-switch-dual-shock-adapter-part-6-dual-shock/</link>
      <pubDate>Fri, 05 May 2023 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2023-05-05-switch-dual-shock-adapter-part-6-dual-shock/</guid>
      <description>&lt;p&gt;&lt;em&gt;In this &lt;a href=&#34;https://www.blog.montgomerie.net/tags/switch-dual-shock-adapter-series/&#34;&gt;series of posts&lt;/a&gt;, I&amp;rsquo;m attempting to make a &lt;a href=&#34;https://en.wikipedia.org/wiki/DualShock&#34;&gt;Dual Shock&lt;/a&gt; to &lt;a href=&#34;https://www.nintendo.com/switch/&#34;&gt;Switch&lt;/a&gt; controller adapter. It will plug into the Switch Dock&amp;rsquo;s USB port.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;So far, I&amp;rsquo;ve got a nice, efficient, fake Switch Pro Controller running on my breadboard. But it doesn&amp;rsquo;t &lt;em&gt;do&lt;/em&gt; anything useful - it just fakes out left and right dpad presses. In this installment, I&amp;rsquo;ll connect a Dual Shock to it!&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&lt;img &#xA;    src=&#34;https://www.blog.montgomerie.net/posts/2023-05-05-switch-dual-shock-adapter-part-6-dual-shock/HoldingDualShock.jpeg&#34; &#xA;    &#xA;    &#xA;        width=&#34;1071&#34;&#xA;        height=&#34;602&#34;&#xA;    &#xA;    alt=&#34;Two hands holding a Dual Shock in the usual position&#34;&#xA;     &#xA;     &#xA;/&gt;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;…and play Zelda!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Switch Dual Shock adapter interlude: Bootloading</title>
      <link>https://www.blog.montgomerie.net/posts/2023-05-04-switch-dual-shock-adapter-interlude-bootloading/</link>
      <pubDate>Thu, 04 May 2023 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2023-05-04-switch-dual-shock-adapter-interlude-bootloading/</guid>
      <description>&lt;p&gt;&lt;em&gt;In this &lt;a href=&#34;https://www.blog.montgomerie.net/tags/switch-dual-shock-adapter-series/&#34;&gt;series of posts&lt;/a&gt;, I&amp;rsquo;m attempting to make a &lt;a href=&#34;https://en.wikipedia.org/wiki/DualShock&#34;&gt;Dual Shock&lt;/a&gt; to &lt;a href=&#34;https://www.nintendo.com/switch/&#34;&gt;Switch&lt;/a&gt; controller adapter. It will plug into the Switch Dock&amp;rsquo;s USB port.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is a bit of an interlude from actually working on the project: in this post, I put a serial bootloader onto the ATmega8A I&amp;rsquo;m using, to make development more efficient.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Switch Dual Shock adapter part 5: Analysis!</title>
      <link>https://www.blog.montgomerie.net/posts/2023-05-03-switch-dual-shock-adapter-part-5-analysis/</link>
      <pubDate>Wed, 03 May 2023 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2023-05-03-switch-dual-shock-adapter-part-5-analysis/</guid>
      <description>&lt;p&gt;&lt;em&gt;In this &lt;a href=&#34;https://www.blog.montgomerie.net/tags/switch-dual-shock-adapter-series/&#34;&gt;series of posts&lt;/a&gt;, I&amp;rsquo;m attempting to make a &lt;a href=&#34;https://en.wikipedia.org/wiki/DualShock&#34;&gt;Dual Shock&lt;/a&gt; to &lt;a href=&#34;https://www.nintendo.com/switch/&#34;&gt;Switch&lt;/a&gt; controller adapter. It will plug into the Switch Dock&amp;rsquo;s USB port.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Last time, I got the ATmega masquerading as a Pro Controller and controlling the Switch. This time debugging and performance improvements!&lt;/p&gt;&#xA;&lt;video preload=&#34;metadata&#34; width=&#34;100%&#34;  autoplay loop muted playsinline class=&#34;html-video&#34;&gt;&#xA;    &lt;source src=&#34;https://www.blog.montgomerie.net/posts/2023-05-03-switch-dual-shock-adapter-part-5-analysis/TinyDisplay.mp4&#34; type=&#34;video/mp4&#34;&gt;&#xA;  &lt;span&gt;Your browser doesn&#39;t support embedded videos, but don&#39;t worry, you can &lt;a href=&#34;https://www.blog.montgomerie.net/posts/2023-05-03-switch-dual-shock-adapter-part-5-analysis/TinyDisplay.mp4&#34;&gt;download it&lt;/a&gt; and watch it with your favorite video player!&lt;/span&gt;&#xA;&lt;/video&gt;</description>
    </item>
    <item>
      <title>Switch Dual Shock adapter part 4: Talking to a Switch</title>
      <link>https://www.blog.montgomerie.net/posts/2023-04-07-switch-dual-shock-adapter-part-4-talking-to-a-switch/</link>
      <pubDate>Fri, 07 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2023-04-07-switch-dual-shock-adapter-part-4-talking-to-a-switch/</guid>
      <description>&lt;p&gt;&lt;em&gt;In this &lt;a href=&#34;https://www.blog.montgomerie.net/tags/switch-dual-shock-adapter-series/&#34;&gt;series of posts&lt;/a&gt;, I&amp;rsquo;m attempting to make a &lt;a href=&#34;https://en.wikipedia.org/wiki/DualShock&#34;&gt;Dual Shock&lt;/a&gt; to &lt;a href=&#34;https://www.nintendo.com/switch/&#34;&gt;Switch&lt;/a&gt; controller adapter. It will plug into the Switch Dock&amp;rsquo;s USB port.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;In previous posts, I got a breadboard with an ATmega8A on it running code I wrote using V-USB, masquerading as a generic &lt;a href=&#34;https://en.wikipedia.org/wiki/USB_human_interface_device_class&#34;&gt;USB HID game controller&lt;/a&gt; when plugged into a computer.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&lt;img &#xA;    src=&#34;https://www.blog.montgomerie.net/posts/2023-04-07-switch-dual-shock-adapter-part-4-talking-to-a-switch/FirstUSBBreadboard.jpeg&#34; &#xA;    &#xA;    &#xA;        width=&#34;2048&#34;&#xA;        height=&#34;830&#34;&#xA;    &#xA;    alt=&#34;Breadboard with an ATmega8A and a few components attached&#34;&#xA;     &#xA;     &#xA;/&gt;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;By the end of this post, it will &lt;strong&gt;control a real Nintendo Switch&lt;/strong&gt;! Scroll down to the video at the end for a sneak peek if you&amp;rsquo;re impatient.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Switch Dual Shock adapter part 3: A fake USB HID controller</title>
      <link>https://www.blog.montgomerie.net/posts/2023-01-11-switch-dual-shock-adapter-part-3-a-fake-usb-hid-controller/</link>
      <pubDate>Wed, 11 Jan 2023 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2023-01-11-switch-dual-shock-adapter-part-3-a-fake-usb-hid-controller/</guid>
      <description>&lt;p&gt;&lt;em&gt;In this &lt;a href=&#34;https://www.blog.montgomerie.net/tags/switch-dual-shock-adapter-series/&#34;&gt;series of posts&lt;/a&gt;, I&amp;rsquo;m attempting to make a &lt;a href=&#34;https://en.wikipedia.org/wiki/DualShock&#34;&gt;Dual Shock&lt;/a&gt; to &lt;a href=&#34;https://www.nintendo.com/switch/&#34;&gt;Switch&lt;/a&gt; controller adapter. It will plug into the Switch Dock&amp;rsquo;s USB port.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.blog.montgomerie.net/posts/2022-12-24-switch-dual-shock-adapter-part-2-connecting-to-usb/&#34;&gt;Last time&lt;/a&gt;, I ended with a real USB device that would communicate with a host computer - but all it would do is blink a light on and off.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&lt;img &#xA;    src=&#34;https://www.blog.montgomerie.net/posts/2023-01-11-switch-dual-shock-adapter-part-3-a-fake-usb-hid-controller/USBLED.jpeg&#34; &#xA;    &#xA;    &#xA;        width=&#34;1920&#34;&#xA;        height=&#34;1080&#34;&#xA;    &#xA;    alt=&#34;A breadboard with a USB cable attached to it. A 3.3v regulator is attached to the &amp;#43;5V and GND lines of the USB cable and powering the breadboards power lines. In the middle is an ATmega8A and an LED. There are two small resistors leading from the USB D&amp;#43; and D- lines to the ATMega8A. There are also the various associated resistors and capacitors necessary for things to work.&#34;&#xA;     &#xA;     &#xA;/&gt;&#xA;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Switch Dual Shock adapter part 2: Connecting to USB</title>
      <link>https://www.blog.montgomerie.net/posts/2022-12-24-switch-dual-shock-adapter-part-2-connecting-to-usb/</link>
      <pubDate>Sat, 24 Dec 2022 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2022-12-24-switch-dual-shock-adapter-part-2-connecting-to-usb/</guid>
      <description>&lt;p&gt;&lt;em&gt;In this &lt;a href=&#34;https://www.blog.montgomerie.net/tags/switch-dual-shock-adapter-series/&#34;&gt;series of posts&lt;/a&gt;, I&amp;rsquo;m attempting to make a &lt;a href=&#34;https://en.wikipedia.org/wiki/DualShock&#34;&gt;Dual Shock&lt;/a&gt; to &lt;a href=&#34;https://www.nintendo.com/switch/&#34;&gt;Switch&lt;/a&gt; controller adapter. It will plug into the Switch Dock&amp;rsquo;s USB port.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.blog.montgomerie.net/posts/2022-12-21-making-a-dual-shock-to-nintendo-switch-controller-adapter/&#34;&gt;In the first post of this series&lt;/a&gt;, I got a development environment set up, a programmed ATmega8A onto a breadboard, and code I wrote controlling a blinking LED. In this post, I plan to get &lt;a href=&#34;https://www.obdev.at/products/vusb/index.html&#34;&gt;V-USB&lt;/a&gt; set up, and an LED blinking on a breadboard - OVER USB!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Making a Dual Shock to Nintendo Switch controller adapter</title>
      <link>https://www.blog.montgomerie.net/posts/2022-12-21-making-a-dual-shock-to-nintendo-switch-controller-adapter/</link>
      <pubDate>Wed, 21 Dec 2022 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2022-12-21-making-a-dual-shock-to-nintendo-switch-controller-adapter/</guid>
      <description>&lt;p&gt;In this &lt;a href=&#34;https://www.blog.montgomerie.net/tags/switch-dual-shock-adapter-series/&#34;&gt;series of posts&lt;/a&gt;, I&amp;rsquo;m going to (attempt to?&amp;hellip;) make a &lt;a href=&#34;https://en.wikipedia.org/wiki/DualShock&#34;&gt;Dual Shock&lt;/a&gt; to &lt;a href=&#34;https://www.nintendo.com/switch/&#34;&gt;Switch&lt;/a&gt; controller adapter. It will plug into the Switch Dock&amp;rsquo;s USB port.&lt;/p&gt;&#xA;&lt;p&gt;In doing this, I hope I&amp;rsquo;ll learn about how USB works - something I&amp;rsquo;ve vaguely wondered about for at least twenty years - and have some fun doing low-level microcontroller programming.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m also looking forward to stretching my writing muscles documenting the project here. Maybe you can learn along with me?&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&lt;img &#xA;    src=&#34;https://www.blog.montgomerie.net/posts/2022-12-21-making-a-dual-shock-to-nintendo-switch-controller-adapter/SwitchAndDualShock.jpeg&#34; &#xA;    &#xA;    &#xA;        width=&#34;2048&#34;&#xA;        height=&#34;1536&#34;&#xA;    &#xA;    alt=&#34;A Nintendo Switch with a PSone &amp;lsquo;Dual Shock&amp;rsquo; controller next to it&#34;&#xA;     &#xA;     &#xA;/&gt;&#xA;&#xA;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
