<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Fanjita's Rants (Entries tagged as tuner)</title>
    <link>http://www.fanjita.org/serendipity/</link>
    <description>Homebrewer without a clue</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.6 - http://www.s9y.org/</generator>
    <pubDate>Thu, 09 Feb 2012 01:21:27 GMT</pubDate>

    <image>
        <url>http://www.fanjita.org/serendipity/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Fanjita's Rants - Homebrewer without a clue</title>
        <link>http://www.fanjita.org/serendipity/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>SPI addressing with minimal pins</title>
    <link>http://www.fanjita.org/serendipity/archives/44-SPI-addressing-with-minimal-pins.html</link>
            <category>Arduino</category>
    
    <comments>http://www.fanjita.org/serendipity/archives/44-SPI-addressing-with-minimal-pins.html#comments</comments>
    <wfw:comment>http://www.fanjita.org/serendipity/wfwcomment.php?cid=44</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.fanjita.org/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=44</wfw:commentRss>
    

    <author>nospam@example.com (Fanjita)</author>
    <content:encoded>
    &lt;!-- s9ymdb:22 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;220&quot; height=&quot;220&quot;  src=&quot;http://www.fanjita.org/serendipity/uploads/tuner/msp4131.serendipityThumb.jpg&quot;  alt=&quot;MSP4131 digital potentiometer&quot; /&gt;&lt;p&gt;I picked up some &lt;a href=&#039;http://proto-pic.co.uk/digital-potentiometer-10k/&#039;&gt;digital potentiometers&lt;/a&gt;, partly as a building block for making a programmable filter for the ukulele tuner, but also just to play around with, as they seem pretty cool.
