<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to DSHardware</title><link>https://sourceforge.net/p/socdvm/wiki/DSHardware/</link><description>Recent changes to DSHardware</description><atom:link href="https://sourceforge.net/p/socdvm/wiki/DSHardware/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 03 Nov 2013 10:15:30 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/socdvm/wiki/DSHardware/feed" rel="self" type="application/rss+xml"/><item><title>DSHardware modified by Wiesner Thomas</title><link>https://sourceforge.net/p/socdvm/wiki/DSHardware/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -15,9 +15,9 @@

 #### Support circuitry ####

-Lets start with the power supply section in the lower left corner. There's not much to dwell about; Just a standard linear voltage regulator circuit with protection diodes. The 5V output voltage simultaneously serves as supply voltage and reference voltage. Note that the comparator and opamp are supplied directly by the battery voltage. The voltage regulator needs at least around 1.5V more input voltage than output voltage (the amount depends on the exact type, but unless you use a low-drop regulator, you won't be able to get much less dropout voltage). On the other hand, the input common mode range of the opamp/comparator goes from 0V to Vcc-1.5V and the output voltage range is even lower. Thus, by using e.g. 9V supply voltage and connecting the opamp and comparator supply directly to the battery we buy enough headroom to flawlessly work in the voltage range from 0V to 5V.
+Lets start with the power supply section in the lower left corner. There's not much to dwell about; Just a standard linear voltage regulator circuit with protection diodes. The 5V output voltage simultaneously serves as supply voltage and reference voltage. Note that the comparator and opamp are supplied directly by the battery voltage. The voltage regulator needs at least around 1.5V more input voltage than output voltage (the amount depends on the exact type, but unless you use a low-drop regulator, you won't be able to get much less dropout voltage). On the other hand, the input common mode range of the opamp/comparator goes from 0V to *Vcc*-1.5V and the output voltage range is even lower. Thus, by using e.g. 9V supply voltage and connecting the opamp and comparator supply directly to the battery we buy enough headroom to flawlessly work in the voltage range from 0V to 5V.

-The clock generator is in the center and built around the well known Schmitt-Trigger opamp or comparator square wave generator schematic. *R101*, *R102* and *R103* together with *U2A* form an inverting Schmitt-Trigger. The three equal resistors set the thresholds to 1/3\*Vref and 2/3\*Vref. The input of the Schmitt-Trigger (the (-) input of the comparator) is connected the RC-network *R100*/*C100*. If *C100*'s voltage drops below 1/3\*Vref, the output of the comparator will go high (approximately Vref) and start to charge *C100*. Once the capacitor voltage reaches 2/3\*Vref, the comparator output will switch back to low and discharge *C100* again and the process repeats. Fortunately, no special long term stability is required for the DSADC to work correctly, so this simple RC clock generator is sufficient.
+The clock generator is in the center and built around the well known Schmitt-Trigger opamp or comparator square wave generator schematic. *R101*, *R102* and *R103* together with *U2A* form an inverting Schmitt-Trigger. The three equal resistors set the thresholds to 1/3\**Vref* and 2/3\**Vref*. The input of the Schmitt-Trigger (the (-) input of the comparator) is connected the RC-network *R100*/*C100*. If *C100*'s voltage drops below 1/3\**Vref*, the output of the comparator will go high (approximately *Vref*) and start to charge *C100*. Once the capacitor voltage reaches 2/3\**Vref*, the comparator output will switch back to low and discharge *C100* again and the process repeats. Fortunately, no special long term stability is required for the DSADC to work correctly, so this simple RC clock generator is sufficient.
 *U3B* is used to divide the clock frequency by a factor of two. The output of *U3B* has a perfect 50% duty cycle and clean logic level. There's actually no reason to be that picky about the duty cycle but the 7474 contains two D-FFs and the second one is leftover anyway.

 #### Delta sigma converter ####
@@ -26,19 +26,19 @@
 While no special long term stability of the integration capacitor *C201* is required, I recommend to use some decent foil capacitor. Avoid any type of electrolytic capacitors because of leakage and general purpose supply ("blocking capacitors") because of their potential nonlinearity.

 I won't give an in-depth explanation how a DSADC works, because you can look it up somewhere else, but some general overview.
