ekd's Homepage https://erickhangdao.com/portfolio/ Recent content in Portfolio on ekd's Homepage Hugo -- gohugo.io en-us Watch Winder https://erickhangdao.com/portfolio/watch-winder/ Mon, 01 Jan 0001 00:00:00 +0000 https://erickhangdao.com/portfolio/watch-winder/ <p>A close friend of mine recently gave me a few watches, one of which being an automatic one. I&rsquo;ve never owned one before, and upon learning how it works, it occurred to me that I don&rsquo;t really want to set the watch to the correct time everytime I wear it. Sure it might increase the lifespan since the mechnical parts are moving less often, but I&rsquo;m placing convience above it.</p> <p>There&rsquo;s this clip from the 2016 movie &ldquo;Dr. Strange&rdquo;, where the main protagonist before going out for a drive, opens a drawer to which a dozen spinning watches are placed. I wanted to replicate this, so I did. Or at least, sharing my progress halfway into the project.</p> <h2 id="design-considerations">Design Considerations</h2> <p>I&rsquo;ve never programmed in assembly before, so I wanted to make this project start with that. Now the architecture. AVR is probably the best bet here, there&rsquo;s tons of resources available for it, and it&rsquo;s widely popular for people taking the leap and ripping the MCU from an arduino. ATmega328p it is. Now for spinning the watch. This device has to be silent, ie stepper motors with a Trinamic driver. I found this one with a silent step feature, TMC2100, seems pretty promising.</p> <h2 id="layup">Layup</h2> <p>Standard stuff with the schematic, just followed the data sheet for both the MCU and the driver. I decided to opt for barrel jack as the power input. 12V input, which is compatible with this low power stepper I&rsquo;m using.</p> <p><img src="https://erickhangdao.com/portfolio/watch-winder/images/Schematic_1.png" alt=""></p> <p>The layout was pretty tricky. I let my ego get in the way to see if I can do this board in only a 30mm by 20mm footprint. Once I got started, I immediately knew this has to be a 4 layer board. No way in hell I can do this in 2. Here it is.</p> <p><img src="https://erickhangdao.com/portfolio/watch-winder/images/Layout_1.png" alt=""></p> <p>And of course a 3D Model:</p> <p><img src="https://erickhangdao.com/portfolio/watch-winder/images/3D_1.png" alt=""></p> <p>PCBs came in, I&rsquo;d say they look pretty well done, reflowed all of the components on, the QFN trinamic driver was rather hard to touch up, since the parts were crammed so tightly in. Here is the full PCBA:</p> <p><img src="https://erickhangdao.com/portfolio/watch-winder/images/PCBA_1.jpg" alt=""></p> <h2 id="analysis-of-r1">Analysis of r1</h2> <p>Obvious packaging mistake on my part&hellip; Nothing like a slight-of-solder won&rsquo;t solve. And it doesn&rsquo;t hit a current cap when I power it on, so at least they&rsquo;re no short circuit. I got onto programming it, using avr-dude as the programming application, and AVRA as the assembler. Untested code that should theoretically work is on my <a href="https://git.erickhangdao.com/watch_winder">git server</a></p> <p>Here&rsquo;s a tip in 2022: buy your chips right after you finish designing. Of course I forgot about the chip shortage, so I thought I could big-brain this situation by ripping the ATmega328p off of an Arduino Nano I had laying around, which is luckily the same chip I designed for. Caveat is that there&rsquo;s a bootloader preinstalled at the end of the flash memory. I should have done more research into AVR programming, because turns out, you can&rsquo;t mess with the boot loader if you program using UART, which is the only interface that I designed headers for. Tried a whole bunch of different avr-dude configurations, no luck. Looks like I&rsquo;m going to have to redo the board, and include header pins for SPI, which I know now is the main way you should be programming this MCU.</p> <p>Also for some odd reason I suppose I was on autopilot when speccing out the filter caps for the TMC2100, and used the recommended 50V caps, when I know I&rsquo;m only going to be using a 12V stepper&hellip; So instead of paying 3 cents for a cap, paid 3 dollars.</p> <h2 id="layup-of-r2">Layup of r2</h2> <p>Finished layup of r2. More detailed change log is in the schematic. The main addition was the ICSP header to program the MCU through SPI. Honestly, I preferred the layout of r1, but r2 is much cleaner.</p> <p><img src="https://erickhangdao.com/portfolio/watch-winder/images/Layout_2.png" alt=""> <img src="https://erickhangdao.com/portfolio/watch-winder/images/3D_2.png" alt=""></p> <p>//Be back in a few weeks&hellip;</p>