&lt;p&gt;They act exactly like a traditional potentiometer (i.e. there&#039;s an end-to-end resistance of 10K&amp;Omega;, with a &#039;wiper&#039; that can travel from one end of the resistance to the other), but the position of the wiper can be controlled via digital signals.  It seems that they do actually use physical resistors internally, in some fancy switched network.  Anyway, these can normally be used to generate a variable voltage, but I&#039;m also interested in being able to dynamically change resistance in order to tune a filter.
&lt;p&gt;Originally, I assumed these would be an &lt;a href=&#039;http://en.wikipedia.org/wiki/I%C2%B2C&#039;&gt;I2C interface&lt;/a&gt; (previous models I&#039;d seen were), and didn&#039;t pay too much attention to the datasheet.  I2C is great, because you can use 2 pins to control a whole string of devices, so long as they all have unique addresses.  But it turns out that they&#039;re actually &lt;a href=&#039;http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus&#039;&gt;SPI&lt;/a&gt;, which is not so good for small microcontrollers, as even in its minimal form, it uses 3 wires per slave device.  I&#039;d ideally like to control 4 digital potentiometers with a single ATTiny85 - with just 5 data pins available (6 if I don&#039;t care about being able to reprogram more than once). 
&lt;p&gt;So - is it possible to control 4 or more SPI devices, using a single ATTiny85?  Yeah, of course it is - with a bit of jiggery-pokery. &lt;br /&gt;&lt;a href=&quot;http://www.fanjita.org/serendipity/archives/44-SPI-addressing-with-minimal-pins.html#extended&quot;&gt;Continue reading &quot;SPI addressing with minimal pins&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 08 Feb 2012 23:17:00 +0000</pubDate>
    <guid isPermaLink="false">http://www.fanjita.org/serendipity/archives/44-guid.html</guid>
    <category>arduino</category>
<category>attiny</category>
<category>multiplex</category>
<category>shiftreg</category>
<category>spi</category>
<category>tuner</category>

</item>
<item>
    <title>Instrument Tuner - Zero Crossing analysis</title>
    <link>http://www.fanjita.org/serendipity/archives/23-Instrument-Tuner-Zero-Crossing-analysis.html</link>
            <category>Arduino</category>
    
    <comments>http://www.fanjita.org/serendipity/archives/23-Instrument-Tuner-Zero-Crossing-analysis.html#comments</comments>
    <wfw:comment>http://www.fanjita.org/serendipity/wfwcomment.php?cid=23</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.fanjita.org/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=23</wfw:commentRss>
    

    <author>nospam@example.com (Fanjita)</author>
    <content:encoded>
    &lt;p&gt;Having captured audio over a microphone, and converted to a voltage suitable for the Arduino ADC, the next challenge is capturing the analogue data and converting it into an estimation of the frequency of the current note being heard.  That&#039;s a fairly tricky problem, as it turns out.
&lt;p&gt;Firstly, the default Arduino analogRead() function is way too slow.  At 100 microseconds per read, that&#039;s a maximum sample rate of 10kHz - and even that is only possible when tight-looping doing reads, and nothing else.  According to Nyquist&#039;s theorem, at a bare minimum I need to be able to sample at at least twice the highest note&#039;s fundamental frequency, which is probably going to be about 1kHz, so double up to 2kHz.  I&#039;d ideally like to sample at least 5-6 times the highest fundamental, and calculating the incoming frequency requires some maths too.  So, I decided to look into alternative approaches.
&lt;p&gt;A naive approach to frequency counting is to count zero-crossings in a given direction - i.e. observe the waveform, and everytime it goes from negative to positive, increment a counter.  Counting the number of crossings in a given time directly gives you the frequency.  It turns out that both the ATTiny85 and the ATmega328 (Arduino) chips both contain an analogue comparator, hooked up in such a way that zero crossing counting can be done extremely efficiently.
 &lt;br /&gt;&lt;a href=&quot;http://www.fanjita.org/serendipity/archives/23-Instrument-Tuner-Zero-Crossing-analysis.html#extended&quot;&gt;Continue reading &quot;Instrument Tuner - Zero Crossing analysis&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 29 Jan 2012 00:30:28 +0000</pubDate>
    <guid isPermaLink="false">http://www.fanjita.org/serendipity/archives/23-guid.html</guid>
    <category>adc</category>
<category>analogue</category>
<category>arduino</category>
<category>comparator</category>
<category>frequency</category>
<category>timer</category>
<category>tuner</category>

</item>
<item>
    <title>Instrument Tuner - Audio Input Stage</title>
    <link>http://www.fanjita.org/serendipity/archives/22-Instrument-Tuner-Audio-Input-Stage.html</link>
            <category>Arduino</category>
    
    <comments>http://www.fanjita.org/serendipity/archives/22-Instrument-Tuner-Audio-Input-Stage.html#comments</comments>
    <wfw:comment>http://www.fanjita.org/serendipity/wfwcomment.php?cid=22</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.fanjita.org/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=22</wfw:commentRss>
    

    <author>nospam@example.com (Fanjita)</author>
    <content:encoded>
    &lt;p&gt;I&#039;ve been experimenting with creating some sort of instrument tuning helper device, as it seemed like a good mix of analog and digital, as well as a useful thing to have around the house after the arrival of a Ukulele shortly after Christmas.
&lt;p&gt;More on the trials and tribulations at the code level later, but I thought I&#039;d experiment with the &lt;a href=&#039;http://fritzing.org&#039;&gt;Fritzing&lt;/a&gt; circuit design package as a means of recording my more complex circuits, starting with the AF input stage for the tuner.  At first glance, Fritzing seems like everything I need:
&lt;ul&gt;&lt;li&gt;It can handle breadboard representations - in fact, you can enter your circuit via the breadboard view and it will automatically generate a schematic and PCB design, if you want them.
&lt;li&gt;The output looks nice
&lt;li&gt;It seems popular
&lt;li&gt;It&#039;s free!&lt;/ul&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.fanjita.org/serendipity/archives/22-Instrument-Tuner-Audio-Input-Stage.html#extended&quot;&gt;Continue reading &quot;Instrument Tuner - Audio Input Stage&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 28 Jan 2012 00:36:33 +0000</pubDate>
    <guid isPermaLink="false">http://www.fanjita.org/serendipity/archives/22-guid.html</guid>
    <category>arduino</category>
<category>audio</category>
<category>frequency</category>
<category>tuner</category>

</item>

</channel>
</rss>