-I didn't want to use a dual supply (positive and negative supply voltage). Therefore, the reference voltage is split in half by *R1*/*R2* and the AC impedance of this 2.5V reference potential is lowered somewhat by *C1*. These 2.5V (= Vref/2) serve as virtual ground. *R204* in the SDADC shifts the input voltage range in such a way that a symmetric input (with respect to the "real" ground) is achieved, despite the 2.5V virtual ground.
+I didn't want to use a dual supply (positive and negative supply voltage). Therefore, the reference voltage is split in half by *R1*/*R2* and the AC impedance of this 2.5V reference potential is lowered somewhat by *C1*. These 2.5V (= *Vref*/2) serve as virtual ground. *R204* in the SDADC shifts the input voltage range in such a way that a symmetric input (with respect to the "real" ground) is achieved, despite the 2.5V virtual ground.

 *U2B* serves as a 1-bit analog to digital converter. It just tells us whether the output of the integrator is above of below virtual ground. The D-FF *U3A* is used as a clocked 1-bit digital to analog converter. It outputs either -2.5V or 2.5V with respect to the virtual ground. Note that *U3A* must be a type with CMOS output state (e.g. a HCMOS type), because bipolar logic ICs (e.g. LS series) don't provide clean 0V and 5V logic output levels which is very inportant in this application.

 So, how does the analog to digital conversion work? One way to look at it is the following: Consider the input (pin 6) of the integrator *U1B*. It is a current summing node (leave out *R204* for now as it just shifts the input range). The current sum at this node is what the integrator integrates. While doing so, *U1B* keeps the input (pin 6) at (virtual) ground.
 We therefore compare the current caused by the input voltage (which flows through *R201*) to the current fed back from the output of the D-FF, flowing through *R202*.
-Assume that the input voltage is virtual ground (2.5V). This would cause no current to flow through *R201*, because the summing node pin 6 is held at virtual ground by *U1B* and thus the voltage across *R201* is zero. The output of the D-FF is either Vref/2 above virtual ground (5V = Vref) or Vref/2 below virtual ground (0V).
+Assume that the input voltage is virtual ground (2.5V). This would cause no current to flow through *R201*, because the summing node pin 6 is held at virtual ground by *U1B* and thus the voltage across *R201* is zero. The output of the D-FF is either *Vref*/2 above virtual ground (5V = *Vref*) or *Vref*/2 below virtual ground (0V).

-If you now assume that we started with an initial output voltage of Vref/2, we would integrate alternatingly up and down the same amounts each clock cycle because the comparator trips at Vref/2. The integrator slope is determined by the current sum at the input node. In this case, as there is no current through *R201*, the rising and falling slopes are equal. The output of the D-FF would be the bitstream 01010101... . If you take now the average of the bitstream you get exactly 0.5, meaning the input voltage is 0.5 times the reference voltage (5V) which is 2.5V in our case, just the assumption we started with!
+If you now assume that we started with an initial output voltage of *Vref*/2, we would integrate alternatingly up and down the same amounts each clock cycle because the comparator trips at *Vref*/2. The integrator slope is determined by the current sum at the input node. In this case, as there is no current through *R201*, the rising and falling slopes are equal. The output of the D-FF would be the bitstream 01010101... . If you take now the average of the bitstream you get exactly 0.5, meaning the input voltage is 0.5 times the reference voltage (5V) which is 2.5V in our case, just the assumption we started with!

-How does all this change, if the input voltage is not at virtual ground? To investigate this, assume Vin &gt; 2.5V. In this case, we integrate faster down than up (keep in mind that the integrator is inverting). In this case, the output won't alternate each clock cycle, because we need more shallower up-integrating cycles to compensate the steeper slope of the down-integrating cycles. This in turn means that the output Q of *U3A* is more often low than high and the output /Q os more often high than low. The average of the bitstream is now higher than 0.5, which is totally in accordance with our assumption, Vin &gt; Vref/2.
+How does all this change, if the input voltage is not at virtual ground? To investigate this, assume *Vin* &gt; 2.5V. In this case, we integrate faster down than up (keep in mind that the integrator is inverting). In this case, the output won't alternate each clock cycle, because we need more shallower up-integrating cycles to compensate the steeper slope of the down-integrating cycles. This in turn means that the output Q of *U3A* is more often low than high and the output /Q os more often high than low. The average of the bitstream is now higher than 0.5, which is totally in accordance with our assumption, *Vin* &gt; *Vref*/2.

-To make the long story short, the circuit figures out how many times (or how long) you have to add either -Vref/2 or +Vref/2 to your input voltage to get 0V, on average.
+To make the long story short, the circuit figures out how many times (or how long) you have to add either -*Vref*/2 or +*Vref*/2 to your input voltage to get 0V, on average.

 The given values in the schematic result in an input voltage range of -5V to +5V, of which only -4V to 4V should be used, because the more the input voltage approaches the limits, the less frequently the output bit value changes. In the extreme case (+5V or -5V) you end up with only ones or zeros at the output, but the software which processes the bitstream needs 0-to-1 and 1-to-0 transitions to detect the bit level voltages correctly.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Wiesner Thomas</dc:creator><pubDate>Sun, 03 Nov 2013 10:15:30 -0000</pubDate><guid>https://sourceforge.net208b275f0fa3e9bb3ded1023134c2e97a37e40de</guid></item><item><title>DSHardware modified by Wiesner Thomas</title><link>https://sourceforge.net/p/socdvm/wiki/DSHardware/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="delta-sigma-analog-to-digital-converter-hardware"&gt;Delta Sigma analog to digital converter hardware&lt;/h2&gt;
&lt;h3 id="warning"&gt;Warning&lt;/h3&gt;
&lt;p&gt;&lt;font color="#aa0000"&gt;&lt;br /&gt;
The described hardware is intended for connection to a soundcard. Keep in mind that your soundcard (and everything else connected to it, including your PC) may be destroyed if something goes wrong. The developers of this project are not responsible for any damage caused by the described hardware or the instructions.&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;h3 id="schematic"&gt;Schematic&lt;/h3&gt;
&lt;p&gt;The schematic and the &lt;a class="" href="http://kicad.sourceforge.net/"&gt;KiCad&lt;/a&gt; project are available in the downloads section of the project in the &lt;a class="" href="http://sourceforge.net/projects/socdvm/files/hardware/"&gt;hardware&lt;/a&gt;-folder.&lt;/p&gt;
&lt;h3 id="brief-description"&gt;Brief description&lt;/h3&gt;
&lt;p&gt;Before reading this section, you should get the hardware documentation from the source mentioned above to know what we are talking about.&lt;/p&gt;
&lt;p&gt;This "second generation" hardware of this project is a fully fledged delta sigma analog to digital converter (DSADC) and seems to be one of very few complete and functioning schematics for a DSADC which can be built from standard linear and logic ICs. (You can try to find another one, but you'll mostly find sketches which explain the principles of an DSADC and information on how to design an DSADC chip but hardly complete schematics of one that you can build yourself.)&lt;/p&gt;
&lt;h4 id="support-circuitry"&gt;Support circuitry&lt;/h4&gt;
&lt;p&gt;Lets start with the power supply section in the lower left corner. There's not much to dwell about; Just a standard linear voltage regulator circuit with protection diodes. The 5V output voltage simultaneously serves as supply voltage and reference voltage. Note that the comparator and opamp are supplied directly by the battery voltage. The voltage regulator needs at least around 1.5V more input voltage than output voltage (the amount depends on the exact type, but unless you use a low-drop regulator, you won't be able to get much less dropout voltage). On the other hand, the input common mode range of the opamp/comparator goes from 0V to Vcc-1.5V and the output voltage range is even lower. Thus, by using e.g. 9V supply voltage and connecting the opamp and comparator supply directly to the battery we buy enough headroom to flawlessly work in the voltage range from 0V to 5V.&lt;/p&gt;
&lt;p&gt;The clock generator is in the center and built around the well known Schmitt-Trigger opamp or comparator square wave generator schematic. &lt;em&gt;R101&lt;/em&gt;, &lt;em&gt;R102&lt;/em&gt; and &lt;em&gt;R103&lt;/em&gt; together with &lt;em&gt;U2A&lt;/em&gt; form an inverting Schmitt-Trigger. The three equal resistors set the thresholds to 1/3*Vref and 2/3*Vref. The input of the Schmitt-Trigger (the (-) input of the comparator) is connected the RC-network &lt;em&gt;R100&lt;/em&gt;/&lt;em&gt;C100&lt;/em&gt;. If &lt;em&gt;C100&lt;/em&gt;'s voltage drops below 1/3*Vref, the output of the comparator will go high (approximately Vref) and start to charge &lt;em&gt;C100&lt;/em&gt;. Once the capacitor voltage reaches 2/3*Vref, the comparator output will switch back to low and discharge &lt;em&gt;C100&lt;/em&gt; again and the process repeats. Fortunately, no special long term stability is required for the DSADC to work correctly, so this simple RC clock generator is sufficient.&lt;br /&gt;
&lt;em&gt;U3B&lt;/em&gt; is used to divide the clock frequency by a factor of two. The output of &lt;em&gt;U3B&lt;/em&gt; has a perfect 50% duty cycle and clean logic level. There's actually no reason to be that picky about the duty cycle but the 7474 contains two D-FFs and the second one is leftover anyway.&lt;/p&gt;
&lt;h4 id="delta-sigma-converter"&gt;Delta sigma converter&lt;/h4&gt;
&lt;p&gt;The delta sigma circuit itself is located in the upper left part of the schematic. It consists of the integrator around &lt;em&gt;U1B&lt;/em&gt;, the comparator &lt;em&gt;U2B&lt;/em&gt; and the D-FF &lt;em&gt;U3A&lt;/em&gt;.&lt;br /&gt;
While no special long term stability of the integration capacitor &lt;em&gt;C201&lt;/em&gt; is required, I recommend to use some decent foil capacitor. Avoid any type of electrolytic capacitors because of leakage and general purpose supply ("blocking capacitors") because of their potential nonlinearity.&lt;/p&gt;
&lt;p&gt;I won't give an in-depth explanation how a DSADC works, because you can look it up somewhere else, but some general overview.&lt;br /&gt;
I didn't want to use a dual supply (positive and negative supply voltage). Therefore, the reference voltage is split in half by &lt;em&gt;R1&lt;/em&gt;/&lt;em&gt;R2&lt;/em&gt; and the AC impedance of this 2.5V reference potential is lowered somewhat by &lt;em&gt;C1&lt;/em&gt;. These 2.5V (= Vref/2) serve as virtual ground. &lt;em&gt;R204&lt;/em&gt; in the SDADC shifts the input voltage range in such a way that a symmetric input (with respect to the "real" ground) is achieved, despite the 2.5V virtual ground.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;U2B&lt;/em&gt; serves as a 1-bit analog to digital converter. It just tells us whether the output of the integrator is above of below virtual ground. The D-FF &lt;em&gt;U3A&lt;/em&gt; is used as a clocked 1-bit digital to analog converter. It outputs either -2.5V or 2.5V with respect to the virtual ground. Note that &lt;em&gt;U3A&lt;/em&gt; must be a type with CMOS output state (e.g. a HCMOS type), because bipolar logic ICs (e.g. LS series) don't provide clean 0V and 5V logic output levels which is very inportant in this application.&lt;/p&gt;
&lt;p&gt;So, how does the analog to digital conversion work? One way to look at it is the following: Consider the input (pin 6) of the integrator &lt;em&gt;U1B&lt;/em&gt;. It is a current summing node (leave out &lt;em&gt;R204&lt;/em&gt; for now as it just shifts the input range). The current sum at this node is what the integrator integrates. While doing so, &lt;em&gt;U1B&lt;/em&gt; keeps the input (pin 6) at (virtual) ground.&lt;br /&gt;
We therefore compare the current caused by the input voltage (which flows through &lt;em&gt;R201&lt;/em&gt;) to the current fed back from the output of the D-FF, flowing through &lt;em&gt;R202&lt;/em&gt;.&lt;br /&gt;
Assume that the input voltage is virtual ground (2.5V). This would cause no current to flow through &lt;em&gt;R201&lt;/em&gt;, because the summing node pin 6 is held at virtual ground by &lt;em&gt;U1B&lt;/em&gt; and thus the voltage across &lt;em&gt;R201&lt;/em&gt; is zero. The output of the D-FF is either Vref/2 above virtual ground (5V = Vref) or Vref/2 below virtual ground (0V).&lt;/p&gt;
&lt;p&gt;If you now assume that we started with an initial output voltage of Vref/2, we would integrate alternatingly up and down the same amounts each clock cycle because the comparator trips at Vref/2. The integrator slope is determined by the current sum at the input node. In this case, as there is no current through &lt;em&gt;R201&lt;/em&gt;, the rising and falling slopes are equal. The output of the D-FF would be the bitstream 01010101... . If you take now the average of the bitstream you get exactly 0.5, meaning the input voltage is 0.5 times the reference voltage (5V) which is 2.5V in our case, just the assumption we started with!&lt;/p&gt;
&lt;p&gt;How does all this change, if the input voltage is not at virtual ground? To investigate this, assume Vin &amp;gt; 2.5V. In this case, we integrate faster down than up (keep in mind that the integrator is inverting). In this case, the output won't alternate each clock cycle, because we need more shallower up-integrating cycles to compensate the steeper slope of the down-integrating cycles. This in turn means that the output Q of &lt;em&gt;U3A&lt;/em&gt; is more often low than high and the output /Q os more often high than low. The average of the bitstream is now higher than 0.5, which is totally in accordance with our assumption, Vin &amp;gt; Vref/2.&lt;/p&gt;
&lt;p&gt;To make the long story short, the circuit figures out how many times (or how long) you have to add either -Vref/2 or +Vref/2 to your input voltage to get 0V, on average.&lt;/p&gt;
&lt;p&gt;The given values in the schematic result in an input voltage range of -5V to +5V, of which only -4V to 4V should be used, because the more the input voltage approaches the limits, the less frequently the output bit value changes. In the extreme case (+5V or -5V) you end up with only ones or zeros at the output, but the software which processes the bitstream needs 0-to-1 and 1-to-0 transitions to detect the bit level voltages correctly.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;D2&lt;/em&gt; together with &lt;em&gt;R205&lt;/em&gt; provides some input protection.&lt;/p&gt;
&lt;h4 id="output-signal-level-matching"&gt;Output signal level matching&lt;/h4&gt;
&lt;p&gt;The remaining task to do (and the remaining part of the schematic) is the level conversion from TTL logic levels (0V and 5V) to soundcard compatible levels. The &lt;em&gt;R401&lt;/em&gt;/&lt;em&gt;R402&lt;/em&gt; and &lt;em&gt;R404&lt;/em&gt;/&lt;em&gt;R405&lt;/em&gt; do the trick and the C40x achieve the desired AC coupling necessary for the soundcard.&lt;br /&gt;
&lt;em&gt;R403&lt;/em&gt;/&lt;em&gt;R406&lt;/em&gt; prevent a loud click signal on the sound card input if the cable gets plugged in after power on.&lt;/p&gt;
&lt;p&gt;Clock and and data can be fed seperately into the left and right channel or mixed together if &lt;em&gt;GS1&lt;/em&gt; is closed. The mixing function is needed for the SocDVM software and ony the mixed channel should be connected to either the right or left sound card input channel.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Some final words of caution:&lt;/em&gt;&lt;/strong&gt; I built a single prototype of both circuits and their correct function was verified. This is not a design which was tried and tested extensively by numerous people&lt;br /&gt;
so your luck getting it to function may vary. Additionally there were some minor tweaks (like added protection diodes) to the schematics and layouts after the prototype was finished which were not tested in hardware, but should work fine.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Wiesner Thomas</dc:creator><pubDate>Sun, 03 Nov 2013 10:12:51 -0000</pubDate><guid>https://sourceforge.netdc080c3003a401c99331f448a04329d0428417fe</guid></item></channel></rss>