Id
stringlengths
1
6
Tags
stringlengths
3
101
Answer
stringlengths
38
37.2k
Body
stringlengths
26
26.8k
Title
stringlengths
15
150
CreationDate
stringlengths
23
23
695106
|motor|dc-motor|robotics|drill|
<p>There is much in the internet on the characteristics of such machines.<br /> You can use existing examples to determine the power and shaft speeds that are required. This will make motor specification easier.</p> <p>From what I've seen at a quick skim a brushless DC motor designed for low RPM operation &quot;(low &quot;kv&quot;) - so many poles - and probably hundreds of Watts power - the more the better. The examples below provide an idea of motor to mechanism coupling.</p> <p>Here is a design paper that looks useful. It's written in 'Indonesian'. I tried Google translate with mixed results. This (apparently) uses an internal combustion motor but shows what is involved in design.</p> <p>Introduction page <a href="https://jurnalkelapasawit.iopri.org/index.php/jpks/article/view/183" rel="nofollow noreferrer">here</a></p> <p>Paper <a href="https://jurnalkelapasawit.iopri.org/index.php/jpks/article/view/183/126" rel="nofollow noreferrer">The Design of a Motorized Palm Portable Harvesting Tool using a Flexible Shaft - Indonesian language version</a></p> <p>Here is another paper of possible use. This also uses an internal combustion motor but shows what is involved in design.</p> <p><a href="https://www.researchgate.net/publication/324769041_DEVELOPMENT_AND_EVALUATION_OF_A_NEW_GENERATION_OIL_PALM_MOTORISED_CUTTER_Cantas_Evo#pf4" rel="nofollow noreferrer">DEVELOPMENT AND EVALUATION OF A NEW GENERATION OIL PALM MOTORISED CUTTER</a></p> <p>Full paper can be read using &quot;Read full text&quot; button, or downloaded via Research Gate.</p>
<p>I want assistance in determining an electric motor type suited to building a device for palm oil harvesting. Here is an example of one working <a href="https://www.youtube.com/watch?v=0nitzzuXfg8" rel="nofollow noreferrer">palm cutting machine.</a></p> <p>This machine works similar to a hammer drill machine or like a jackhammer but with lower torque. The application would require higher torque, but also should have good RPM to produce faster back and forth movement, producing short bursts of torque. I cannot decide what type of motor would be suitable for these type of applications. The motor should use DC power supply and be light weight.</p> <p>I am not looking specific product recommendations, but just want to know which type of motors would best suit this application: DC, Universal, BLDC or something else?</p>
Help choosing motor for a fruit cutting machine
2023-12-22T08:14:11.863
695123
|power-supply|dc-dc-converter|current-limiting|buck-boost|sepic|
<p>Some considerations</p> <ol> <li>The FB output can only sink 0.7 mA, so the value of R4 with 500 Ω is far too low. You just have 350 mV regulation head room. There is no need to use such a low impedance divider R4/R3. This is most probably the reason why the needed duty cycle of around 76 % is not reached.</li> <li>The value of the gate discharge resistor R2 is too high for a switching frequency of 100 kHz. The gate capacitance to be discharged is around 1.5 nF.</li> <li>IRF540 needs at least 7 V to turn fully on, so you need a TL494 supply of around 9 V minimum, with safety margin, to reach this (VCE = 1.5V). If you need a minimum input voltage of 5 V, you need another MOSFET with lower threshold voltage.</li> <li>The 5 Ω load at 35 V gives 7 A output current, which is far above your specification.</li> <li>The unconnected input pin 15 may be a problem, connect it to the 2.5 V reference.</li> <li>Using 82 uH creates a relative low ripple current and needs physically large inductors at the required current of around 16A. Lower values have some advantages in this circuit.</li> </ol> <p>With a matching duty cycle and proper gate drive the converter works in this simulation:</p> <p><img src="https://i.stack.imgur.com/8RtqB.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2f8RtqB.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p>
<p>I am trying to build a buckboost converter for converting <strong>5-40v input to 5-35V output at 3A max</strong> to use it for many purposes by usign <em>TL494</em>. I am using a SEPIC topology as i want a non inverting output. I simulated the circuit in proteus. The circuit works fine when i connected a 500 Ohm load, I was able to get output of 5 to 35 volts at <strong>100kHz frequency.</strong></p> <p>But when I used a 5 Ohm load, the voltage drops from 35v to 2v, because it can't able to give enough current, The maximum i get is somewhat around 400mA</p> <p>I think the problem is in buck-boost stage, because I tested the buck-boost stage seperatly by giving a PWM signal, it has the same result.</p> <p>I used inductors with 82uH and capacitors with 22uF, Shottkey diode and IRF540 MOSFET, I also change the shotkey diode with a high current one, but no results.</p> <p>Here the simulation results,</p> <p>with 500 Ohm load <a href="https://i.stack.imgur.com/5LmTP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5LmTP.png" alt="500 Ohm load" /></a></p> <p>with 5 Ohm load <a href="https://i.stack.imgur.com/bNm4v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bNm4v.png" alt="5 Ohm load" /></a></p> <p>waveform of L1 current, C1 voltage and PWM at 5 Ohm load <a href="https://i.stack.imgur.com/lN9J3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lN9J3.png" alt="graph" /></a></p> <p>But, when <strong>i changed the capacitor values to 1000uF, inductor values to 220uH and frequency to 5kHz i get 2A</strong> for 10v, but still not 3A</p> <ol> <li>So, what i need to do to get desired output, what are the parameters needed to tweak?</li> <li>Do i have to operate the buck-boost stage at resonant frequency to get max output?</li> <li>What limits it form providing high current?</li> </ol>
Not able to get enough current from buck boost (sepic) converter made using TL494
2023-12-22T11:54:09.217
695136
|circuit-analysis|digital-logic|circuit-design|logic-gates|
<p>As Hearth's alluded to, sometime it's just because you were <em><strong>already</strong></em> using AND gates elsewhere and didn't want to add a whole new line item to the Bill of Materials for a part you might only need one of.</p> <p>I've certainly done this in some commercial applications (medical) where having a low BOM complexity was the bigger concern. When you're talking about product lines that span multiple decades, having a wider selection of parts just means you're more likely to run into obsolescence issues...</p> <p>P.S. the quad AND gate may also just have been dirt-cheap and readily available from multiple suppliers (or already in their part library) when the board was being designed.</p> <p><em>&quot;It doesn't have to be <strong>perfect</strong>, it just has to <strong>work</strong></em>&quot; - An engineer... probably</p>
<p>On my hands I have an Ekahau Sidekick 1, which is a device for measuring the Wi-Fi, and I've been analyzing its PCB for quite a moment now. It is composed of one main compute module(SMARC-FIMX6 from Embedian) and 3 mini PCIe card, two Wi-Fi adapters and one custom spectrum analyzer.</p> <p>While looking at the PCB I spotted a strange area and drew the schematic for it(image attached to the post). The signal on the left comes from the compute module and the free signals on the right are going each to each mini PCIe module.</p> <p>The question is: what is the purpose of all that mess? Why use a quad AND gate IC, if you will short all the inputs together anyway? And what's the purpose of this shmitt-trigger buffer with the diode and other components?</p> <p><a href="https://i.stack.imgur.com/IwxPl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IwxPl.png" alt="1" /></a></p>
Problem understanding reset circuit for mini PCIe cards
2023-12-22T14:33:16.220
695154
|instrumentation-amplifier|bode-plot|differential-amplifier|
<p><a href="https://i.stack.imgur.com/mhELr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mhELr.png" alt="enter image description here" /></a></p> <p>Your two sources spec &quot;AC 1&quot;, so in AC mode they have the same phase. You are simulating the common mode rejection of the differential amplifier. As expected, CMRR decreases with rising frequency, so the &quot;gain&quot; you plot starts from very low (high CMRR) at low frequency and then rises as frequency increases.</p> <p>Solution: define one of the AC sources as &quot;AC -1&quot; so you have an AC differential signal at the input.</p> <p>Note the phase specified in SINE(...) is only for transient and is ignored in AC mode. In fact everything you put in the left side of this box is only for transient, it will be ignored in AC and DC modes. For AC you can specify amplitude and phase, likewise these are ignored in transient and DC modes.</p> <p><a href="https://i.stack.imgur.com/dFj8T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dFj8T.png" alt="enter image description here" /></a></p> <p>Better solution: use a bunch of defines like so</p> <pre><code>.define test_cmrr 0 .define test_diff 1 .define test_psrr 0 </code></pre> <p>Then for each source you set the AC value to the relevant variable. For example these two input sources would have &quot;AC test_cmrr+test_diff/2&quot; and &quot;AC test_cmrr-test_diff/2&quot;.</p> <p>Power supply sources have &quot;AC test_psrr&quot;. Then you can change a define, and that sets your sources properly to plot what you want.</p> <p>Or you can put a voltage source for the common mode, and two voltage sources for the differential mode (same definition for both but one has polarity switched), which is a lot more convenient if you want to make a transient sim with a non-constant common mode, or signals with different amplitude/frequency on both common and differential modes, for example to check for saturation.</p> <p>Here is a crummy model of LM358 which uses a spice current source to model the input stage tail current source, so it allows unrealistic input common mode:</p> <p><a href="https://i.stack.imgur.com/ULNCf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ULNCf.png" alt="enter image description here" /></a></p>
<p>Followup to <a href="https://electronics.stackexchange.com/questions/694948/loss-of-2nd-order-behavior-on-2nd-order-low-pass-filter">this question.</a></p> <p>I have an instrumentation amplifier.</p> <p><a href="https://i.stack.imgur.com/NEA89.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NEA89.png" alt="enter image description here" /></a></p> <p>When conducting an AC Sweep, this is the response. <a href="https://i.stack.imgur.com/Mb7SP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mb7SP.png" alt="enter image description here" /></a></p> <p>There are two issues with this. Firstly, the signal magnitude is far too low. Secondly, the signal somehow grows on higher frequencies.</p> <p>I lack any reactive passive components and reactance of the op-amp used (the <a href="https://www.analog.com/media/en/technical-documentation/data-sheets/ADA4091-2_4091-4.pdf" rel="nofollow noreferrer">ADA4091</a>) is not significant until exceeding 100kHz. If there is a parameter in the op-amps that would affect this, I am unaware of it.</p> <p>Bode plot with PR8 and PR9 included, points within the Instrumentation Amplifier.</p> <p><a href="https://i.stack.imgur.com/cr6Dc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cr6Dc.png" alt="enter image description here" /></a></p> <p>Addendum: The input voltages (V17 and V20) are offset by +2.5V. Unfortunately Multisim does not display that properly. Thank you to Andy aka for reminding me to specify that.</p> <p>Addendum 2: I've isolated the issue to the latter half of the circuit, as disconnecting the two shows that the first half acts within reason with a magnitude of around -1dB for an AC Sweep, while the latter half still has a -100dB loss.</p> <p>Based on suggestions that Multisim is not as commonly used, I simulated the latter half of this circuit (which is just a differential amplifier) in LTSpice. I removed all offsets and provided a +5V and -5V voltages as inputs.</p> <p><a href="https://i.stack.imgur.com/mhELr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mhELr.png" alt="enter image description here" /></a></p> <p>The AC Sweep remains unsatisfactory despite a reasonable transient response.</p> <p><a href="https://i.stack.imgur.com/H2evm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H2evm.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/8dAJ3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8dAJ3.png" alt="enter image description here" /></a></p> <p>One thing of note is that the power source powering the Op-Amp (An ADA4091) is returning the following response in AC Sweeps:</p> <p><a href="https://i.stack.imgur.com/uPeP3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uPeP3.png" alt="enter image description here" /></a></p> <p>The LTSpice simulation file in question: <a href="https://ufile.io/640sx0l3" rel="nofollow noreferrer">https://ufile.io/640sx0l3</a> (I can put it somewhere else if this site is not too familiar with ufile)</p> <p>Addendum 3: Other things attempted include</p> <ol> <li>Changing values and ratio of resistor. Changing values of resistor while maintaining ratio did not improve magnitude. Increasing gain of system with resistor ratio changes did improve the magnitude to an extent in the AC Sweep (I was able to get -20dB) but due to application issues, the gain of the diff. amplifier cannot be over 20.</li> </ol> <p><a href="https://i.stack.imgur.com/z9NBn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z9NBn.png" alt="enter image description here" /></a></p> <ol start="2"> <li><p>Change input voltage to 5V and -5V. No change observed.</p> </li> <li><p>Change input voltage to it's own loop. This improve the magnitude greatly, but the output voltage became dependent on the voltage source, which varied significantly.</p> </li> </ol> <p><a href="https://i.stack.imgur.com/JGEJg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JGEJg.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/lng26.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lng26.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/tHNGx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tHNGx.png" alt="enter image description here" /></a></p> <ol start="4"> <li><p>Change input offset from 2.5V to 0V. This had no effect.</p> </li> <li><p>Attempt to switch to 2-opamp Instrument Amplifier circuit. Magnitude was similarly low.</p> </li> </ol> <p><a href="https://i.stack.imgur.com/qkCQy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qkCQy.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/YfQUP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YfQUP.png" alt="enter image description here" /></a></p>
Instrumentation Amplifier improper frequency response
2023-12-22T17:28:25.013
695157
|identification|connector|ribbon-cable|fpc|ffc|
<p>It looks like a friction fit. The thickness of the stiffener on the flex PCB suggests that the board edge connector is actually a 180deg card edge connector, which also suggests friction fit. The size looks like it's for a 20-30mil FR4 stiffener (be nice to check the thickness).</p> <p>The notch (enforced by the PCB) ensures that the connector is keyed.</p> <p>This looks like an older/chinese connector or a custom connector, it's not one made by a manufacturer. You might be able to match the pitch and the card thickness with a different connector but it wouldn't be a 180deg connector.</p>
<p>I could not see any hinge or flap or other release mechanism. The connector seems like it is one piece of plastic with no obvious seams although in some images I think tooling marks look a bit like seams. I couldn't pull the cable out with moderate force.</p> <p>I believe this is the cable that is associated with the connector. It does not appear as though the notch goes inside the connector.</p> <p><a href="https://i.stack.imgur.com/fGlfu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fGlfu.png" alt="enter image description here" /></a></p> <p>Then just a lot of different views:</p> <p>The cable comes through a slot in the PCB up into the connector. The connector has through-hole pins on the side nearest the black relays (opposite the PCB edge) *Note the small plastic spur sticking up is from me prying on the connector and not physical feature. <a href="https://i.stack.imgur.com/W3fvu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W3fvu.jpg" alt="enter image description here" /></a></p> <p>No obvious flange/door or release tabs. <a href="https://i.stack.imgur.com/s1uCx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s1uCx.jpg" alt="enter image description here" /></a></p> <p>Looks like a single piece of plastic. <a href="https://i.stack.imgur.com/6reTN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6reTN.jpg" alt="enter image description here" /></a></p> <p>Prying on this back slot did not seem do anything <a href="https://i.stack.imgur.com/mbBa3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mbBa3.jpg" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/IHOXg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IHOXg.jpg" alt="enter image description here" /></a></p> <p>Looks like it just goes straight in with the contacts: <a href="https://i.stack.imgur.com/jsRpd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jsRpd.jpg" alt="enter image description here" /></a></p>
Help needed identifying this 180 degree bottom insertion ffc connector and how to release the cable
2023-12-22T18:13:28.380
695183
|thermistor|
<p>You'd be better off to use the extended Steinhart-Hart equations.</p> <p>You can find the coefficients <a href="https://www.vishay.com/en/thermistors/ntc-rt-calculator/" rel="noreferrer">here</a></p> <p>A= -15.53215593</p> <p>B= 5229.973</p> <p>C= -160451.</p> <p>D= -5414091.</p> <p>Rt = <span class="math-container">\$R_{25}(e^{(A + B/T + C/T^2 + D/T^3)}) \$</span></p> <p><span class="math-container">\$R_{25}\$</span> is the resistance at 25°C (47k in this case)</p> <p>T is the absolute temperature of the sensor</p> <p>Of course you can also use the calculator on the linked page or the above equations to calculate <span class="math-container">\$\beta\$</span> for any temperature range you desire within the -40°C to 150°C range, but it's more accurate to use the full equation.</p> <p>From my recollection if you attempt to extrapolate using the beta for a narrower range the error will increase rapidly as you go beyond the original range. If you calculate a new beta for the new wider range the error will be higher than if you had a narrow range, but it will be much lower than if you extrapolated.</p>
<p>Most NTC thermistors have operating range way beyond the single B value specified in the datasheet. For example <a href="https://www.vishay.com/docs/29092/ntcalug01a.pdf" rel="nofollow noreferrer">NTCALUG01A473HA</a> has operating range -40..150C but only B25/85 specified.</p> <p>Can I use basic R = R25 * exp(B(1/t - 1/298.15)) formula to estimate resistance at say 100..127C range?</p> <p>The reason I am asking is that some devices have long tables that seem to indicate that B value varies rather significantly in different regions of the operating range. Unfortunately for several reasons I have to choose the part by the mechanical construction, so finding the one with suitable B-value range is problematic.</p>
Can the B-value for NTC be used to extrapolate beyond the B range?
2023-12-23T02:44:53.993
695191
|identification|sot23|
<p>The marking looks to have a lower case 'p' and an upper case 'D', i.e. <code>pD</code>.</p> <p>From <a href="https://smd.yooneed.one/code5044.html" rel="noreferrer">The ultimate SMD marking codes database selecting a marking of PD</a> the matching device is a <code>74AUP1GU04GW</code> in a <code>SOT-353-1</code> package from NXP Semiconductors which is a <em>CMOS logic IC, Single unbuffered inverter</em></p> <p>The <a href="https://assets.nexperia.com/documents/data-sheet/74AUP1GU04.pdf" rel="noreferrer">74AUP1GU04</a> NXP datasheet shows <code>74AUP1GU04GW</code> has:</p> <ul> <li><p>Package <code>SOT353-1</code></p> </li> <li><p>Marking code <code>pD</code></p> </li> <li><p>Pinout:</p> <p><a href="https://i.stack.imgur.com/IgIMt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/IgIMt.png" alt="enter image description here" /></a></p> </li> </ul> <blockquote> <p>Spent quite a bit time but could not identify 'U13' <strong>SOT23-5</strong> component with the marking 'PD'.</p> </blockquote> <p>The question says the package is <code>SOT23-5</code>, rather than the <code>SOT353-1</code> from the above identified device <code>74AUP1GU04GW</code>.</p> <p>The Wikipedia page <a href="https://en.wikipedia.org/wiki/Small-outline_transistor#SOT23-5,_SOT353,_SOT553" rel="noreferrer">SOT23-5, SOT353, SOT553</a> shows there are some dimension differences between <code>SOT23-5</code> and <code>SOT353-1</code>. Maybe worth trying to precisely measuring the dimensions of <code>U13</code> on the PCB to confirm which package it is, since from just looking at it might be difficult to tell a <code>SOT23-5</code>.vs. <code>SOT353-1</code>.</p>
<p><a href="https://i.stack.imgur.com/11mBm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/11mBm.jpg" alt="enter image description here" /></a> Spent quite a bit time but could not identify 'U13' SOT23-5 component with the marking 'PD'. Can anyone help? Thanks!</p>
What is this SOT23-5 component marked pD?
2023-12-23T07:38:30.757
695192
|esd|tvs|surge-protection|diode-clamp|
<p>Don't use a zener or other TVS; not for ESD purposes alone, anyway. The bypass capacitor is sufficient.</p> <p>You may find this answer I just wrote to be of interest, <br /> <a href="https://electronics.stackexchange.com/questions/695193/is-a-100r-1nf-rc-enough-to-protect-microcontroller-io-pin-from-esd/695213#695213">Is a 100R/1nF RC enough to protect microcontroller IO pin from ESD?</a> <br /> by changing C2 to a larger value, and minding the same considerations mentioned there (particularly ESL which is your responsibility in PCB layout), you will find the peak voltage is adequately limited even without diodes.</p> <p>The series resistor is a good idea for a different reason: hot-plugging inrush. Cells have considerable capacitance, so on closing the loop with your bypass capacitor, quite some inrush current can flow, and resonate with stray loop inductance (probably low 100s nH here, more if cable length is present). A small value like 22Ω is enough to dampen <span class="math-container">\$L \lt R^2 C\$</span> or several mH.</p> <p>Mind that type 2 ceramic capacitor value decreases with DC bias, and the value for calculation is the total series equivalent, so will be less than the rated value, perhaps 5µF, perhaps just a couple even.</p>
<p>The circuit under consideration is to be powered by four 18650 li-ion cells in series. These cells are in a holder and user replaceable so there is risk of the contacts being touched and adding esd protection might be wise.</p> <p>The biggest problem is a <a href="https://www.ti.com/lit/ds/symlink/cd40109b-q1.pdf" rel="nofollow noreferrer">CD40109</a>, which is powered straight from the battery. Parameters of concern for this chip are:</p> <ul> <li>Absolute maximum supply voltage: 20V</li> <li>Recommended maximum supply voltage: 18V</li> </ul> <p>Four, fully charged, 18650 cells in series will provide ~16.8V (4x 4.2V)</p> <p>The problem is that TVS diodes with a reverse stand-off/working voltage of &gt;16.8V but with a clamping voltage &lt;= 20V don't seem to exist. What would be good ways to handle this situation?</p> <p>I'm thinking along the lines of the following:</p> <p><img src="https://i.stack.imgur.com/6oKEe.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2f6oKEe.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p> <p>Selecting a TVS diode with a higher clamping voltage such as 30~35V and then feeding the CD40109 trough a RC. With the input clamped at 35V during a ESD event it takes ~40µs for the capacitor to charge from 16.8 to 20V with the values given, which seems enough to survive a standard 8/20µs event. The CD40109 is not driving any significant loads, so 22 ohm in the power feed is no problem. Any problems with this idea? Better ideas?</p>
ESD protection when reverse stand-off voltage and required clamping voltage are close together
2023-12-23T08:34:07.787
695193
|esd|low-pass|surge-protection|
<p>RC low-pass filters are used for ESD protection, but they are usually used on lines that aren't directly exposed to ESD events. They are used on lines that could pick up energy from a distant ESD event through radiation, which is way less energy than a direct ESD event. Usually it's about preventing falsified data on digital lines and not about preventing physical destruction.</p> <p>On lines that might experience direct ESD events, such RC combinations are probably not sufficient.</p>
<p>While researching ESD protection on this site, I came across <a href="https://electronics.stackexchange.com/questions/279136/sensitivity-of-schottky-diodes-to-esd-effectiveness-vs-tvs-diodes">this question</a>.</p> <p>The answer by Peter Smith contains <a href="https://electronics.stackexchange.com/questions/279136/sensitivity-of-schottky-diodes-to-esd-effectiveness-vs-tvs-diodes#comment634286_279145">a comment</a> by @Ale..chenski:</p> <blockquote> <p>Just a nit pick: if you can afford 100R and 1nF to ground on a pin, you most likely don't need any extra ESD protection.</p> </blockquote> <p>Can anyone elaborate on this? Is this really a valid protection or am I interpreting this comment wrong?</p>
Is a 100 Ω/1 nF RC low-pass filter enough to protect a microcontroller I/O pin from ESD?
2023-12-23T08:44:11.700
695203
|diodes|datasheet|semiconductors|
<p>I would be shocked if it weren't per-diode.</p> <p>But they don't explicitly say so, so, if you need design assurance: ask the manufacturer to clarify, or shop around for a better-specified part.</p>
<p>I'm trying to interpret the datasheet of a Dual-Diode Module, specifically the MF200C12F2N. The internal Circuit Structure is given below:</p> <p><a href="https://i.stack.imgur.com/53cmu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/53cmu.png" alt="enter image description here" /></a></p> <p>The Forward Voltage is given as 2.3V without any further explanations. Would this be the voltage drop across a single diode (i.e., across Terminals 1-2) or across the entire Structure (i.e. 1-3)?</p>
Interpreting Diode-Module Datasheet (Voltage Drop)
2023-12-23T10:09:52.083
695214
|batteries|lithium-ion|diy|lithium|18650|
<p>I think the connections are correct.</p> <p>But the calculations are not.</p> <p>You have eight 3Ah batteries. Connected like that, it certainly does not make a 24 Ah battery, but a 6 Ah battery.</p> <p>That's because you basically have two cells in parallel so that makes a 4s string of 6Ah batteries and if you draw 6Ah out of a series string then all 6Ah batteries are empty.</p> <p>Only if you connect all 8 cells in parallel, you get a 24 Ah battery.</p>
<p>I'm planning to build my 4S2P battery pack using 18650 lithium-ion battery cells. I need to make sure my connections and my battery pack is correct and safe before I make the connections. Here's the diagram for the battery pack:</p> <p><a href="https://i.stack.imgur.com/3SciB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3SciB.jpg" alt="14s2p Battery Pack" /></a></p> <p>Each cell can be charged to 4.2 V maximum. Calculating the pack's specifications:</p> <p><strong>Capacity (Ah)</strong> = 8 x 3 Ah = 24 Ah</p> <p><strong>Wh</strong> = 14.8 V x 24 = 355.2</p> <p><strong>C-rate</strong> = 20 A / 24 = 0.833</p> <p><strong>Maximum discharge current (A)</strong> = 0.8333 x 24 ≈ 19.992 20 A</p> <p>Are my connections and calculations correct?</p> <p>Note that I labeled the connections for the BMS, B0, B1, B2, B3 and B4 which will be connected according to the diagram of the 4S BMS that I have.</p>
Is my 4s2p pack connections correct?
2023-12-23T11:22:05.927
695221
|led|
<p>The FPGA GPIOs are connected to pins 1, 3, 5 and 7 of what was the location for a Kingbright <a href="https://www.kingbright.com/attachments/file/psearch/000/00/20160808bak/L-914CK-4GDT(Ver.10B).pdf" rel="nofollow noreferrer">L-914CK/4GDT 2x3mm QUAD-LEVEL LED INDICATOR</a>, via 330 <span class="math-container">\$\Omega\$</span> series resistors. These pins are the anodes for the LEDs.</p> <p><code>R584</code> and <code>R669</code> are connected to pins 2, 4, 6 and 8 of what are the cathodes of the LEDs. <code>R669</code> is zero <span class="math-container">\$\Omega\$</span> and provides the connection of the LED cathodes to ground. <code>R584</code> is 10 K<span class="math-container">\$\Omega\$</span> and is effectively just connected between ground and +2.5 V and serves no purpose when used with the Kingbright L-914CK/4GDT.</p> <p>The question has clarified that the LED <code>HL8</code> isn't populated, and instead a 4 pin header has been fitted to <code>HL8</code> pins 1, 3, 5 and 7 to use the FPGA pins as GPIOs.</p> <p>The fact that <code>R584</code> and <code>R669</code> are fitted means that if headers were connected to <code>HL8</code> pins 2, 4, 6 and 8 they would serve as a ground reference for the adjacent GPIOs.</p> <p><strong>Update</strong>: As suggested by @bruin in a comment, the designer might have put <code>R584</code> on the schematic to allow for installing a LED array with the anode and cathode swapped such that +2.5 V connects to the anodes of LEDs assuming that:</p> <ul> <li><code>R669</code> was removed.</li> <li><code>R584</code> was replaced with a zero <span class="math-container">\$\Omega\$</span> resistor.</li> </ul> <p>The effect would be that the LED will be on when FPGA pin is low.</p>
<p>I am reading a FPGA dev-board schematic, particularly for the LED part (below). I don't understand the purpose of the highlighted part (a 2.5v DC source and a resistor R584).</p> <p><a href="https://i.stack.imgur.com/Voq3v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Voq3v.png" alt="LED circuit" /></a></p> <p>The full schematic can be downloaded from <a href="https://gitee.com/xiongyuwu/docs/blob/master/fpga/BOE_V1.1.pdf" rel="nofollow noreferrer">here</a>. Btw, I called it &quot;dev-board&quot; because I use it for learning FPGA. The original project for this board seems related to <a href="https://github.com/hpb-project/BOE" rel="nofollow noreferrer">this</a>, which is sort of dead (I think). The board was bought from a second-hand market, with schematic pdf.</p> <p>The following is a picture of that part of the board. The LEDs is not populated, and I soldered 4 pins (using as GPIOs instead).</p> <p><a href="https://i.stack.imgur.com/Hkw33.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hkw33.png" alt="board picture" /></a></p>
What's the purpose of the highlighted part in the LED circuit?
2023-12-23T12:17:43.847
695225
|microcontroller|microchip|poe|
<p>Gigabit ethernet uses 4 pairs, 10/100 ethernet uses just 2 pairs.</p> <p>You transformer is designed for the former, whilst the phy is the latter.</p> <p>I believe you just need to connect the two pairs for 10/100, and all should be good.</p>
<p>I am currently working on my diploma thesis and since circuit construction is not the main topic, I am unfortunately not making any progress. I would like to connect the PIC18F97J60-IPT with PoE. I have assembled the PoE splitter from data sheets. My question now is how do I connect the PIC18 to the Pulse Transformer, as the PIC only has 4 pins (73,74, 77, 78) but the <a href="https://productfinder.pulseelectronics.com/api/open/part-attachments/datasheet/H6062NL" rel="nofollow noreferrer">H6062NL</a> has 8 pins?</p> <p><a href="https://i.stack.imgur.com/7SXF6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7SXF6.png" alt="Schematics" /></a></p>
Connecting Ethernet to PIC18F97J60
2023-12-23T13:17:24.833
695234
|battery-charging|dc|automotive|
<p>The car and charger talk together via wires separate from the high voltage ones. Here's an example with CHAdeMO:</p> <p><a href="https://i.stack.imgur.com/Oy5Vf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Oy5Vf.png" alt="enter image description here" /></a></p> <p>(<a href="https://www.researchgate.net/publication/319162700_Rapid_EV_Chargers_Implementation_of_a_Charger" rel="nofollow noreferrer">source with lots more info</a>)</p> <p>The charger is a voltage-limited DC current source (CC-CV), and the car tells it how much current it needs to output and what maximum voltage it should output.</p> <p>As a current source, it doesn't set its own output voltage: the output voltage of a current source is always set by the load which takes the current. In this case, the battery sets the voltage.</p> <p>However the charger has various safeties including output voltage limits, which are set to values sent by the car. If voltage goes out of bounds the charger will react appropriately, for example by lowering current or just stopping the charge.</p>
<p>As far as I know different chemistry batteries require different stages of charging.</p> <p>How are DC fast chargers able to charge any battery chemistry?</p> <p>Furthermore, there are the 400V and 800V standard battery voltages, but there can be pretty much any voltage a given car battery might have, how does the charger know at what voltage to charge?</p>
How are DC fast (rapid) chargers able to charge different chemistries?
2023-12-23T17:06:35.623
695241
|transistors|
<p>It is true that the ideal transistor (bipolar junction transistor) has emitter current well described by the familiar diode equation. It is also true that typical collector current will be within one or two percent of the emitter current, in normal (non-saturated) operation.</p> <p>When using a three-terminal transistor as an amplifier with emitter common, the emitter is nominally at a ground potential, which implies that the 'output' current is the collector current, and thus, a useful model of the amplifier must yield a collector-current result.</p> <p>Because we can assume non saturation, and small base current, the collector current thus is approximately <span class="math-container">$$ I_c \simeq I_e = I_{sat} e^{{V_{be} \over{kT} }}$$</span></p>
<p>Shouldn't the Is * e^(Vbe/Vt) formula apply to the emitter current and not the collector current seeing as that junction is forward biased?</p>
Why does the collector current formula in an NPN transistor depend on the base emitter voltage?
2023-12-23T19:54:12.287
695243
|grounding|
<p>You're worried about gound loops, the ungrounded isolated power supplies used by the Raspberry pi and the NAS will prevent ground loops by that path.</p> <p>Connecting both the USB and the DC to the arduino probably connect them together, but this will not be problematic, because the raspberry pi supply breaks the loop.</p> <p>Connecting the NAS to the raspbeery pi via ethernet will not be a problem because ethernet includes transformer isolation.</p> <p>If you're only measuring voltage with the arduino you might be better off with something like INA231 which doesn't need a separate power supply, will give a more precise reading, and can also measure current.</p>
<p>Apologies for the &quot;sort of schematic&quot; made up of symbols and larger components:</p> <p><a href="https://i.stack.imgur.com/w5iOw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w5iOw.png" alt="Example Circuit" /></a></p> <p>I'm new to drawing schematics. What I really wanted to draw was a set of connections between assemblies, not basic circuit components.</p> <p>I have a working DIY UPS. On the output side, I'm powering a bunch of devices from a 12V battery bank -&gt; inverter -&gt; AC/DC wall bricks or possibly internal DC PSUs.</p> <p>I'm also using a SparkFun Pro Micro powered directly from the battery bank so that I can use it to sense the DC voltage of the battery (I didn't show the voltage divider in the &quot;schematic&quot;, but it's there.) In order to get accurate voltage readings, I need the Pro Micro's GND to be the same as the AGM battery, but the point of the Pro Micro is it uses a USB connection to report data back to some of the devices that are being powered by the inverter. So, those grounds are not the same.</p> <p>Can I tie these grounds together? Should I? Measuring with a DMM, I've seen no more than 0.5V difference between those two GNDs.</p> <p>Note that the AC GND from the inverter isn't connected to anything in my example because the wall bricks are a two prong style, but some of the things in &quot;NAS or Other equip&quot; does use a three prong plug to an internal PSU.</p>
Can or should I tie wall brick ground to battery ground?
2023-12-23T20:14:36.533
695245
|circuit-design|diodes|
<p>The diodes D32 and D33 are used in the rectification part of the power supply, so rectifier diodes would be appropriate.</p> <p>For a drum machine, I doubt if the current exceeeds 1 A, so 1N4004 diodes should work fine. (That's a commonly-available diode, usually cheaper than the 50 V 1N4001.)</p> <p>Assuming that the current draw on the output rails is not large (because of the 1.8 Ω resistor), then Z1 would be calculated from the desired output voltage (17 V) plus the <span class="math-container">\$V_{BE}\$</span> value of transistor Q63, call it 0.7 V, so something close to a 17.7 V Zener diode would be needed. I can't find that exact Zener voltage, but, as kindly pointed out by Dave Tweed in a <a href="https://electronics.stackexchange.com/questions/695245/choosing-the-correct-diodes/695246?noredirect=1#comment1851068_695246">comment</a>, an 18 V Zener diode such as a 1N5248 would be appropriate. The 17 V rail probably doesn't need to be very exact, there will be a (current-dependent) voltage drop due to the 1.8 Ω resistor, and there will not be a lot of current through that diode, so a 500 mW rating should be good.</p> <p>For Z2, a 6 V 500 mW Zener diode should be fine.</p> <p>N.B.: I am not an electronics engineer, I only dabble.</p>
<p>I want some guidance on which diodes (circled in red) would be appropriate to substitute on this drum machine from the 1960s.</p> <p>Fuse is 0.5 AMP, the scan didn't catch the &quot;.&quot;</p> <p>All resistors are 1/2 Watt rated</p> <p>Q63 is P-3139 Solitron TO-3 MOS-fet transistor 60V 15A</p> <p><a href="https://i.stack.imgur.com/rV7zB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rV7zB.png" alt="Schematic" /></a></p>
Choosing the correct diodes
2023-12-23T20:35:40.000
695252
|stm32|cortex-m|rust|
<p>You have stuff on your ADC that shouldn't be there. There seem to be different versions of STM32 black pill online, I don't see any schematic in your datasheet so I'll just use <a href="https://stm32-base.org/assets/pdf/boards/original-schematic-STM32F411CEU6_WeAct_Black_Pill_V2.0.pdf" rel="nofollow noreferrer">this one</a>.</p> <p><a href="https://i.stack.imgur.com/37mIy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/37mIy.png" alt="enter image description here" /></a></p> <p>There are several ways noise can get into your ADC, for example:</p> <ul> <li><p>Noise is added to the signal being sampled.</p> </li> <li><p>Noise on ADC voltage reference.</p> </li> <li><p>Contamination of ADC power supply or clock</p> </li> <li><p>User error (different reference voltage used for ADC and a ratiometric output sensor)</p> </li> </ul> <p>The point is that these all behave differently, so you can get information about the issue by observing ADC results.</p> <p>ADC output is (Input Voltage)/(Reference Voltage).</p> <p>So the first thing you should do is make a setup where you can reproduce the problem (looks like you did). Then locate VDDA/VREF+ and VSSA/VREF- on your board. Unfortunately they are not on the connector pins, but there is a convenient cap C12 which decouples VDDA so you can solder two bits of resistor legs on it, now you have access.</p> <p>Now you can put a trimpot like 1kOhm, or just solder two resistors to make a voltage divider. Ratio should be about 1:10.</p> <ul> <li><p>Short the ADC input to VSSA</p> </li> <li><p>Short the ADC input to VREF</p> </li> <li><p>Use the voltage divider to input VREF*0.1 into the ADC</p> </li> <li><p>Flip the voltage divider around to input VREF*0.9 into the ADC</p> </li> </ul> <p>Meanwhile, keep the source of the problem running (ie, the PWM timer). What we're interested in is the difference in ADC reading in the four above cases between PWM ON and PWM OFF. Normally the difference should be zero.</p> <p>How to interpret the results:</p> <p>All these tests feed the ADC with an input voltage that is proportional to VREF, so they ignore noise on VREF. If you still get noise on your readings, then the issue is not noise on VREF, but injection into your ADC input or internal crosstalk in the MCU. You can try other ADC inputs and compare. For example, after removing the phototransistor and pullup, if noise occurs on that ADC input but not on other inputs, suspect coupling into the trace.</p> <p>Most likely your readings will be clean.</p> <p>Next test: use ADC to acquire a stable voltage, like from a 1.5V AA cell. If your ADC readings are noisy while the input voltage is stable, it means the ADC reference voltage is noisy.</p> <p>Because ADC output is (Input Voltage)/(Reference Voltage), noise on VREF manifests in ADC readings as roughly proportional to input voltage. Whereas noise added to the input is always the same no matter what the input voltage is. A good test is to vary the ADC input voltage (for example add another AA cell in series so you get 3V) and check if the noise is the same, or doubled.</p> <p>Since the ADC reference is the supply voltage on that board, I'd expect it to be noisy: in this case you need to remove ferrite bead L1 and put a separate LDO or reference chip for your VREF.</p> <p>Other stuff to consider:</p> <p>Maybe the PWM controls something that influences your sensor reading. For example the PWM turns on something that uses power, which drops supply voltage, and your sensor has very low PSRR (ie, phototransistor and pullup). Or the PWM blinks a LED and the sensor is a phototransistor. This will be apparent by checking the sensor output with a scope.</p> <p>Note a phototransistor with pull resistor has a much higher PSRR if the phototransistor is on top with pulldown resistor. This is because the phototransistor behaves as a current source, and the resistor turns the output current into a voltage referenced to either GND (pulldown) or VCC (pullup).</p> <p>Also if your phototransistor uses a pullup from VCC and not VREF, which is probably the case since the board has no VREF pin... or you use any ratiometric sensor whose output is proportional to VCC... then what you're doing is measuring VCC using the ADC's VREF. If these voltages are not equal, and they are not because there's a filter on VREF, then your ADC readings will be contaminated by (VCC-VREF) noise. Basically all sensors whose output depends on supply voltage need to be powered from ADC VREF. It is possible to use another clean supply from another LDO, but due to tolerances and drift this introduces a measurement error. Whereas if your sensor is a resistive divider between VREF and GND, the ADC will get an accurate resistor ratio no matter what VREF actually is.</p>
<p>I'm building a firmware to capture very short burst signals through the ADC on a STM32F401CC (Black Pill board).</p> <p>I have a 100 Hz PWM output running on a different GPIO group</p> <p>The ADC readout gets offset for about 1 ms every time the PWM timer channel fires. Since this is extremely hard to debug, I've added a signal graph directly on device - here's an example:</p> <p><a href="https://i.stack.imgur.com/RPDWs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RPDWs.jpg" alt="enter image description here" /></a></p> <p>There's 17ms of ADC data between the two Xs, and the voltage range is around 0.3-2V. The distance between the notches changes as I change the PWM timer frequency.</p> <p>Here's a shorter signal, &quot;zoomed in&quot;:</p> <p><a href="https://i.stack.imgur.com/dXATz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dXATz.jpg" alt="enter image description here" /></a></p> <p>Things I've already tried:</p> <ul> <li>A different power supply</li> <li>Disabling any non strictly necessary interrupt handlers</li> <li>Lowering ADC sample rate</li> <li>Sampling ADC for more cycles</li> <li>Changing ADC clock</li> <li>Scaling input level</li> <li>Errata workarounds for ADC precision</li> </ul> <p>The input is a pulled-down SFH309FA phototransistor on the A0 pin.</p> <p>I'm using Rust/RTIC with the following ADC configuration:</p> <pre class="lang-rust prettyprint-override"><code>let adc_pin = gpioa.pa0.into_analog(); let adc_config = AdcConfig::default() .dma(Dma::Continuous) .scan(Scan::Disabled) .clock(Clock::Pclk2_div_6) .resolution(Resolution::Twelve); let mut adc = Adc::adc1(dp.ADC1, true, adc_config); adc.configure_channel(&amp;adc_pin, Sequence::One, SampleTime::Cycles_3); </code></pre> <p>DMA Configuration:</p> <pre class="lang-rust prettyprint-override"><code>let dma = StreamsTuple::new(dp.DMA2); let dma_config = DmaConfig::default() .transfer_complete_interrupt(true) .double_buffer(false); let transfer = Transfer::init_peripheral_to_memory( dma.0, adc, cx.local.first_buffer, None, dma_config, ); </code></pre> <p>Timer:</p> <pre class="lang-rust prettyprint-override"><code>let mut timer = dp.TIM2.counter_hz(&amp;clocks); timer.listen(Event::Update); timer.start(50_000.Hz()).unwrap(); </code></pre> <p>Timer handler:</p> <pre class="lang-rust prettyprint-override"><code>#[task(binds = TIM2, shared = [transfer], local = [timer])] fn adcstart(mut cx: adcstart::Context) { cx.shared.transfer.lock(|transfer| { transfer.start(|adc| { adc.start_conversion(); }); }); cx.local.timer.clear_flags(Flag::Update); } </code></pre> <p>DMA completion interrupt handler:</p> <pre class="lang-rust prettyprint-override"><code>#[task(binds = DMA2_STREAM0, shared = [transfer, adc_value, sample_counter, calibration_state, measurement], local = [adc_dma_buffer], priority = 3)] fn dma(ctx: dma::Context) { let mut shared = ctx.shared; let local = ctx.local; let last_adc_dma_buffer = shared.transfer.lock(|transfer| { let (last_adc_dma_buffer, _) = transfer .next_transfer(local.adc_dma_buffer.take().unwrap()) .unwrap(); last_adc_dma_buffer }); let value = *last_adc_dma_buffer; *local.adc_dma_buffer = Some(last_adc_dma_buffer); //....store value } </code></pre> <p>PWM setup:</p> <pre class="lang-rust prettyprint-override"><code> let mut pwm = dp .TIM4 .pwm_hz(hal::timer::Channel4::new(gpiob.pb9), 200.Hz(), &amp;clocks); pwm.enable(hal::timer::Channel::C4); pwm.set_duty(hal::timer::Channel::C4, 0); </code></pre> <p>The entire project is available at <a href="https://github.com/eugeny/shutterspeed2" rel="nofollow noreferrer">https://github.com/eugeny/shutterspeed2</a></p> <p>I'm just starting out with embedded and would appreciate any pointers.</p>
STM32F401 / Black Pill - PWM timer causes periodic ADC offset
2023-12-23T22:24:30.847
695262
|identification|symbol|
<p>That's a comparator.</p> <p>When the input exceeds the reference voltage the output switches high and vice versa.</p>
<p>What is this symbol and what it does? It looks like the Op-Amp on the left, but I don't get what that half square wave is doing on it.</p> <p><a href="https://i.stack.imgur.com/es7sM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/es7sM.png" alt="enter image description here" /></a></p> <p>This diagram was obtained from this paper:</p> <pre><code>@article{CamuasMesa2019, title = {Neuromorphic Spiking Neural Networks and Their Memristor-CMOS Hardware Implementations}, volume = {12}, ISSN = {1996-1944}, url = {http://dx.doi.org/10.3390/ma12172745}, DOI = {10.3390/ma12172745}, number = {17}, journal = {Materials}, publisher = {MDPI AG}, author = {Camuñas-Mesa, Luis and Linares-Barranco, Bernabé and Serrano-Gotarredona, Teresa}, year = {2019}, month = aug, pages = {2745} } </code></pre>
Identifying symbol similar to opamp
2023-12-24T01:09:59.573
695284
|generator|synchronous-motor|
<p>The DC input is 'small'. It is unrelated to the output. It is related to the quality of mechanical construction, particularly the size of the air-gap (smaller is better).</p> <p>In an ideal generator with superconducting rotor windings, the current would be zero.</p> <p>In a well-constructed generator, the excitation power should be only a few percent at most of the rated output power.</p>
<p>In a synchronous generator we want to convert mechanical to electrical power but the thing that confuses me is that we also use electrical input as dc current which goes through rotor windings to make our rotor magnetic field. I couldn’t find a ratio of electrical input power to mechanical input power. Is this small? And can we make this electrical input small and make mechanical bigger? So overall we have converted more mechanical to electrical?</p>
Ratio of electrical input to mechanical input in a synchronous generator
2023-12-24T09:11:01.073
695296
|low-power|vlsi|
<p>The clue is:</p> <blockquote> <p>When the block goes to sleep, the header switch turns off allowing <span class="math-container">\$V_{DDV}\$</span> to float and gradually sink to 0.</p> </blockquote> <p>The capacitance associated with <span class="math-container">\$V_{DDV}\$</span> must discharge. This allows the inputs to the gated block's output transistors to decrease slowly through the linear region of these transistors causing the ouputs to become unpredictable, capable of momentarily taking on any value even in the forbidden region defined by CMOS logic threshhold voltages. <strike>Eventually V_{DDV} will be low enough to bring the outputs to a known value (0V).</strike></p> <p>More correctly, allowing VDDV to become 0V removes all VGS bias from the power-gated block. This will force the outputs into a high-impedance state (floating) while sleeping.</p> <p>This will in turn cause connected downstream logic to be unpredictable.</p> <p>Placing the AND logic (powered by <span class="math-container">\$V_{DD}\$</span>) in between will force the ouputs to zero when SLEEP is asserted, allowing <span class="math-container">\$V_{DDV}\$</span> to go to zero slowly and the power-gated block to remain with high impedance outputs.</p>
<p>In their <em>CMOS VLSI Design</em>, Weste and Harris give the following discussion of power gating a block of logic:</p> <p><a href="https://i.stack.imgur.com/HyhOh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HyhOh.png" alt="enter image description here" /></a></p> <p>I am in particular interested in understanding the need for output isolation here. Is the concern that, without these isolation AND gates (which, when the block is put to sleep, output solid 0s because <span class="math-container">\$\overline{Sleep} = 0\$</span>), the outputs might float around and so drive switching events in downstream logic from this gated block? I am hoping for an explanation of what might go wrong if those ANDs weren't there.</p>
Why do we need output isolation for power-gated blocks?
2023-12-24T13:42:14.280
695317
|ltspice|simulation|differential-amplifier|
<p>You have a wire shorting the inputs from the positive and negative sources in your circuit:</p> <p><a href="https://i.stack.imgur.com/jCP1E.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jCP1E.png" alt="enter image description here" /></a></p> <p>Since both sources <code>Vin+</code> and <code>Vin-</code> are driving the circuit through identical 10 uF capacitors, the voltage signal at the gate node (the node connected to the gates of M1 and M2) is going to have essentially 0 amplitude, and therefore the sources are not going to affect the circuit at all. So it's no surprise there's no response at <code>Vout</code>.</p>
<p>The following is my schematic for active current mirror:</p> <p><a href="https://i.stack.imgur.com/4lXZy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4lXZy.png" alt="enter image description here" /></a></p> <p>This is a SPICE simulation for my <a href="https://electronics.stackexchange.com/questions/695015/g-m-is-zero-in-my-calculation-when-doing-gain-analysis-what-went-wrong">old question</a>:</p> <p>The following is the <span class="math-container">\$V_{out}\$</span> plot.</p> <p><a href="https://i.stack.imgur.com/XR0QM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XR0QM.png" alt="enter image description here" /></a></p> <p>What's wrong with my <span class="math-container">\$V_{out}\$</span>?</p> <p>The asc file is provide here:</p> <pre><code>* G:\LTspice\Active_current_mirror_Amplifier.asc I1 N007 0 100µ V1 N001 0 5 Vin+ N004 0 SINE(0 10m 1Meg) Vin- N006 0 SINE(0 -10m 1Meg) AC 1 C2 N003 Vout 10µ M1 N001 N005 N007 0 NMOS l=1u w=176u M2 N003 N005 N007 0 NMOS l=1u w=176u M3 N001 N002 N003 N001 PMOS l=10u w=10u M4 N001 N002 N002 N001 PMOS l=10u w=10u I2 N002 0 50µ R1 N001 N005 8Meg R2 N005 0 2Meg C1 N005 N004 10µ C3 N006 N005 10µ .model NMOS NMOS .model PMOS PMOS .lib C:\Users\jackh\Documents\LTspiceXVII\lib\cmp\standard.mos .tran 0 1000u 990u 10m .MODEL nmos nmos(kp=200u,vto=0.4, lambda = 0.1) .MODEL pmos pmos(kp=200u,vto=-0.4, lambda =0.05) ;.op ;.ac lin 1000 1 1Meg .meas Vo pp V(vout); .meas Vi pp V(n004) - V(n005); .meas Av param Vo/Vi .backanno .end </code></pre>
Failed to simulate active current mirror in LTspice
2023-12-24T20:09:09.447
695320
|stm32|nucleo|
<p>The <a href="https://www.st.com/en/evaluation-tools/nucleo-f207zg.html#cad-resources" rel="noreferrer">schematics</a> for this board show that the <code>VDD</code> net is connected to <code>+3V3</code> via JP5, so unless you've removed that link to provide another supply, we can assume that <code>VDD=+3.3v</code>.</p> <p>As you mention, the number of wait states depends on the core frequency, and voltage at VDD.</p> <p>The <a href="https://www.st.com/en/microcontrollers-microprocessors/stm32f207zg.html#" rel="noreferrer">datasheet</a> for the part states that for &quot;<em>VDD=2.7 to 3.6V</em>&quot;, you can access the flash at up to 30 MHz with 0 wait states, increasing to 3 wait states at ~90MHz or above.</p> <p>I've included Figure 21 from the datasheet below, but Table 15 is also relevant.</p> <p><img src="https://i.stack.imgur.com/Y93SO.png" alt="a graph showing the number of wait states vs the core frequency and voltage at VDD" /></p>
<p>I need to change the wait states via the Flash access control register for an STM32F207ZG on a NUCLEO-F207ZG board.</p> <p>The reference manual gives a table that tells you how many wait states you need based on the clock frequency of the cortex M3 in MHz and the 'supply voltage of the device'. But how do I determine the correct voltage range?? The voltage ranges given are &quot;2.7 to 3.6&quot;, &quot;2.4 to 2.7&quot;, &quot;2.1 to 2.4&quot; and &quot;1.8 to 2.1 V. The supply voltage to the board is 5V over Usb but that is not mentioned in the table. I assume the board drops some voltage to step it down to what the stm32 chip requires. However I can't find any mention of what that voltage is and so I'm at a complete loss as to which voltage range I need to select.</p>
NUCLEO-F207ZG / STM32F207ZG supply voltage
2023-12-24T21:11:09.107
695326
|transistors|mosfet|
<p>Thanks to some very sharp-eyed geniuses, @Transistor and @TimWilliams, who questioned if Q1 was 2N2222A or P2N222A, I realized that I was using 2N2222A but referencing the datasheet for P2N222A.</p> <p>The correct <a href="https://datasheet.lcsc.com/lcsc/1809200018_ST-Semtech-2N2222A_C118536.pdf" rel="nofollow noreferrer">datasheet</a> for 2N2222A, shows that the pin arrangement is opposite that of P2N222A. After flipping Q1 around to correct the connections, the circuit works beautifully and as expected.</p>
<p>Clearly I am having trouble understanding transistors and MOSFETs, and their datasheets.</p> <p><img src="https://i.stack.imgur.com/BQpyn.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fBQpyn.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p> <p>I am using an ESP32's GPIO (3.3V at 40mA) to control an NPN transistor (<a href="https://www.onsemi.com/pdf/datasheet/p2n2222a-d.pdf" rel="nofollow noreferrer">2N2222</a>) which, in turn, controls two P-channel MOSFETs (<a href="https://www.infineon.com/dgdl/Infineon-IRF4905-DataSheet-v01_01-EN.pdf?fileId=5546d462533600a4015355e329b1197e" rel="nofollow noreferrer">IRF4905</a>). For now, V1 is provided by a 12V/3A brick and V2 is pulled from the 5V of the USB powering the ESP32. All the negatives are tied together.</p> <p>When the GPIO is HIGH, I expect the gate voltage to be near zero which the simulation and my probe confirm is happening. I expect M1 to have <code>V<sub>gs</sub> = 0 - 12.25 = -12.25V</code> and M2 to have <code>V<sub>gs</sub> = 0 - 5.2 = -5.2V</code>, resulting in both being ON since both are less that -4V.</p> <p>When the GPIO is LOW, I expect the gate voltage to be 12.25V so M1 can experience <code>V<sub>gs</sub> = 12.25 - 12.25 = 0V</code> and M2, <code>V<sub>gs</sub> = 12.25 - 5.2 = 7.05V</code>. Since both are greater than -2V, I expect both the MOSFETs to be OFF; the simulation corroborates that.</p> <p>However, in practice, when the GPIO is LOW, neither of the MOSFETs are going OFF. Probing the voltage between the gate and the ground, I get 8.92V (without the Peltier and the fan connected). If my voltmeter had an internal resistance of 3M ohms, that would make sense but I used a 1M ohms resister in series with the voltmeter and that told me it had an internal resistance of nearly 12M ohms. So in reality, the gate was sitting at 9.67V.</p> <p>A. I am having a hard time explaining the 9.67V when I expected 12.25V. What could be causing that and how do I solve it?</p> <p>B. Even if I accept that 9.67V is the actual voltage at the gate, I expect M2 to have <code>V<sub>gs</sub> = 9.67 - 5.2 = 4.47V</code> which is greater than -2V. I expect M2 to be OFF and am having a hard time explaining why it is not.</p> <p>My goal is <em>not</em> to make the best possible circuit for controlling the Peltier and fan. I am trying to learn about transistors and MOSFETs by making &quot;something&quot; that helps me understand them. I would be grateful for any tips and pointers.</p> <hr /> <p><strong>Update:</strong> Thanks to @Transistor and @TimWilliams, I learned that P2N2222A and 2N2222A are not the same and at the very least, they have different pin layouts. After flipping Q1 around in my circuit, everything works beautifully; finally now, the world makes sense!</p>
Dual high-side switch is not shutting off as expected
2023-12-25T01:35:27.627
695344
|batteries|battery-charging|dc-dc-converter|lithium-ion|lithium|
<p>The guy in the video starts with one of the many garbage <a href="https://k6jca.blogspot.com/2018/02/counterfeit-lm2596-regulator-boards.html" rel="nofollow noreferrer">counterfeit LM2596</a> modules, so I haven't watched further.</p> <p>Lithium battery chargers usually work on the CC-CV principle, which means &quot;Constant Current then Constant Voltage&quot; (<a href="https://www.engineering.com/story/battery-management-systemspart-3-battery-charging-methods" rel="nofollow noreferrer">pic source</a>).</p> <p><a href="https://i.stack.imgur.com/H9y0E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H9y0E.png" alt="enter image description here" /></a></p> <p>In order to do that you need a power supply with two accurate feedback paths: one for voltage and one for current, both being able to limit the output.</p> <p>It can be implemented in many ways, for example AC-DC switching converter, DC-DC converter, linear, etc. The important thing is that it has an I-V output characteristic like this black curve: constant current over the whole charging voltage range, and it keeps working at reduced current once the limit voltage is reached.</p> <p>Another important characteristic for a charger is that it should accept being connected to a battery, which means not drawing reverse current, for example.</p> <p><a href="https://i.stack.imgur.com/cnlpS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cnlpS.png" alt="enter image description here" /></a></p> <p>If you pick a random voltage output DC-DC converter, most likely it will have features not suitable for charging, for example:</p> <ul> <li><p>Foldback current limiting (red curve above) or other means of current limiting like shutting down or going into intermittent mode (hiccup), which means it can't act as a constant current source at all.</p> </li> <li><p>Not designed to be connected to a battery. For example, if output voltage is higher than input voltage, a DC-DC buck converter will let current flow in the reverse direction through the top MOSFET body diode and send power to its input. Whether that's a problem depends on the circuit...</p> </li> <li><p>It expects to startup into a capacitive load at 0V, usually with slow-start, so it will ramp up its output voltage. If the DC-DC is a synchronous buck, and the load is a battery, it may attempt to do stupid things like think output voltage is too high during startup and try to bring it down, which would be rather suicidal.</p> </li> <li><p>If it's a voltage output DC-DC then the current limit is usually not accurate: as long as it protects the chip, it does the job, so the manufacturer won't spend extra production cost to make it accurate. Sometimes you have no way to set it, it's internal to the chip and set to the absolute maximum current the chip will tolerate. Using it as a constant current source means the chip will operate at its maximum power during most of the charge, without any derating, so it may overheat or run at lower efficiency.</p> </li> </ul> <blockquote> <p>The question here is that, will the DC converter output constant 2 amps even when the battery pack reaches its fully charged voltage of 42 V?</p> </blockquote> <p>That depends which DC-DC converter you've got, so it's impossible to answer in a generic way.</p> <p>If your DCDC was designed with the intent to be used as a battery charger, with accurate voltage and current feedback paths, it'll probably work as a charger, LED driver, and generic DC-DC converter. Otherwise, maybe, maybe not. It most likely won't be optimal.</p> <p>Regarding DC-DC converter chips, if the current limit feature is intended to make a constant current source, it is usually clearly specified in the datasheet along with the expected accuracy and how to set it.</p> <p>For constant current chips, usually sold as &quot;LED drivers&quot;, it's the opposite: you get accurate current regulation, but inaccurate voltage. The output overvoltage protection's job is to protect the chip in case the load is disconnected: in this case there is no need for accuracy on the output voltage.</p> <p>So why don't all DC-DC chips have a CC-CV mode? First, it costs extra. Then it also has disadvantages: for example if the load is not a battery but some electronics, constant current limiting is not desirable. If a chip dies and draws too much current, foldback or hiccup current limit protects the power supply while not feeding much power into output. Constant current on the other hand would keep feeding the maximum current into the shorted chip, with no limit to thermal dissipation, resulting in fire hazard or non-repairable damage to the board.</p> <p>So DC-DC chips with a usable CC-CV mode are a minority.</p> <p>Also if you have several cells in series, a proper charger would monitor the voltage on each, perhaps do the balancing itself or let the BMS do it.</p>
<p>There's a lot of DIYs that utilize DC/DC converters to charge Lithium batteries. A quick Youtube search shows dozens of these DIYs. I was wondering how these home-made chargers work. Yes, DC/DC converters do provide constant voltage and constant current, but the mechanism of battery chargers isn't exactly the same? A typical charger would provide enough voltage and current to a battery to raise the voltage of the battery being charged and as the battery's voltage stabilizes, the charger would decrease the current.</p> <p>For example:</p> <p>Let's say we have a 10s 10 Ah Li-ion battery pack with a nominal voltage of 37 V and full charge voltage of 42 V. Now, charging this pack using DC/DC converter that could supply constant voltage of 42 V and let's assume we charge the battery at 0.2C which means 2 amps. Since the pack is receiving constant current of 2 amps, the pack's voltage will increase steadily until it reaches 42 V. The question here is that, will the DC converter output constant 2 amps <em>even</em> when the battery pack reaches its fully charged voltage of 42 V? If so, how these people are able to charge their batteries without running into big bangs or some kind of troubles? Normally a lithium battery charger starts with a constant current supply to the battery and then as the battery reaches its full charge voltage, the charger detects the battery's voltage and adjusts the current until the battery's voltage stabilizes.</p> <p>Example of such DIYs:</p> <p><a href="https://www.youtube.com/watch?v=ZBf_qXEYUoM" rel="nofollow noreferrer">How to Charge Lithium Batteries</a></p>
How do DC/DC converters work as lithium battery chargers?
2023-12-25T11:59:01.777
695353
|digital-logic|simulation|vhdl|questasim|
<p>The scope of <code>library</code> and <code>use</code> extends only until the end of the current design unit, which is the <code>entity</code> declaration. If you add an <code>architecture</code> for the same <code>entity</code>, you can also use the imported names there, because these are visible through the <code>entity</code>.</p> <p>The <code>package</code> is its own design unit though, and needs its own set of <code>library</code> and <code>use</code> clauses. Typically, that is done at the beginning of a separate file.</p>
<p>I am relatively new to VHDL, and I am getting the errors below although I used the same procedure before:</p> <pre><code>vcom -work work -2002 -explicit -vopt -stats=none Questa Intel Starter FPGA Edition-64 vcom 2021.2 Compiler 2021.04 Apr 14 2021 -- Loading package STANDARD -- Loading package TEXTIO -- Loading package std_logic_1164 -- Loading package NUMERIC_STD -- Loading package MATH_REAL -- Loading package std_logic_arith -- Loading package STD_LOGIC_UNSIGNED -- Compiling entity testbench_pack -- Compiling package testbench_package ** Error: (vcom-1136) Unknown identifier &quot;std_logic&quot;. ** Error: (vcom-1136) Unknown identifier &quot;std_logic&quot;. ** Error: (vcom-1136) Unknown identifier &quot;std_logic_vector&quot;. ** Error: (vcom-1136) Unknown identifier &quot;std_logic_vector&quot;. ** Note: VHDL Compiler exiting </code></pre> <p>The code:</p> <pre><code>library IEEE; use IEEE.std_logic_1164.all; use ieee.numeric_std.all; use ieee.math_real.all; use ieee.STD_LOGIC_ARITH.ALL; use ieee.STD_LOGIC_UNSIGNED.ALL; entity testbench_pack is end testbench_pack; package testbench_package is procedure assert_floor_and_door( constant clock : in std_logic; constant reset : in std_logic; variable floor : in std_logic_vector(2 downto 0); variable door : in std_logic_vector(1 downto 0) ); end package testbench_package; package body testbench_package is procedure assert_floor_and_door( constant clock : in std_logic; constant reset : in std_logic; variable floor : in std_logic_vector(2 downto 0); variable door : in std_logic_vector(1 downto 0) ) is variable door_s_int : natural; variable floor_int : natural; begin -- Procedure code here... -- Convert door to integer door_s_int := to_integer(unsigned(door)); -- Convert floor to integer floor_int := to_integer(unsigned(floor)); -- Assertion for floor value assert floor_int &gt;= 0 and floor_int &lt;= 7 report &quot;Assertion failed for floor value: &quot; &amp; integer'image(floor_int) severity failure; -- Assertion for door value assert door_s_int &gt;= 0 and door_s_int &lt;= 3 report &quot;Assertion failed for door value: &quot; &amp; integer'image(door_s_int) severity failure; end procedure; end package body testbench_package; architecture Behavioral of testbench_pack is signal s_clock : std_logic := '0'; signal s_reset : std_logic := '0'; signal s_floor : std_logic_vector(2 downto 0) := &quot;000&quot;; signal s_door : std_logic_vector(1 downto 0) := &quot;00&quot;; begin process begin wait for 5 ns; s_reset &lt;= '1'; wait for 10 ns; s_reset &lt;= '0'; wait; end process; process begin wait for 2 ns; s_clock &lt;= not s_clock; wait for 2 ns; end process; process begin wait for 20 ns; s_floor &lt;= &quot;001&quot;; s_door &lt;= &quot;01&quot;; wait for 10 ns; s_floor &lt;= &quot;010&quot;; s_door &lt;= &quot;10&quot;; wait for 10 ns; s_floor &lt;= &quot;111&quot;; s_door &lt;= &quot;11&quot;; wait; end process; process begin wait for 5 ns; testbench_package.assert_floor_and_door(s_clock, s_reset, s_floor, s_door); wait; end process; end Behavioral; </code></pre>
(vcom-1136) Unknown identifier "std_logic" & "std_logic_vector"
2023-12-25T13:40:57.417
695375
|voltage-regulator|zener|
<blockquote> <p>The FET gate is driven directly by 30V power bus.</p> </blockquote> <p>It's pretty rare to see FETs with Vgs rated for this, usually they spec 20V max...</p> <p>Your gate driver may push 2.5A into the gate, but only during switching. Say your FET has Qg=100nC gate charge (already a large FET) and you switch at F=20kHz, then it's going to use Qg*F=0.002 Coulombs/s, or an average current of only 2mA. You should do the calculation with your circuit parameters, that will give the dissipation in the regulator powering the driver.</p> <p>Even if average current is low, the driver should not be powered directly from the output of your voltage reference, because the current spikes will cause a lot of ripple and destroy its accuracy.</p> <p>Most of the gate current spike should come from the driver's decoupling capacitor, and the regulator (or transistor) should not attempt to provide the large current spikes directly, but instead keep the decoupling capacitor charged.</p> <p>For simplicity, you could keep your current 5V circuit and just use a <a href="https://www.ti.com/lit/ds/symlink/tps7a4101.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&amp;ts=1703538986065" rel="nofollow noreferrer">high voltage LDO</a> for your driver. Or a transistor plus Zener diode. You could also use a buck DC-DC converter, here's a <a href="https://www.diodes.com/assets/Datasheets/AP64060.pdf" rel="nofollow noreferrer">cheap one with idle current of only 90µA</a>.</p> <p>Low idle current DC-DC converters spend time in sleep mode then occasionally send a burst of power into the output, which causes ripple. In this case, accuracy of power supply voltage for the driver is irrelevant, it doesn't matter if there's ripple on it, the driver won't care, the MOSFET won't care as long as there's enough voltage get a solid Vgs to turn it on properly.</p> <p>No on your proposal of boosting the MAX reference chip with a transistor...</p> <p>In order to check stability with the output capacitor you need to know about the open loop gain and phase vs frequency for the voltage reference, and the datasheet doesn't mention it. It only has output impedance, but that can give hints about the open loop response.</p> <p>These reference chips are pretty slow, so the transient response is also going to be slow. If you use the transistor-boosted reference to power both the driver and your analog circuits, I'd expect ripple to be rather high, which means it makes no sense anymore to use an expensive, accurate, low drift reference. So I'm not enthusiastic about this option.</p> <p>Also you'd have to redo your 5V circuit with higher voltage parts which will probably use more idle power.</p> <p>I'd use either:</p> <ul> <li><p>Linear regulator or Transistor+zener to power the driver with about 15V, plus your current circuit</p> </li> <li><p>Or a low quiescent DC-DC to power the driver, then a capacitor multiplier (2 resistors, 10µF MLCC, MMBT3904) as a cheap way to filter this noisy 15V into clean 10V with good PSRR at high frequency... then your existing circuit.</p> </li> </ul> <p>This will also reduce idle power a bit, because the current 400µA idle power will come from the DC-DC, which should have more than 50% efficiency at this current. It also ensures the driver supply is up before the control circuits come up.</p>
<p>The title basically says it all. I wonder if I can use voltage reference like <a href="https://www.analog.com/media/en/technical-documentation/data-sheets/max6043.pdf" rel="nofollow noreferrer">MAX6043</a> with NPN BJT to get a simple two-component power source?</p> <p>For the context, I have a circuit that should draw very little (under 1 mA) power when idle but may need much more than that when active (for driving MOSFET gate). In the current version of the circuit I am using MAX6143 to power 5V comparators and provide 2.5V reference for them at the same time, with total quiescent current only 400uA. The FET gate is driven directly by 30V power bus.</p> <p>In the next version I'd like to try IGBT instead of MOSFET. But unfortunately the IGBTs typically have 20V gate limit. So the idea is to change all components to 15-16V and use that for driving the gate as well. I am thinking I can use MAX6043 to get very stable sub-mA reference, but add NPN BJT to it as current booster, sufficient for 2.5A rated gate driver.</p>
Can I replace resistor and zener with voltage reference in basic serial regulator?
2023-12-25T20:00:23.417
695377
|identification|surface-mount|
<p>It's impossible to say for sure with the current low resolution photo, but it could be a <a href="https://datasheet.lcsc.com/lcsc/2101181805_ROHM-Semicon-RB060L-40TE25_C919457.pdf" rel="nofollow noreferrer">ROHM RB060L-40</a> Schottky diode. SMA roughly matches with the given size and the similar diode marked &quot;34&quot; could be a <a href="https://datasheet.lcsc.com/lcsc/1810131711_ROHM-Semicon-RB160L-40TE25_C81484.pdf" rel="nofollow noreferrer">RB160L-40</a> from the same series.</p> <p><a href="https://i.stack.imgur.com/m3OGj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m3OGj.jpg" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/Yt2Ll.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yt2Ll.jpg" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/JnCOT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JnCOT.jpg" alt="There are 5 instances of the component in the photo." /></a></p> <p>I need help identifying a surface mount component:</p> <ol> <li><p>SMT package, black color, 2-terminal, gullwing longitudinal direction, LxWxH = 5x2.5x2 mm</p> </li> <li><p>markings are a stripe, then 36 on new line, then 27 on new line (another example is marked stripe newline 34 newline 25).</p> </li> </ol> <p>My guess is some sort of diode, but searching has yielded no result so far. Any ideas? I can't even find a known package type that fits this description. Package is bigger than an SOD323, for example.</p> <p>There are 5 instances of the component in the photo.</p>
identify SMT component: stripe 36 27
2023-12-25T20:34:06.460
695390
|operational-amplifier|
<p>If you use Thévenin equivalent of the R0,R1,R2 combination then you get</p> <p>Rt = R0 + R1R2/(R1+R2)</p> <p>Vt = (Vs*R2)/(R1+R2)</p> <p>Then Vt/Ve = -(Rt/R) and</p> <p>V2 = Vt*(R1+R2)/R2</p> <p>So <span class="math-container">\$\frac {V_S}{V_e} = -\frac {R_0(R_1/R_2 +1) + R_1}{R}\$</span></p>
<p>I'm trying to determine the relationship between the output voltage (Vs ) and the input voltage (Ve ) in an amplifier circuit with specific resistances. The circuit consists of an ideal operational amplifier and resistors i find this :</p> <p><span class="math-container">$$V_2=V_a⋅(1+R_3/R_4)+(V_a−V_b)⋅R_4(R_2+R_3)+R_2R_3R_1$$</span></p> <p>However, I'm uncertain about the correctness of this expression and would appreciate guidance on its accuracy or any possible mistakes in the calculation. Additionally, if there's a more efficient way to represent this relationship or if I've missed any considerations, I'd love to learn.</p> <p>Any insights or assistance in determining the correct relationship between</p> <p>Vs and Ve in this amplifier circuit would be greatly appreciated.</p> <p><a href="https://i.stack.imgur.com/2Uq2v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Uq2v.png" alt="circuit" /></a></p>
Calculating Vs ​ in an amplifier circuit as a function of Ve ​
2023-12-25T22:40:00.190
695393
|pcb|stm32|flash|st-link|
<p>If you always use ST-Link for code upload, you don't need a bootoader of any kind.</p> <p>However, you don't say which exact MCU you have, but if your MCU supports USB through the system bootloader, you might find it easier than to always use the ST-Link.</p> <p>Although the ST-Link allows you to debug code so put whatever interfaces you want.</p>
<p>I am designing a PCB with stm32f4 controller in it. I was designed arduino boards in my past. I am researching for STM32 flashing a code or bootload in datasheets. If I am not wrong with a only 4 pin (SWCLK, SWDIO, GND, 3V3) no extra component on PCB we can FLASH and Bootload our stm32 with a ST-LINK v2. I am trying the simple and small as possible because of the PCB placed on the small place. I see some writings say this MCUs are internally bootloaded. I was flash bootload on arduino MCUs with a help of external MCU. I guess don't need it on STMs. Can you guide me. Thank you.</p>
STM32 BOOTLOAD and FLASH
2023-12-25T22:50:38.450
695408
|fuses|light|plug|
<p>There is a tab/snap that has to be released by putting something like a screwdriver through that slot. The top part will then pop out. <a href="https://www.youtube.com/watch?app=desktop&amp;v=ITw_eWAQt84" rel="nofollow noreferrer">Here</a> is a (very blurry) video showing the procedure with a similar unfused male plug. If your screwdriver is too thick or otherwise not the right shape it may not work, so try another one. Looks like it's mashed up from using a fat screwdriver.</p> <p><a href="https://i.stack.imgur.com/ok26s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ok26s.png" alt="enter image description here" /></a></p> <p>If you blew the fuse by plugging something that drew too much current into the female end then you have nothing to worry about, just replace the fuse or fuses with the exact equivalent type and rating. Otherwise there might be a problem somewhere in the light set.</p>
<p>I'm trying to get to the fuse in this plug (pictured below) and it looks like I'm going to break it instead. All the videos and instructions I've found show a different plug that it is very easy to open (slide something and there are the fuses). I don't have the instructions for this light star. This plug is different. I tried to push the hole with a screw driver and the blades for 120VAC but nothing. Any marks you see were made by me. I tried from the top with no luck either. Any ideas how to get to the fuse?</p> <p><a href="https://i.stack.imgur.com/UX5ao.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UX5ao.jpg" alt="plug" /></a> <a href="https://i.stack.imgur.com/EqFa6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EqFa6.jpg" alt="star light" /></a></p>
How open this Christmas light plug to change fuse?
2023-12-26T06:10:08.567
695432
|mosfet|power-electronics|gate-driving|parasitic-capacitance|
<blockquote> <p><em>I want to know why the capacitance needs to be charged quickly</em></p> </blockquote> <p>If you don't charge the gate quickly then the voltage between gate and source (the important voltage for activating a MOSFET) <strong>must</strong> rise slowly. It comes down to the basic formula of a capacitor: -</p> <p><span class="math-container">$$I = C\dfrac{dv}{dt}$$</span></p> <p>If <span class="math-container">\$I\$</span> is small then <span class="math-container">\$\frac{dv}{dt}\$</span> must also be small i.e. the voltage between gate and source takes more time to reach a value that fully activates the MOSFET channel.</p> <blockquote> <p><em>...so that the gate can be opened by applying the gate voltage</em></p> </blockquote> <p>We don't say the &quot;gate is opened&quot; because that confuses things. In pneumatics and hydraulics, a valve &quot;opening&quot; causes a flow of fluid but, in EE, a switch &quot;opening&quot; causes a cessation of current flow hence, it's better to use activate or deactivate.</p>
<p>We are using LT1243 gate driver for turning ON a MOSFET: if you see the datasheet of the LT1243, then we will know it has a high totem pole output of 1 A. which means that driver will drive a current of 1 A to the gate of the MOSFET to turn it ON.</p> <p>I was told that the reason for the high current (in terms of Gate driving for MOSFET) 1 A is to charge the parasitic capacitances of the MOSFET (especially Cgd (gate-drain capacitance) though these capacitance are undesirable yet inevitable. As you see, when the high current 1 A charges the parasitic capacitances quickly, the MOSFET also turns ON quickly. And Simultaneously, we have the gate voltage applied by gate driver.</p> <p>I want to know why the capacitance needs to be charged quickly, so that the gate can be opened by applying the gate voltage. what happens when less current is given, does it affect the speed of the turning ON of the MOSFET. if it affects the turning ON speed of the MOSFET, then How?</p>
Relationship between value of the totem pole output of the gate driver and the speed of turning ON of the MOSFET
2023-12-26T12:36:15.987
695449
|delay|vlsi|interconnect|
<p>Consider the following single RC delay stage: -</p> <p><a href="https://i.stack.imgur.com/URqiZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/URqiZ.png" alt="enter image description here" /></a></p> <p>The phase lag of the output appears to be linear with frequency and, when this happens we get a constant time lag i.e. the circuit adds a delay to the signal. But, if we plotted the phase lag beyond 1 MHz we would see problems: -</p> <p><a href="https://i.stack.imgur.com/JwYb1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JwYb1.png" alt="enter image description here" /></a></p> <p>This time I've plotted up to 10 MHz and, as you can see, the phase lag is not actually very linear with frequency and, if you had a wideband signal you would get serious distortion of the waveform shape.</p> <p>That is why we would use <span class="math-container">\$N\$</span> stages of RC. Each stage would have an RC product that is <span class="math-container">\$N\$</span> times smaller. The result is that we achieve a much wider bandwidth for the same time delay with much less signal-shape distortion.</p>
<p>Consider a problem where we are interested in computing the delay for a signal to propagate to some load capacitance after a step input on the driving logic gate, and let there be a nonnegligible interconnect load with its own resistance <span class="math-container">\$R_{wire}\$</span> and capacitance <span class="math-container">\$C_{wire}\$</span>. Of course, this interconnect is a distributed circuit, but my understanding is that it can (with no approximation) be modelled as <span class="math-container">\$N \to \infty\$</span> lumped <span class="math-container">\$\Pi\$</span> RC networks, with R and C in each network equal to <span class="math-container">\$R_{wire}/N\$</span> and <span class="math-container">\$C_{wire}/2N\$</span>. Further, one has that the Elmore delay of any number <span class="math-container">\$M\$</span> <span class="math-container">\$\Pi\$</span> segments used to model the wire equals <span class="math-container">\$R_{wire}C_{wire}/2\$</span>. It then seems to follow that if we are interested in computing the RC flight time for a wire we can just use <em>one</em> <span class="math-container">\$\Pi\$</span> segment to model its effect. Why then do we often use more than one segment when we want a closer approximation to the actual wire? I can kind of understand it if we want to know the delay until a certain part of the wire is charged up, but if we are just interested in the delay until we reach the end of the wire?</p> <p>As an example of what I mean, consider the example below taken from Weste and Harris's <em>CMOS VLSI Design</em>. I emphasize that they choose to use two <span class="math-container">\$\Pi\$</span> segments on one of the paths. Why is this choice necessary or a better approximation to the real situation given my above discussion?</p> <p><a href="https://i.stack.imgur.com/83aeW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/83aeW.png" alt="enter image description here" /></a></p>
Why do I need multiple segments to model the RC flight time of interconnect?
2023-12-26T15:50:51.827
695455
|voltage|operational-amplifier|differential-amplifier|
<p>Both methods 1 and 2 are common solutions. Which one usually depends on other circuit factors such as tolerance for the noise of a charge pump to generate the -5V, or the availability of an extra opamp to create the +2.5 V offset reference.</p> <p>A possible issue with the 2.5 V reference approach is that any difference between it and the 2.5 V DC offset already built into the input signals will appear at the opamp output, possible pushing one of the peaks into clipping. One way around this is to lowpass filter one of the input signals to extract its DC value, and buffer that to use as the non-inverting input offset. Messy and lotsa parts, but self-tracking.</p> <p>Absent more information, I'm leaning toward the -5 V charge pump approach. A CMOS 555 is relatively quiet, or use an opamp as a Schmitt trigger oscillator (or a Schmitt trigger gate if there is a spare one in the design).</p>
<p>I have two sine waves of 1V magnitude and offset of 2.5V with 180 phase difference, going into a differential amplifier to be amplified. I have access to a 5V source (as a source, not as a battery) and ground.</p> <p>Since the output will sometimes be negative, the lack of a negative source means the op-amp cannot drive the output to a negative component. I have a few ideas to overcome this:</p> <ol> <li>Generate a -5V voltage to be used in powering the op-amp.</li> <li>Generate a 2.5V voltage to act as a ground for the differential amplifier inputs, and therefore act as an offset. I don't have access to regulator ICs so I'll need to make this out of an op-amp. This is my preferred method but I would like to know less current-intensive methods.</li> </ol> <p>I would like to know if there are more options that I have overlooked.</p>
Ways to output "negative" components of a sine wave through an op-amp
2023-12-26T17:07:31.380
695463
|digital-logic|verilog|simulation|register|
<p>You can add code like this into the testbench module. It uses a Verilog hierarchical specifier to access a signal in a sub-module:</p> <pre><code>#20 $display(&quot;uut registers[6]='h%04x&quot;, uut.file_regester.registers[6]); </code></pre> <p>Here is the modified testbench code as an example:</p> <pre><code>module testBench (); reg [31:0] instructions [0:10]; integer i; reg clk; reg [31:0] current_instruction; // To hold the current instruction wire [31:0] result; // To capture the result from mp_top mp_top uut (clk, current_instruction, result); initial clk = 0; always #5 clk = ~clk; initial begin instructions[0] = 32'b000100_00000_00001_00010_00000000000; instructions[1] = 32'b001110_00000_00001_00010_00000000000; instructions[2] = 32'b001000_00000_00001_00010_00000000000; instructions[3] = 32'b001011_00011_00001_00010_00000000000; instructions[4] = 32'b001010_00000_00001_00010_00000000000; instructions[5] = 32'b000001_00000_00001_00010_00000000000; instructions[6] = 32'b001101_00000_00001_00010_00000000000; instructions[7] = 32'b000110_00000_00001_00010_00000000000; instructions[8] = 32'b001001_00000_00001_00010_00000000000; instructions[9] = 32'b000101_00000_00001_00010_00000000000; instructions[10]= 32'b000111_00000_00001_00010_00000000000; for (i = 0; i &lt; 11; i = i + 1) begin current_instruction = instructions[i]; // here i want to access the values in the register file to analyze it. #20; end #20 $display(&quot;uut registers[6]='h%04x&quot;, uut.file_regester.registers[6]); $finish; end endmodule </code></pre> <p>Here is the output when you run a simulation:</p> <pre><code>uut registers[6]='h0738 </code></pre> <p>A runnable code example is available on <a href="https://edaplayground.com/x/QmRi" rel="nofollow noreferrer">EDA Playground</a>.</p>
<p>I'm trying to access register values from the analyzer in the test bench. Is there a way to access them without calling the register file module? (I don't want to call the rf module because accessing it writes values in address3 and I don't want to change its value.)</p> <ul> <li>The analyzer is part of the test bench that compares the result with the expected value, and returns PASS or FAIL. but I need to access the register value so that I can calculate the expected result.</li> </ul> <pre><code>module testBench (); reg [31:0] instructions [0:10]; integer i; reg clk; reg [31:0] current_instruction; // To hold the current instruction wire [31:0] result; // To capture the result from mp_top mp_top uut (clk, current_instruction, result); initial clk = 0; always #5 clk = ~clk; initial begin instructions[0] = 32'b000100_00000_00001_00010_00000000000; instructions[1] = 32'b001110_00000_00001_00010_00000000000; instructions[2] = 32'b001000_00000_00001_00010_00000000000; instructions[3] = 32'b001011_00011_00001_00010_00000000000; instructions[4] = 32'b001010_00000_00001_00010_00000000000; instructions[5] = 32'b000001_00000_00001_00010_00000000000; instructions[6] = 32'b001101_00000_00001_00010_00000000000; instructions[7] = 32'b000110_00000_00001_00010_00000000000; instructions[8] = 32'b001001_00000_00001_00010_00000000000; instructions[9] = 32'b000101_00000_00001_00010_00000000000; instructions[10]= 32'b000111_00000_00001_00010_00000000000; for (i = 0; i &lt; 11; i = i + 1) begin current_instruction = instructions[i]; // here i want to access the values in the register file to analyze it. #20; end $finish; end endmodule </code></pre> <p>and here is the register file</p> <pre><code>module reg_file (clk, addr1, addr2, addr3, in , out1, out2); input clk; input [4:0] addr1, addr2, addr3; input [31:0] in; output reg [31:0] out1, out2; reg enable = 0; //flag for ensuring there is no garbage values. function [31:0] get_register_value; input [4:0] register_number; // 5 bits to address 32 registers begin get_register_value = registers[register_number]; end endfunction // Declare a register array with 32 registers, each 32 bits wide reg [31:0] registers [0:31]; initial begin registers[0] = 32'h0000; registers[1] = 32'h175A; registers[2] = 32'h2FC2; registers[3] = 32'h01E2; registers[4] = 32'h37A6; registers[5] = 32'h1404; registers[6] = 32'h0738; registers[7] = 32'h1494; registers[8] = 32'h3F3A; registers[9] = 32'h129E; registers[10] = 32'h10CA; registers[11] = 32'h0262; registers[12] = 32'h05E6; registers[13] = 32'h2642; registers[14] = 32'h1D20; registers[15] = 32'h15B4; registers[16] = 32'h2454; registers[17] = 32'h3012; registers[18] = 32'h31F6; registers[19] = 32'h28F6; registers[20] = 32'h2D34; registers[21] = 32'h1A7A; registers[22] = 32'h20EE; registers[23] = 32'h1644; registers[24] = 32'h3466; registers[25] = 32'h2BE0; registers[26] = 32'h07C6; registers[27] = 32'h039A; registers[28] = 32'h1784; registers[29] = 32'h3D80; registers[30] = 37'h1600; registers[31] = 32'h0000; end always @(posedge clk) begin if(enable) registers[addr3] &lt;= in; // Write 'in' to the register at 'addr3' end always @(posedge clk) begin enable = 1; $display(&quot;Instructionx : %h&quot;, registers[addr3]); out1 = registers[addr1]; // Read from the register at 'addr1' out2 = registers[addr2]; // Read from the register at 'addr2' end endmodule </code></pre> <pre><code>module alu ( input [5:0] opcode, input [31:0] a, b, output reg [31:0] result ); // Define opcodes for different operations localparam [5:0] ADD = 6'b000100, SUB = 6'b001110, ABS = 6'b001000, NEG = 6'b001011, MAX = 6'b001010, MIN = 6'b000001, AVG = 6'b001101, NOT = 6'b000110, OR = 6'b001001, AND = 6'b000101, XOR = 6'b000111; always @(*) begin case (opcode) ADD: result = a + b; // Addition SUB: result = a - b; // Subtraction AND: result = a &amp; b; // Bitwise AND ABS: result = (a&gt;0)? a:-a; NEG: result = -a; // negate a MAX: result = (a&gt;b) ? a:b; MIN: result = (a&lt;b) ? a:b; AVG: result = (a+b)/2; NOT: result = ~a; // Bitwise NOT (unary operation, ignores b) OR : result = a | b; // Bitwise OR XOR: result = a ^ b; // Bitwise XOR default: result = 32'b0; // Default case to handle undefined opcodes endcase end endmodule </code></pre> <pre><code>module mp_top (clk, instruction , result ); input clk; input [31:0] instruction; output reg [31:0] result; // Decode the instruction wire [5:0] opcode; wire [4:0] address1; wire [4:0] address2; wire [4:0] address3; wire [31:0] out1; wire [31:0] out2; // Assign the instruction fields assign opcode = instruction[31:26]; assign address1 = instruction[25:21]; assign address2 = instruction[20:16]; assign address3 = instruction[15:11]; reg_file file_regester( .clk(clk), .addr1(address1), .addr2(address2), .addr3(address3), .out1(out1), .out2(out2), .in(result) ); alu ALU ( .opcode(opcode), .a(out1), .b(out2), .result(result) ); endmodule <span class="math-container">```</span> </code></pre>
Get a value from register file to analyzer
2023-12-26T18:19:46.513
695488
|arduino|relay|shift-register|
<p>The ULN2803 has open collector outputs - it is a transistor with the emitter grounded and the collector connected to the output pin. The ULN2803 can only pull its output to ground, or let the output float.</p> <p>Since you have grounded one side of the relay coil, the ULN2803 cannot cause the relay to operate.</p> <p>You need to connect the relay coil + terminal to the positive supply, and connect the relay coil - terminal to the ULN2803 output to allow the ULN2803 to control the relay.</p>
<p>I have followed the <a href="http://www.mikeburdis.com/wp/projects/16-channel-relay-multiplexer-shield-for-arduino-nano/" rel="nofollow noreferrer">post</a> and tried to control multiple relays using Arduino. Instead of using the original relay, I used <a href="https://www.fcl.fujitsu.com/downloads/MICRO/fcai/relays/na.pdf" rel="nofollow noreferrer">NA-5W-K</a>. However, the relay on my designed PCB doesn't work.</p> <p>The original design used an Arduino Nano to send signals to multiple 74HC595 8-bit output register. And those 74HC595 are connected to the relay driver ULN2803 to drive each individual relays.</p> <p>I have made little modification with the original design (refer to the Shift registers and relay drivers in that post). My OUT1_1 is one of the outputs of ULN2803.</p> <p>I suppose the relay driver would drive my relays. I have checked that each of the 74HC595 output is working well. When I connect the 74HC595 output to the ULN2803 and drive the relays, it seems that the relay wouldn't drive. However, when I removed the ULN2803, and directly connect the output of each 74HC595 to my OUT1_1, the relays work. Do I actually need the relay driver and why it causes the failure of the system?</p> <p><a href="https://i.stack.imgur.com/LPhKF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LPhKF.png" alt="Relay diagram design" /></a></p>
Relay board design issues with the relay driver
2023-12-27T02:03:00.963
695490
|usb-pd|
<p>The standards do not require two connectors on same equipment to be isolated or non-isolated. So you can't assume anything if they are or are not isolated. Safe assumption of course is to assume they share grounds.</p> <p>It might be easiest for your device to isolate with a DC/DC converter so it does not matter where you plug it and how.</p> <p>But if you are going to use PD and an isolating DC/DC converter, why bother having two USB cables. Just make a power supply with DC/DC conversion that takes in one single USB cable and provides all three required supply voltages out.</p>
<p>I want to power some old machines using an USB PD power supply connected via cables containing a USB PD sink configured for the proper voltage/current.</p> <p>However, one of those requires three voltages: +5V, +12V and -12V (all with a common ground obviously).</p> <p>Joining the grounds of the two positive voltages does not seem like it should be a problem, however I am wary of inverting one of the 12V cables in order to generate the -12V. Is there a risk of a short circuit inside the USB PD power supply or does the USB PD standard guarantees that each plug is isolated from the others?</p> <p>More precisely: would it be safe, <strong>according to the USB PD standard</strong>, to do the following:</p> <ul> <li>using three cables from the same power supply with respective voltages: A = 5V, B = 12V, C = 12V?</li> <li>connect A &amp; B ground together with C's +12V to generate a -12V rail?</li> </ul> <p>I can easily test with a simple ohmmeter if a given power supply allows it or not but I would also like to know if the standard allows for it.</p>
USB PD: can two outputs of the same power supply be used to generate positive and negative voltage?
2023-12-27T03:41:22.300
695497
|rf|components|microwave|attenuator|
<p>Item 1 should be a power attenuator, 10 db, 50<span class="math-container">\$\Omega\$</span>, 10 W.</p> <p>Since it's basically just resistive it shouldn't be hard to verify the impedance and attenuation.</p> <p>You can see a description of them <a href="https://www.sphere.bc.ca/oldsite/test/rf.html" rel="nofollow noreferrer">here</a>.</p> <p>Attenuators like this will generally be either a T type or a <span class="math-container">\$\large{\pi}\$</span> type.</p> <p>For T attenuators:</p> <p><img src="https://i.stack.imgur.com/mgLTp.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fmgLTp.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p> <p><span class="math-container">$$ R1 = R_0\times\frac{N-1}{N+1} $$</span> and <span class="math-container">$$ R2 = R_0\times\frac{N \times 2}{N^2-1} $$</span></p> <p>Where <span class="math-container">\$R_0\$</span> is the characteristic impedance and <span class="math-container">\$N = 10^\frac{dB}{20}\$</span></p> <p>So for 50<span class="math-container">\$\Omega\$</span> and 10 dB we get</p> <p><span class="math-container">$$ R1 = 50\Omega\times\frac{3.162-1}{3.162+1} = 25.97\Omega $$</span> and <span class="math-container">$$ R2 = 50\Omega\times\frac{3.162 \times 2}{3.162^2-1} = 35.14\Omega $$</span></p> <p>For the <span class="math-container">\$\large{\pi}\$</span> type:</p> <p><img src="https://i.stack.imgur.com/JztVD.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fJztVD.png">simulate this circuit</a></sup></p> <p><span class="math-container">$$ R1 = R_0\times\frac{N+1}{N-1} $$</span> and <span class="math-container">$$ R2 = R_0\times\frac{N^2-1}{N \times 2} $$</span></p> <p>Working those out gets you R1 = 96.25<span class="math-container">\$\Omega\$</span> and R2 = 71.14<span class="math-container">\$\Omega\$</span></p> <p>So you can measure the resistance from each terminal to the heatsink and from terminal to terminal and see if the readings you get fit one of these results.</p>
<p>Some context: I acquired some RF components from the family of an old RF tech that passed. I am currently adding the parts and datasheets to my inventory but for the following parts I was unable to find the datasheets anywhere. It's as if they go by another part name but aren't marked as such.</p> <p>I recall the bin I grabbed them from labeled as &quot;RF Attenuators&quot; so maybe it's an RF attenuator network IC, but searching with any and all keywords I could think of didn't provide results.</p> <h2>Item 1:</h2> <p>Motorola? <strong>MAR110</strong></p> <p><a href="https://i.stack.imgur.com/Mug0N.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mug0N.jpg" alt="enter image description here" /></a></p> <h2>Item 2:</h2> <p><strong>ACRIAN 62015</strong></p> <p><a href="https://i.stack.imgur.com/RSuwk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RSuwk.jpg" alt="enter image description here" /></a></p>
Finding datasheets for relatively new looking components but nothing appears from search
2023-12-27T04:33:16.550
695502
|fcc|certification|compliance|
<p>For FCC it comes down to whether you can make a compelling engineering argument that there should be no change in system behaviour, and whether you are willing to take the financial/reputational risk.</p> <p>For discrete components with no significant difference (such as chip resistors) there should be no issue. Replacing one type of cap with another of equal value, but different behaviour (say very different ESR), in an area which might impact emissions, you are on thinner ice. Changing a complex subassembly with a functionally equivalent alternative, but totally different implementation, is hard to justify.</p> <p>The really critical thing to consider are the consequences if the change actually causes the device to fail certification.</p> <p>If you have shipped hundreds of thousands of units, and have to undertake a recall due to a breach which causes significant user issues, you may have made a very expensive mistake.</p> <p>In personal experience, like-for-like component changes (and even minor schematic changes) are generally done without retest, whereas more major changes require at least a basic check to verify you've not introduced significant issues.</p> <p>In your specific situation, case 2 is probably fine without retest, but case 1 is suspect. The main get out would be if the two GPS modules use the same chipset with the same recommended schematic. In that case you might well be fine, especially if the modules have been successfully certified in other apps.</p> <p>However, it is up to you to assess the cost savings of not testing vs the exposure...</p>
<ol> <li><p>Can anyone please guide on whether the replacement of GPS receiver with the same spec from the another brand for the cost reduction would impact the FCC approval received for the device or not? If yes then the product will need to be tested thoroughly or some specific testing would be necessary?</p> </li> <li><p>Will the replacement of small components like capacitor, resistor, etc. affect the FCC approval of the device even though the components are going to be replaced with the components of the same specs from another brand?</p> </li> </ol> <p>Thanks in advance.</p>
Impact on FCC certification due to replacement of GPS receiver module
2023-12-27T05:34:03.750
695508
|mosfet|power-electronics|datasheet|bms|
<blockquote> <p>These BMS are rated for higher currents like 150A - 250A</p> </blockquote> <p>MOSFET conduction losses are RI², and a BMS is usually designed for continuous use at the rated current. So high currents like 250A mean you need ridiculously low RdsON to compensate, along with lots of copper, because every fraction of a milliohm counts.</p> <p>Losses for paralleled MOSFETs.</p> <ul> <li><p>Number of MOSFETs in parallel: N</p> </li> <li><p>All MOSFETs have the same RdsON</p> </li> <li><p>Total current: Itotal</p> </li> </ul> <p>Current per MOSFET: Itotal/N</p> <p>Power per MOSFET: RdsON (Itotal/N)²</p> <p>Total power loss: N RdsON (Itotal/N)² = (RdsON/N) Itotal²</p> <p>As expected, the result is exactly the same as one bigger MOSFET with (RdsON/N) resistance carrying the total current.</p> <p>Considering only one model of MOSFET, total loss is inverse proportional to the number of devices. Also the heat is spread over a large area, which makes it much easier to handle.</p> <p>The table show total losses:</p> <p><a href="https://i.stack.imgur.com/EWCnl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EWCnl.png" alt="enter image description here" /></a></p> <p><strong>BMS subtleties:</strong></p> <p>Due to body diode, one MOSFET can only block current in the direction where the diode does not conduct. In the diode direction... if the FET is turned off, current will pass through the diode.</p> <p><a href="https://i.stack.imgur.com/lGfFN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lGfFN.png" alt="enter image description here" /></a></p> <p>BMS is supposed to block current in both directions, so that needs <a href="https://www.powersystemsdesign.com/articles/application-of-power-mosfet-in-battery-management-charge-discharge-system/145/19032" rel="nofollow noreferrer">two MOSFETs in series, back to back</a>.</p> <p>So if your BMS has 20 MOSFETs total, it has two groups of 10 parallel MOSFETs, and current goes through both.</p> <p>Each group of 10 parallel FETs acts like a 10x lower RdsON FET, but there are two groups in series, so the total BMS resistance is only 5x lower than the RdsON of one FET.</p> <p>You also don't want them to get too hot, because:</p> <ul> <li><p>RdsON increases with temperature (+50% at 100°C) so more losses mean... even more losses</p> </li> <li><p>All the wasted heat comes from the battery, so it reduces runtime</p> </li> <li><p>The FETs are often next to Lithium cells, which are sensitive to temperature</p> </li> <li><p>Most BMS have no fan or other means of getting rid of lots of heat (although this one does)/</p> </li> </ul> <p>They could have used fewer FETs with lower RdsON, say 1mOhm. Maybe they got a good price on those, or they have a huge stock of them.</p> <p>Another reason to use a large number of MOSFETs is to be able to switch off in overload condition (short circuit) without blowing a FET.</p> <blockquote> <p>According to the datasheet, JMSH0804AE has a Vds of 85V and a continuous Id of 139A</p> </blockquote> <p>It is rated for a continuous Id of 139A <strong>at Tc=25°C</strong>. This is a standard datasheet spec which is meant to allow you to compare MOSFETs: it combines RdsON and RthJC, ie how much heat it's going to dissipate (RI²) and how good it is at conducting this heat from the chip to the thermal interface part of the package (RthJC to the D²PAK tab).</p> <p>It is a hypothetical number, the FET is not intended to be run at this current. With 3.6mOhm, it would dissipate 70W at 139A, and it's a SMD package, so to obtain Tc=25°C (on the tab of the package) you would need to solder it on a watercooled copper block. It's never going to happen in real use.</p> <p>Besides, they also give a lower maximum current, limited by the package bondwires (see note 6 in the datasheet).</p> <p>Regarding SOA graph:</p> <p><a href="https://i.stack.imgur.com/VsXjR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VsXjR.png" alt="enter image description here" /></a></p> <p>When conducting DC current, it's on the blue line: Vds=RdsON*Id. It is limited by dissipation and how it is cooled.</p> <p>SOA for switching depends on the load. With an inductive load, for example in a buck converter, as the FET turns off, current will remain pretty constant as Vds rises. Current only falls when Vds allows it to flow through the other MOSFET or diode. So you get a I-V trajectory like the one drawn in purple. In a non-inductive load you may get an easier I-V trajectory like the one in red. In both cases, during switching, there is a small time window where dissipation is very high (high current * high Vds). The SOA graph gives information about the maximum allowed switching time the FET can withstand.</p> <p>If you want it to be able to switch off in case of an output short, the maximum current allowed in the SOA graph is important. Here it's around 3-400A for 80V, so with 20 of these FETs in parallel you could (in theory) switch off 6000-8000A. More than that, and you can expect explosive disassembly. If the battery pack runs at 67V and a short occurs, there's not much resistance in the circuit to limit current, maybe a few mOhms, so these extreme current numbers are what you'd expect to find.</p> <p>Circuit inductance does limit the rate of rise of the current though, so it is important to have a fast current sense comparator and gate driver to turn off the FETs as quickly as possible before current keeps rising. This should always be implemented in hardware, never as software, there's no time for interrupt latency.</p> <p>Further reading:</p> <p><a href="https://assets.nexperia.com/documents/application-note/AN50006.pdf" rel="nofollow noreferrer">Power MOSFETs in linear mode</a>: application of SOA for linear mode (not for switching).</p> <p><a href="https://assets.nexperia.com/documents/application-note/AN11158.pdf" rel="nofollow noreferrer">Understanding power MOSFET data sheet parameters</a></p> <p><a href="https://assets.nexperia.com/documents/application-note/AN11243.pdf" rel="nofollow noreferrer">Failure signature of electrical overstress on power MOSFETs</a></p>
<p>I found a few teardown videos for the <a href="https://www.youtube.com/watch?app=desktop&amp;v=_jBhS8DQwTo" rel="nofollow noreferrer">Daly BMS</a> and the <a href="https://www.youtube.com/watch?v=fZAbMFLzzIs" rel="nofollow noreferrer">JK-BMS</a>. These BMS are rated for higher currents like 150A - 250A. Based on the <a href="https://www.youtube.com/watch?app=desktop&amp;v=_jBhS8DQwTo" rel="nofollow noreferrer">teardown</a>, the 16S Daly BMS uses JMSH0804AE N-channel MOSFET. According to the <a href="https://www.jjwdz.com/pdf/MOSFET/pdf/JMSH0804AE_Rev3.3.pdf" rel="nofollow noreferrer">datasheet</a>, JMSH0804AE has a Vds of 85V and a continuous Id of 139A, but if we check its safe operating area (SOA) then we see that the device is capable of handling 10A maximum at 80V for 100us. Daly has used twenty JMSH0804AE to handle the current.</p> <p>My thoughts were that our desired output current must always be within the DC graph in the SOA. The way Daly has selected its MOSFET is perplexing. Moreover, I have only mentioned the Daly BMS, but the JK-BMS has also selected their MOSFETs similarly. Thus, I wish to understand the role of SOA in FET selection, and when can we ignore this rule.</p>
MOSFET selection for high current
2023-12-27T07:48:12.983
695521
|sensor|identification|production|
<p>Industrial sensors in that that style typically use one of three technologies:</p> <ul> <li><strong>Inductive proximity</strong>: These are good for sensing ferrous metals and can detect non-ferrous metals such as aluminium but at reduced range.</li> <li><strong>Photo-sensor</strong>: The most common shine a red LED light or LASER to illuminate the target and have a sensor to measure the reflected light. There are a variety of techniques used for background suppression and distance measurement.</li> <li><strong>Capacitive proximity</strong>: These use two small plates on the front surface of the sensor as a very poor capacitor (as the plates have no overlap). When a suitable material comes within range there is capacitive coupling between the first plate and the object and between the object and the second plate. The sensor can detect this.</li> </ul> <p>For sensing bread dough we can rule out inductive type as bread is not metallic. We can probably rule out photo-sensors as there is no visible light spot on either photo. That leaves capacitive as most likely as the water content of the dough will provide enough capacitance to trigger the sensor.</p> <p>The sensors are usually 24 V DC powered (as is normal in most industrial controls). The sensitivity adjustment potentiometer can be seen in the upper photograph.</p> <p>The function of the sensors might be simply to trigger the product counter or they could be used to trigger the start of an operation when a part is in position. As mounted in the lower photo a pneumatic pusher cylinder is visible on each of the two lanes before the sensor so I suspect that the pieces of dough are flipped over or folded at those stations. There isn't enough context in the upper photo for me to determine the purpose of that station.</p>
<p><a href="https://i.stack.imgur.com/ClIai.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ClIai.jpg" alt="enter image description here" /></a></p> <p>What is the name of these two sensors and what function do they perform?</p> <p><a href="https://i.stack.imgur.com/yuTJy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yuTJy.jpg" alt="enter image description here" /></a></p>
Sensor types in bread production
2023-12-27T09:30:56.897
695532
|circuit-analysis|circuit-design|impedance-matching|
<p>If it has feedback to control the duty cycle, the output impedance will be defined by the loop, and could be zero, or slightly positive or negative, or near infinite if controlled as a current output.</p> <p>If you mean the instantaneous impedance, you'll also need the duty cycle, switching devices resistance, inductor loss ...</p>
<p>If I consider a buck converter where in 24 volts, L =100 μH, capacitor 47 μF. Then converter will operate at 400 kHz. How do I calculate the output impedance of the converter?</p>
How to calculate output impedance of switching regulator?
2023-12-27T11:59:19.720
695535
|voltage|operational-amplifier|voltage-divider|
<p><strong>Hint</strong></p> <p>Maybe you are confused by the presence of the op-amp. Try considering this: -</p> <p><a href="https://i.stack.imgur.com/WPqNQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WPqNQ.png" alt="enter image description here" /></a></p> <p>Current <span class="math-container">\$I\$</span> is common to both resistors so, just use what you know from ohm's law to construct an equation to find the voltage at <span class="math-container">\$V+\$</span>. Here's a little start for you: -</p> <p><span class="math-container">$$I = \dfrac{V_{OUT}-V_{IN}}{R_1+R_2}$$</span></p>
<p>I don’t understand how they calculated V+. I would appreciate an explanation.</p> <p><a href="https://i.stack.imgur.com/PlegM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PlegM.jpg" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/COoo0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/COoo0.jpg" alt="enter image description here" /></a></p>
Voltage divider in op amp
2023-12-27T12:51:01.173
695536
|power-supply|safety|repair|
<p>- means ground in this case.</p> <p>The hazard I see here is more of a mechanical one. It looks like there are some stray wire strands poking out where the wires enter the connector. It would be good to have all the wires solidly inside the screw block. I'd also consider wrapping the whole connection in tape, and/or sticking it down to a certain place. If the radio is moved, jostling around the connector, and either one of the sticking out wire strands, one of the screws, the metal part where the wires push in, or the metal connector barrel touches something it shouldn't, it could create a short circuit and break the radio again.</p> <p>Alternatively it's possible to remove both connectors, join the wires directly with solder and cover them with heatshrink (which you have to put on the wires <em>before</em> you join them!) - but your way is fine.</p> <p>Congratulations on your successful repair.</p>
<p>Preface: I know little about electrical engineering, I mostly used a multimeter to diagnose and measure and to make sure I made nothing obvious wrong. But I know nothing about circuits, reading diagrams etc. I'm well aware of the dangers, which is why I want to verify whether I repaired a radio correctly:</p> <p>I have a Sony CMT-X3CD (CD/Radio/BT stereo) which didn't turn on anymore. With some troubleshooting and the <a href="https://www.manualslib.com/manual/2438668/Sony-Cmt-X3cd.html?page=36#manual" rel="nofollow noreferrer">service manual</a> I was able to diagnose that the power board failed. As a spare board is nowhere available I researched a bit and found that I can replace the power board with a generic SMPSU (13.5v, 1.5A, 20.2W) that ends in a regular DC plug. The old power board connected with a four-wire connector to the device's main board.</p> <p>According to the schematics, it supplied +13v on wires 1 and 2, and GND on 3 and 4:<a href="https://i.stack.imgur.com/fGSKQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fGSKQ.png" alt="enter image description here" /></a></p> <p>The main board accepted that connection accordingly:</p> <p><a href="https://i.stack.imgur.com/b7cCc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b7cCc.png" alt="enter image description here" /></a></p> <p>Now, as the power supply has a DC plug with + and - connectors, I use a female adapter that can be connected to two wires. I removed the connecting wire from the original power board, twisted the two 13v wires into a single wire, and the two GND wires as well. The +13v wire went into the &quot;+&quot; port, the GND wire in the &quot;-&quot; port:</p> <p><a href="https://i.stack.imgur.com/zvqiO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zvqiO.jpg" alt="enter image description here" /></a></p> <p>This works, the radio powers on again and I can play music again. Before I close it up, I want to make sure that this is a safe fix, i.e. presents no fire hazard or has the potential to blow up. I'm especially unsure about the fact that the original board only supplied +13v (i.e. no explicit -13v connection which I could connect to the &quot;-&quot; connection on the new PSU).</p>
Have I replaced the power supply in this radio safely?
2023-12-27T13:02:49.600
695548
|motor|ac|
<p>What you need to do to reverse the motor is this:</p> <p><a href="https://i.stack.imgur.com/2PpnO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2PpnO.jpg" alt="enter image description here" /></a></p> <p>You cut the wires to the brushes at the spots indicated by black lines, then reconnect the brushes to the coils as shown by the red and blue lines.</p> <p>Normally, each brush is connected to the coil closest to it. You reconnect it so that each brush is connected to the coil opposite it. Electrically, it is pretty simple.</p> <p>Practically, however, it will be difficult.</p> <p>There are crimped connections between the coil wires and the brushes. You'd think you could just cut the coil wires and solder in some insulated wire to make the new connections.</p> <p>The problem is that many such motors use aluminum wire in the coils. Aluminum wire is very difficult to solder - that's why there are crimped connections in the motor.</p> <p>You'd have to cut the wires and use crimp connectors for the rewiring. It's not impossible, it's just not something that most folks will be able to do. You need a good crimping tool and crimps made for the proper wire gauge.</p> <hr /> <p>I discovered the hard way that such motors use aluminum wiring while <a href="https://josepheoff.github.io/posts/universalmotor" rel="nofollow noreferrer">reversing a sewing machine motor.</a> When I did the first one, I had no trouble. Later, I did another one and fiddled with the wires too much, causing one of the coil wires to break just below the crimp. I thought it'd be no problem to solder it back together. Once I go the lacquer insulation off of the coil wire, I found it was aluminum wire. I could not get solder to stick to it. There are special solders and fluxes for aluminum wire, but I didn't have any and the regular solder and flux I had didn't work.</p> <hr /> <p>An alternative to electrically reversing such a motor is to mount it so that you get the proper rotation direction.</p> <p>Sewing machine motors are usually mounted so that the motor is behind the support column, out of the way. You can mount them so that they stick out to the right of the handwheel instead. The motor is kind of in the way and covers won't fit anymore, but from the point of view of the machine the motor rotates in the opposite direction. Most sewing machines rotate counterclockwise, so most available replacement motors run counterclockwise. There are some few oddball machines that run clockwise, though. For those, you either reverse them electrically (which I prefer) or you mount them &quot;the wrong way around&quot; to mechanically reverse them.</p> <p>Maybe you can mount your motor differently in whatever device you are building instead of electrically reversing it.</p>
<p>Is it possible to reverse the direction of this universal motor I have extracted from a circular saw?</p> <p>Here is a picture of the stator:</p> <p><a href="https://i.stack.imgur.com/tjSbg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tjSbg.jpg" alt="enter image description here" /></a></p>
How can I reverse direction of this AC brushed motor?
2023-12-27T14:49:48.847
695550
|circuit-analysis|
<p>Well, we have the following circuit:</p> <p><img src="https://i.stack.imgur.com/CveKV.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fCveKV.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p> <p>Using KCL, we can see that:</p> <p><span class="math-container">$$0=\text{I}_1\left(t\right)+\text{I}_2\left(t\right)+\text{I}_3\left(t\right)\tag1$$</span></p> <p>And for the voltages we can see:</p> <p><span class="math-container">$$ \begin{cases} \begin{alignat*}{1} \text{I}_1\left(t\right)&amp;=\frac{\displaystyle\text{V}\left(t\right)-0}{\displaystyle\text{R}_1}\\ \\ \text{I}_2'\left(t\right)&amp;=\frac{\displaystyle\text{V}\left(t\right)-0}{\displaystyle\text{L}}\\ \\ \text{I}_3\left(t\right)&amp;=\left(\text{V}'\left(t\right)-0\right)\text{C} \end{alignat*} \end{cases} \tag2 $$</span></p> <p>Combinging, gives:</p> <p><span class="math-container">$$0=\frac{\displaystyle\text{V}'\left(t\right)-0}{\displaystyle\text{R}_1}+\frac{\displaystyle\text{V}\left(t\right)-0}{\displaystyle\text{L}}+\left(\text{V}''\left(t\right)-0\right)\text{C}\tag1$$</span></p> <p>Which is easy to solve, because we get:</p> <p><span class="math-container">$$\text{V}\left(t\right)=\exp\left(-\frac{\displaystyle t+\frac{\displaystyle t\sqrt{\text{L}-4\text{CR}^2}}{\displaystyle\sqrt{\text{L}}}}{\displaystyle2\text{CR}}\right)\left(\text{k}_1+\text{k}_2\exp\left(\frac{\displaystyle t\sqrt{\text{L}-4\text{CR}^2}}{\displaystyle\text{CR}\sqrt{\text{L}}}\right)\right)\tag4$$</span></p>
<p>How do I obtain the second order linear differential equation in terms of <code>Vc</code> in the circuit shown below. I've tried everything I know but still can't get to express <code>iL</code> in terms of <code>Vc</code>. What else can I do?</p> <p><a href="https://i.stack.imgur.com/5PvfR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5PvfR.jpg" alt="enter image description here" /></a></p>
Find the second order differential equation for this RLC circuit
2023-12-27T15:02:52.970
695561
|simulation|resistance|capacitance|equivalent-circuit|
<blockquote> <p>Question A: is it true, that the circuit will behave differently depending on where the voltage source is placed?</p> </blockquote> <p>No. Note the &quot;dx&quot; in the circuit diagram: this is an infinitely small element of the line. As such, the serial components of this element are too small to make a difference to the action of the parallel elements.</p> <p>Expressed in terms of a transmission matrix, this is represented as</p> <p><span class="math-container">\${V_1\choose I_1}=\begin{pmatrix}1&amp;(R+Ls)dx\\(G+Cs)dx&amp;1\end{pmatrix}{V_2\choose I_2}\$</span></p> <p>and you approximate an infinite product of those (which is done via Eigenvector decomposition that allows you to convert the product into a sum).</p> <p>That's the basics of transmission line theory. It doesn't really matter which end you put the parallel elements on since a single element is not different from a unity matrix anyway: it's just the accumulation of an infinite number of those elements that shows a final result, and between any two serial elements is a parallel element. Whether there is one at the left or the right end or both or none, doesn't make a difference because it is just a single element.</p>
<p>Consider a high-voltage power line that is hundreds of kilometers long. Such a wire has a capacitance, inductance and resistance.</p> <p><a href="https://electronics.stackexchange.com/a/397069/360341">This answer</a> to a previous similar question contains the following simple model for such a wire:</p> <p><a href="https://i.stack.imgur.com/cApSU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cApSU.png" alt="model of a single wire via a resistor, coil and a capacitor" /></a></p> <p>Let's assume that the resistance towards ground (Gdx) is infinite.</p> <p>Let's also connect a (DC) voltage source to one side, and a consumer at the other side. The consumer could be a simple resistor. And let's consider the event of turning the voltage source on.</p> <p>Now, the dynamics of this circuit must be different depending on if we place the voltage source on the left or on the right. If placed on the left, the capacitor is charged more slowly, and if placed on the right, the capacitor is charged almost instantly.</p> <p><strong>Question A:</strong> is it true, that the circuit will behave differently depending on where the voltage source is placed?</p> <p><strong>Question B:</strong> if question A is true, then how can a wire be modeled more accurately. I would assume that it would be an infinite series of resistor-capacitor pairs? Is there a way to represent this with a small amount of elements? Is there some literature that has a solution to this problem?</p>
Where to place the capacitor when modelling a single long wire?
2023-12-27T16:23:24.507
695569
|switch-mode-power-supply|isolated|
<p>Yes, you can do it. There is no problem. Obviously, it won't be isolated.</p>
<p>I need a converter module that outputs +15 -15 Volts to feed the opamps. My input voltage is 24V.</p> <p>I found that UWE1215S-3WR3 for this application. <a href="https://www.mornsun-power.com/html/pdf/UWE1215S-3WR3.html" rel="nofollow noreferrer"> UWE1215S-3WR3 datasheet </a></p> <p><a href="https://i.stack.imgur.com/SKG6Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SKG6Z.png" alt="enter image description here" /></a><a href="https://i.stack.imgur.com/aMgoX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aMgoX.png" alt="enter image description here" /></a></p> <hr /> <hr /> <p>I know that normally the input and output gnd pins must be completely separated from each other in order to fulfill the isolation function. know that if I connect the gnds of an isolated power supply, the isolated situation will disappear, but I wonder if I will have a problem if I connect the input gnd and the output com pin of a dc dc isolated power supply.Is it okay? can i use it like this?</p>
Can I use isolated power supplies by connecting the input gnd and output gnd together?
2023-12-27T17:31:59.170
695576
|operational-amplifier|ltspice|stability|
<p>For completeness, I add a simulation made with <a href="https://archive.org/details/mc12cd_202110" rel="nofollow noreferrer">microcap v12</a>.</p> <p>This simulator do the analysis without &quot;cutting&quot; anything, just insert the &quot;symbol&quot;.</p> <p><a href="https://i.stack.imgur.com/yLfZ8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yLfZ8.png" alt="enter image description here" /></a></p>
<p>I am studying the stability of op-amp circuits using LTspice with the help of this <a href="https://www.youtube.com/watch?v=YYWlPFBebfc" rel="nofollow noreferrer">video</a>. I can see many threads on Stack Exchange like <a href="https://electronics.stackexchange.com/questions/453967/op-amp-circuit-stability-ltspice">this one</a>, but the explanation is not clear to me.</p> <p>I have a couple of questions regarding this.</p> <ol> <li><p>For checking the gain peaking, the loop is not broken. Why is the phase margin not available from that gain peaking plot?</p> </li> <li><p>For finding the PM, the loop is broken and a source is placed with DC = 0 and AC = 1. Why?</p> </li> <li><p>What will happen if I provide some other value like DC = 5 V instead of DC = 0?</p> </li> <li><p>Can I break the loop anywhere?</p> </li> <li><p>Is there any method to test the stability without breaking the loop?</p> </li> <li><p>In both cases (gain peaking and PM) the input source is made zero. Why?</p> </li> </ol> <p><a href="https://i.stack.imgur.com/JmQ9U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JmQ9U.png" alt="enter image description here" /></a></p>
LTspice IV: Stability of op-amp circuits
2023-12-27T18:11:08.213
695585
|nmos|pmos|common-gate|
<p>Op's NMOS common-gate circuit is more easily configured for a PMOS transistor by providing a negative voltage at <span class="math-container">\$V_{DD}\$</span> instead of positive voltage...(left circuits below). Notice that Vb1 has its polarity switched in the PMOS version.<br> OP's proposed common-gate circuit is flawed. The PMOS source cannot be connected to a positive DC supply voltage <span class="math-container">\$V_{DD}\$</span> and driven by a signal source at the same time. However, if the signal source includes a positive DC offset that can supply PMOS operating current, this configuration <em>can work</em>...but a signal source is usually considered to be AC only, having no DC component.<br> In all these cases, the signal source must withstand the MOSFET's DC source current and still maintain an average voltage across its terminals of zero volts - something that we don't usually expect of a signal source.</p> <p><img src="https://i.stack.imgur.com/PyNIw.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fPyNIw.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup> <br> The right-most circuit allows Rload to be grounded. However, both Vb and signal source Vin2 are referenced to VDD2, not GND. That's rather awkward in many cases, since signal sources are usually ground-referenced.</p>
<p>This is an NMOS configured in common gate:</p> <p><a href="https://i.stack.imgur.com/vjaFe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vjaFe.png" alt="enter image description here" /></a></p> <p>I am trying to understand what a PMOS configured in common gate would look like. Would Vin and Vout be reversed in this case? So, would VDD be connected to the same branch as Vin?</p> <p>Is this correct ?</p> <p><a href="https://i.stack.imgur.com/DFehXm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DFehXm.jpg" alt="enter image description here" /></a></p>
PMOS configured in common gate
2023-12-27T20:32:09.847
695586
|hdmi|video-transmitter|
<p>Sure it can resync so locking on to TMDS and video stream is not a problem as that happens anyway when you plug in the connector, the video starts at whatever random point after link has been negotiated.</p> <p>But depending on if you are using HDCP or HDMI 2.0 or HDMI 2.1 protocols, the DDC link is used to verify they are OK, so the PC will surely know the display was disconnected even if you keep HPD high.</p> <p>Just use a software solution; force your PC to not care about disconnection. Most video drivers allow this.</p>
<p>I'm trying to gauge the viability of making an HDMI multiplexer/demultiplexer for multiple lines. The main goal is to be able to switch various inputs to various outputs.</p> <p>This question in particular is about attempting to make so the hdmi host (the device outputting the video data) never becomes aware that it's been disconnected (desireable for instance with windows, as windows will rearrange your desktop and windows if detects a monitor has been disconnected).</p> <p>As far as I can understand it, the TDMS channels are unidirectional. And from what I've seen HDMI switch ICs are basically just high frequency analog switches. So my thought then was &quot;what if I can just use a microcontroller to simulate the 5V line and DDC communications, and then use the switch IC to route the TDMS lines to where I want them?&quot;.</p> <p>In that way I hoped I might be able to keep the host transmitting data on the TDMS lines, blissfully unaware it wasn't actually getting to the monitor.<br /> The problem would be when switching that signal line back to the monitor. I could simulate disconnecting the hdmi cable, connecting it again and re-negotiating everything with the previously recorded DDC data from the host.. but as soon as I switch back the TDMS lines, there's no telling what the device would start receiving (it would likely start receiving the middle of a frame, probably mid-packet, completely unrecognizable).</p> <p>So, would a receiver device be tolerant to missing a large portion of the data it was supposed to receive? Does HDMI specify a way for the receiver to &quot;find the start of the next frame&quot; in the case it completely loses synchronization?</p>
Can an HDMI receiver device recover after TDMS lines are cut-off for long period?
2023-12-27T20:33:37.313
695590
|raspberry-pi|breadboard|debugging|digital-potentiometer|
<p>It appears that you are connecting the digital pot in series with the motor, so all motor current will flow through the pot.</p> <p>The datasheet states that the Absolute Maximum current on the pot leads is 2.5 mA. Unless you have an extremely small motor, this will not be anywhere near enough current to drive the motor.</p>
<p>I am new to electronics and this is my first time using a digital potentiometer. My goal is to control the speed of a DC motor using the <a href="https://www.mouser.ca/datasheet/2/268/MCHPS02713_1-2520653.pdf" rel="nofollow noreferrer">MCP4162-104E</a> digital potentiometer. I am confident in the wiring that the wiring is correct, however I am running into issues writing the code that will change the digital potentiometers resistance. I am looking to have a loop that will continuously change the potentiometers resistance that way I will see the motors speed increase when the resistance is low and decrease when the resistance is high.</p> <p><a href="https://i.stack.imgur.com/svPyl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/svPyl.png" alt="MCP4162 Digital Potentiometer Pinout" /></a></p> <p>The figure above is the pinout for the MCP4162 and currently I have the following connections:</p> <ol> <li>CS is currently connected to SPI0 CE0 on the RPI.</li> <li>SCK is connected to the RPI SCLK (GPIO11).</li> <li>SDI is connected to MOSI (GPIO10).</li> <li>Vss is connected to ground.</li> <li>P0W is connected to the positive terminal of the motor.</li> <li>P0B is connected to ground.</li> <li>SDO is connected to MISO (GPIO9).</li> <li>Vdd is connected to +3.3 V.</li> </ol> <p>The connections above can be seen in the breadboard level schematic I made below.</p> <p><a href="https://i.stack.imgur.com/Y8n21.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y8n21.png" alt="Breadboard Schematic" /></a></p> <p>Lastly, I below this is the code that I have so far. Please let me know if there are any errors/mistakes. Thank you in advance.</p> <p><a href="https://i.stack.imgur.com/guNLC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/guNLC.png" alt="Code Segment" /></a></p> <p>From what I understand from the data sheet, I believe where my issue is where I am writing to the MCP4162. Based on the data sheet I must send an 8-bit command byte followed by another data byte, which can be seen below. However, I am not sure how to do this within my code.</p> <p><a href="https://i.stack.imgur.com/Eq2vd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Eq2vd.png" alt="Command and Data Byte Structure" /></a></p>
Controlling Motor Speed with MCP4162-104E Digital Potentiometer
2023-12-27T20:43:33.333
695615
|parallel|decoupling-capacitor|
<p>The capacitor and power source appear in parallel in the schematic, but the schematic doesn't show parasitic inductance and resistance in the wiring. In reality the circuit might look more like this:</p> <p><img src="https://i.stack.imgur.com/CUDMz.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fCUDMz.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="noreferrer">CircuitLab</a></sup></p> <p>The load can change its internal resistance very sharply, demanding sudden changes in current. The wiring between A and B (and back to the voltage source along the bottom) has inductance <span class="math-container">\$L\$</span>, which permits the potential at B to freely rise and fall, but prevents the current <span class="math-container">\$I\$</span> around that loop from changing sharply.</p> <p>Therefore, without capacitance <span class="math-container">\$C\$</span>, if the load suddenly demands more current, the potential at B will momentarily fall, until inductance in the path eventually &quot;catches up&quot; to that demand. Then, when the load suddenly requires less current, node B's potential sharply rises above the supply's voltage, only returning to normal once inductance in the path permits current to settle at the load's required amount.</p> <p>Capacitance <span class="math-container">\$C\$</span> has the exact opposite behaviour to inductance <span class="math-container">\$L\$</span>. It is able to respond to changes in current through it instantly, but will not permit fast changes in voltage across it. This means that as load current demand changes, the capacitor tends to hold B's potential fixed, while simultaneously acting as a temporary source/sink of current, to accommodate the load's requirements in the short term.</p> <p>This also has the benefit of preventing power supply fluctuations due to the load's changing demands from affecting other systems connected to the same supply further down the line.</p> <p>In the circuit below, I simulate a load with fast-changing current requirements. By switching SW1 at 1kHz, load resistance flips between 1kΩ and 500Ω at 0.5ms intervals, which causes it to draw either 5mA or 10mA from the voltage source BAT1.</p> <p>Switch SW2 closes at 3ms, which introduces supply decoupling capacitor C1.</p> <p><img src="https://i.stack.imgur.com/2yiJf.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2f2yiJf.png">simulate this circuit</a></sup></p> <p>Here's a plot of load current through ammeter AM1:</p> <p><a href="https://i.stack.imgur.com/z1zlD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/z1zlD.png" alt="enter image description here" /></a></p> <p>Nothing seems wrong with this, until you look at the potential of node B:</p> <p><a href="https://i.stack.imgur.com/6z3Ge.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6z3Ge.png" alt="enter image description here" /></a></p> <p>Prior to 3ms, without capacitor C1 in place, there are clear spikes in supply voltage across the load. These occur because parasitic inductance L1 opposes those sudden current transients. These changes to supply potential could be devastating to anything sensitive (like 5V logic ICs) connected to that supply, or at best simply cause them to misbehave.</p> <p>When C1 is introduced, after 3ms, it successfully takes over current-supply duties during those transients, and keeps the load's supply potential steady. If we look at current in C1, we can see how it sinks and sources load current while inductance L1 initially cannot:</p> <p><a href="https://i.stack.imgur.com/rxt2i.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rxt2i.png" alt="enter image description here" /></a></p> <p>That large spike at 3ms is C1's initial charging current, as SW2 closes; ignore that. The small current spikes following 3ms are C1 sinking and sourcing the current necessary to maintain a constant potential at B, for those short periods until current through L1 can &quot;catch up&quot;.</p>
<p>In circuits like the one below, I don't understand how the capacitor can handle voltage spikes. I heard that decoupling capacitors deal with spikes by absorbing more of the voltage, but I don't understand how the capacitor can reduce the voltage received by the load as the voltage is same between parallel circuits.</p> <p><img src="https://blog.knowlescapacitors.com/hs-fs/hubfs/DecouplingCap.webp?" alt="" /></p>
How do capacitors stop voltage spikes?
2023-12-28T04:08:54.497
695621
|thermistor|
<p>From the <a href="https://product.tdk.com/en/search/sensor/ntc/chip-ntc-thermistor/list#part_no=NTCG164LH223HT1&amp;_l=20&amp;_p=1&amp;_c=5r25-5r25&amp;_d=0" rel="nofollow noreferrer">TDK website</a>, we download the .csv file for this particular thermistor and find the <strong>nominal</strong> resistance at 0°C and 100°C - 83.71kΩ and 1.009kΩ respectively.</p> <p>The author then calculates <span class="math-container">\$\beta\$</span> for the range 0°C/100°C to from the equation:</p> <p><span class="math-container">\$\beta = \ln(R_{T1}/R_{T2})\cdot (1/T1-1/T2)^{-1} \$</span></p> <p>The author rounds the right-hand term to 1019.3 rather than the exact answer of 1019.259225 and calculates the result (rounded to two decimal places) as</p> <p><span class="math-container">\$\beta\$</span> = 4503.67</p> <p>Without that intermediate rounding the result would be 4503.49 rounded to two decimal places.</p> <p>Note that <span class="math-container">\$\beta\$</span> has a tolerance of +/-3% for this relatively poor precision thermistor so the discrepancy is irrelevant.</p> <hr /> <p>The geometric mean method the author uses for the series resistor is one solution if you know nothing about the actual application, however if you know that the thermistor is to be used at some specific temperature you may prefer to have the series resistor equal to the thermistor resistance at that temperature. That will maximize the resolution at that temperature. For example, for a room temperature thermostat you may wish to have it indicate over a wide range, but you expect most users will set it in the range (say) 22°C +/-5°C.</p> <p>Another factor which should be considered is self-heating which may point to using a higher value resistor than would otherwise seem optimal.</p>
<p>I am following <a href="https://shadyelectronics.com/accurate-temperature-measurement-using-an-ntc-thermistor-with-an-arduino-or-stm32-microcontroller/" rel="nofollow noreferrer">this document</a> to calculate the series resistor for an NTC.</p> <p>Here the NTC used is <a href="https://product.tdk.com/system/files/dam/doc/product/sensor/ntc/chip-ntc-thermistor/catalog/tpd_commercial_ntc-thermistor_ntcg_en.pdf" rel="nofollow noreferrer">NTCG164LH223HT1</a>.Below is the snippet from the calculation section.</p> <p><a href="https://i.stack.imgur.com/dw1Dj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dw1Dj.png" alt="enter image description here" /></a></p> <p>In the equation for <strong>RNTC</strong> the B value is taken as 4503.67.Please see below.The datasheet value of B is 4550.</p> <p><a href="https://i.stack.imgur.com/6B1U0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6B1U0.png" alt="enter image description here" /></a></p> <ol> <li>May I know how they arrived the value of B as 4503.67?</li> </ol>
Series resistor selection using B value
2023-12-28T05:47:44.980
695622
|identification|surface-mount|
<p>I think it's a <a href="https://datasheet.lcsc.com/lcsc/2304140030_Analog-Devices-LT1121IST-5-PBF_C661289.pdf" rel="nofollow noreferrer">Analog Devices LT1121IST-5</a> LDO and the actual marking is</p> <pre><code>LT209e3 1121I5 </code></pre> <p>(the 'e3' is not always rotated like in the image, see for example <a href="https://www.lcsc.com/product-detail/Linear-Voltage-Regulators-LDO_Analog-Devices-LT1117IST-5-PBF_C117071.html" rel="nofollow noreferrer">LT1117IST</a>) <a href="https://i.stack.imgur.com/gNR46.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gNR46.png" alt="enter image description here" /></a></p> <p>(Source: <a href="https://www.alibaba.com/product-detail/-electronic-components-1121I5-LT1121IST-5_1600479401897.html" rel="nofollow noreferrer">alibaba.com</a>)</p> <p>Here is my reasoning:</p> <ul> <li>The pinout is reasonable</li> <li>The designator L<strong>IC</strong>xxx makes more sense for a LDO regulator than a transistor</li> <li>The Linear Technology 'LT' logo could be interpreted as 'IY' under conformal coating (especially with the old marking style, see last picture)</li> <li>If 'e3' is not roated, the top line would read LT + 5 characters like described</li> <li>The bottom line '1121I5' is very close to what is described</li> <li>The last '1' in your picture looks more like an 'I' to me</li> </ul> <hr /> <p>A picture of the LT1117IST as reference, I think your part uses this older marking style:</p> <p><a href="https://i.stack.imgur.com/r0Opq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r0Opq.jpg" alt="enter image description here" /></a></p> <p>(Source: lcsc.com)</p>
<p>This component is likely some sort of power transistor, but the markings a very small and hard to read because of the reflection from the conformal coating.</p> <pre><code>package: SOT223 (black 3-pin SMT package with cooling flange) markings: IY20903 (very uncertain about this, very hard to read) newline 112115 pcb-id: LIC110 (visible in photo below pin1 of component) </code></pre> <p>Please have a look and see if you can identify it. I had no luck with many online searches. Thanks.</p> <p><a href="https://i.stack.imgur.com/GYSpU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GYSpU.jpg" alt="enter image description here" /></a></p>
identify surface mount component: SOT223 marked IY20903 newline 112115
2023-12-28T06:09:00.753
695630
|resistors|impedance|
<p>It helps stabilize the output of the DAC - it doesn't like capacitive loads. The resistor decouples the capacitive loading from the &quot;VIN&quot; pin on the chip on the right. Same trick is done with op-amps driving capacitive loads. Without it, you will see ringing when the DAC output changes voltage state.</p>
<p><a href="https://i.stack.imgur.com/RXipg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RXipg.png" alt="enter image description here" /></a> There is an integrated circuit(<a href="https://www.ti.com/lit/gpn/xtr111" rel="nofollow noreferrer">xtr111 datasheet</a>) with a 0 to 5 volt input range (The 0-5 volt signal is applied as DC. That is, the signal does not change constantly and quickly.)and the pin has high impedance input. In the sample diagrams (<a href="https://www.ti.com/lit/df/tidrrp9/tidrrp9.pdf?ts=1703753159048&amp;ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FTIDA-01471" rel="nofollow noreferrer">Reference design </a>), a 10k resistor is connected serial in front of the pin, . Is there a reason for this?</p> <p>My thoughts are that it does not related about current limiting because of the input has high input impedance. ı think its related about Filtering and Noise Reduction:</p> <p>Together with any capacitance at the input, the resistor forms a low-pass filter that can help reduce high-frequency noise and interference from reaching the sensitive input of the IC. Could this be due to the parasitic capacitance on the PCB providing a low pass filter and input stability? am ı wrong?</p> <p>Signal is VOUT pin come from <a href="https://www.ti.com/lit/ds/symlink/dac5311.pdf?ts=1703670881270" rel="nofollow noreferrer">dac5311</a></p>
Series resistor connected to the high impedance input pin of the integrated circuit
2023-12-28T08:33:20.233
695633
|transformer|power-electronics|ferrite|
<blockquote> <p><em>i need more than one BP curve (for different freq.) for loss estimation. But in datasheet there is for only one frequency, so don't know how to solve this?</em></p> </blockquote> <p>You can use this graph to estimate the losses at different frequencies: -</p> <p><a href="https://i.stack.imgur.com/et7PH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/et7PH.png" alt="enter image description here" /></a></p> <p>I've marked on the graph where 100 kHz is for regular magnetic permeability (solid line) and the loss associated with it (dotted line). So, if your operating frequency was (say) 300 kHz, I would expect the losses to rise by 50/23 or 2.17 times.</p>
<p>i need more than one BP curve (for different freq.) for loss estimation. But in datasheet there is for only one frequency, so dont know how to solve this? Without mailing distributor, that will be last case. <a href="https://semic.cz/!old/files/pdf_www/CF297.pdf" rel="nofollow noreferrer">https://semic.cz/!old/files/pdf_www/CF297.pdf</a> Thanks a lot! Or if you know where i can download libraries for this (or other way how to solve this), which will contain material CF297/N97 i would appreciate that! thanks <a href="https://i.stack.imgur.com/PM5QF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PM5QF.png" alt="enter image description here" /></a></p>
Ferrite cores ANSYS MAXWELL - where to find more BP curves?
2023-12-28T08:51:28.117
695638
|switch-mode-power-supply|
<p>I believe what you see are two diodes in parallel with a snubber network across them: -</p> <p><img src="https://i.stack.imgur.com/Pu74M.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fPu74M.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p> <blockquote> <p><em>What could possibly the purpose of such circuit? Where can I read more about this?</em></p> </blockquote> <p>It's a half wave rectifier with a snubber. The snubber is likely present to reduce EMI emissions.</p>
<p>Pins + and - are the output pins of a transformer of the low side of a SMPS. Two diodes lead to a common output which leads to the final output voltage to the right. At the same time the same output creates some sort of loop.</p> <p>What could possibly the purpose of such circuit? Where can I read more about this?</p> <p>At first I thought that it's there to discharge the capacitors but that's not the case.</p> <p><a href="https://i.stack.imgur.com/n0Ggk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n0Ggk.jpg" alt="enter image description here" /></a></p>
Double diode loop explanation
2023-12-28T09:18:59.870
695641
|identification|
<p>These are commonly known as Berg jumpers after the company that popularized them. They’re the 2 pin variety of the more generic <a href="https://en.wikipedia.org/wiki/Berg_connector" rel="nofollow noreferrer">Berg connector</a> which can have more contacts, for example the power cable connector commonly used on older floppy drives.</p>
<p>Can someone tell me the name and the function of the following component please?</p> <p><a href="https://i.stack.imgur.com/Nx06M.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Nx06M.jpg" alt="1" /></a></p> <p><a href="https://i.stack.imgur.com/REhje.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/REhje.jpg" alt="2" /></a></p>
What is the name of this black, 2-pin, 0.1" spacing, leadless socket and what is it used for?
2023-12-28T09:38:31.533
695666
|bluetooth-low-energy|nordic|
<p>BLE has 40 operating channels, 37 of them for data exchange, and 3 for advertising. When advertising, the BLE peripheral broadcasts a very short (few mSec) packet on each of the 3 channels in sequence. The BLE central device can only receive one channel at a time, so it scans the 3 frequencies in sequence. It has to spend a fair amount of time listening on each channel in order to pick up the short advertising pulse, and depending on the advertising and scanning timing parameters, it could take several seconds to pick up the peripheral's pulse.</p> <p>If you set up 3 BLE devices, each programmed to continuously receive one of the 3 advertising channels, the system would pick up the advertising immediately, avoiding the typical lag when scanning. It's not a practical design for a battery-powered device, but if you really need to pick up every advertisement immediately, that would do it.</p> <p>There's only a small advantage to using 3 devices. If you set up just one device, listening on just one of the advertising channels, it would pick up the advertisement within a few mSec of the more elaborate 3-device setup.</p>
<p>Nordic provides hardware, firmware and software to sniff BLE in conjuction with Wireshark:</p> <ul> <li><a href="https://www.nordicsemi.com/Products/Development-hardware/nRF52840-Dongle" rel="nofollow noreferrer">https://www.nordicsemi.com/Products/Development-hardware/nRF52840-Dongle</a></li> <li><a href="https://infocenter.nordicsemi.com/index.jsp?topic=/ug_nrf52840_dongle/UG/nrf52840_Dongle/getting_started.html" rel="nofollow noreferrer">https://infocenter.nordicsemi.com/index.jsp?topic=/ug_nrf52840_dongle/UG/nrf52840_Dongle/getting_started.html</a></li> <li><a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le" rel="nofollow noreferrer">https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le</a></li> <li><a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html" rel="nofollow noreferrer">https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html</a></li> <li><a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/capturing_multiple.html" rel="nofollow noreferrer">https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/capturing_multiple.html</a></li> </ul> <p>It supports using multiple hardware interfaces. I thought I'd read some time ago that this would be advantageous for sniffing BLE due to channel hopping or something similar, and I have the number three (interfaces) stuck in my head - but I can't seem to find any info on this, so:</p> <ul> <li>what are the advantages of multiple interfaces for sniffing BLE in this context?</li> <li>does the documentation recommend a number of interfaces, if so, where?</li> </ul>
Sniffing BLE with multiple NRF52840-DONGLEs?
2023-12-28T14:57:49.110
695673
|pwm|thermal|high-current|powermosfet|
<p><strong>FET choice</strong></p> <ol> <li><p>TO220 <a href="https://www.infineon.com/dgdl/Infineon-IRF3205-DataSheet-v01_01-EN.pdf?fileId=5546d462533600a4015355def244190a" rel="nofollow noreferrer">IRF3205</a>: 55V RdsON=8mOhm Qg=146nC</p> </li> <li><p>TO220 <a href="https://www.ti.com/lit/ds/symlink/csd18510kcs.pdf" rel="nofollow noreferrer">CSD18510KCS</a>: 40V 1.7mOhm Qg=75nC</p> </li> <li><p>TO220 <a href="https://www.ti.com/lit/ds/symlink/csd18535kcs.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&amp;ts=1703781233002&amp;ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Fcsd18535kcs" rel="nofollow noreferrer">CSD18535KCS</a>: 60V 2.0mOhm Qg=about 40nC</p> </li> <li><p>SMD <a href="https://www.st.com/resource/en/datasheet/stl260n4lf7.pdf" rel="nofollow noreferrer">STL260N4LF7</a>: 40V 1.1mOhm Qg=42nC</p> </li> </ol> <p>By using a more modern MOSFET, you can have much lower RdsON, which means much lower losses, and a lower gate drive current due to lower Qg.</p> <p>Even if these are more expensive than IRF3205, total cost will be lower due to savings on cooling.</p> <p>Let's try the SMD MOSFET, 10 in parallel. 1.34W conduction losses per FET: you can mount your PCB on a heat sink and cool it from the back with a squishy pad.</p> <p>With TO220 I'd pick #3, 10 in parallel. 2.45W conduction losses per FET, so total 24.5W, much easier to cool also.</p> <p><strong>Freewheeling diode</strong></p> <p>Then you need either a freewheeling diode or synchronous MOSFETs. Conduction losses in these are calculated differently, because while they have to take the whole current, when they do so the duty cycle is much lower.</p> <ul> <li><p>D = Duty Cycle [0..1]</p> </li> <li><p>Current in switch FETs: I=350A*D with duty cycle D</p> </li> <li><p>Current in sync FETs or diode: I=350A*D with duty cycle (1-D)</p> </li> </ul> <p>Using Schottky diodes, dissipation is Vf<em>I</em>(1-D), maximum is at 50% duty cycle. With 0.5V Vf maximum total dissipation is 44W!</p> <p>Using MOSFETs, dissipation is RdsON<em>I^2</em>(1-D), so the maximum is not at 50% duty cycle, but around 66%. With 4 parallel 2mOhm FETs, maximum total dissipation is 9W, much more reasonable.</p> <p><strong>Gate drive</strong></p> <p>For FETs #3 I used 40nC gate charge from the gate charge curve. With 10 FETs that's 400nC. With 4A gate current it should switch in 100ns which is reasonable.</p> <p>Switching losses estimation: Frequency . I . V . Qg/Ig</p> <p>70kHz -&gt; 58W</p> <p>Thus a lower frequency would be preferable, like a few kHz. If it sounds too whiny, you can always randomize the PWM period. To switch faster would require a ridiculously high gate current for all these MOSFETs: this would need several drivers, which introduces the problem of skew.</p> <p>Going with synchronous MOSFETs, one driver for all, I looked for a driver with adaptive dead time or at least anti cross conduction, because it's always nice when your MOSFETs don't get shot into orbit due to a software bug in the PWM dead time.</p> <p><a href="https://www.onsemi.com/pdf/datasheet/ncp5183-d.pdf" rel="nofollow noreferrer">NCP5183</a> - No protection</p> <p><a href="https://www.ti.com/lit/ds/symlink/ucc27282.pdf?ts=1703739071638" rel="nofollow noreferrer">UCC27282</a> <a href="https://www.ti.com/lit/ds/symlink/ucc27301a-q1.pdf?ts=1703783599218&amp;ref_url=https%253A%252F%252Fwww.ti.com%252Fpower-management%252Fgate-drivers%252Fhalf-bridge-drivers%252Fproducts.html" rel="nofollow noreferrer">UCC27301A</a> - Shoot through prevention</p> <p><a href="https://www.renesas.com/us/en/document/dst/isl78424-isl78434-isl78444-datasheet?r=498611" rel="nofollow noreferrer">ISL784x4</a> - Automatic dead time</p> <blockquote> <p>I had an idea to use a Peltier for active cooling, but I really have no idea how to calculate the actual or approximate values.</p> </blockquote> <p>Peltier coolers will cool below ambient but the efficiency is very low, so your heat sink now has to get larger to get rid of the original heat from the MOSFETs <strong>and</strong> all the power used by the Peltier to transport the heat. Simple and robust is good: a chunk of aluminium is pretty reliable.</p> <p>You need a temperature sensor.</p> <p>Many MOSFETs mean the heat will be well spread over a large area, making the heat sink more efficient. You may need a small fan.</p> <p>You will also need some pretty thick copper and bus bars.</p> <blockquote> <p>One additional problem. Is there a way to limit such high currents if a single MOSFET got much higher load</p> </blockquote> <p>RdsON increases with temperature, so the hotter FET will conduct less current.</p> <p>If you try to control each FET individually to share current then you have a new problem: they still have to switch at the exact same time, so any extra complication in the control circuit adding skew will be a problem.</p> <p>All trace and bus resistances should be the same for all FETs. If the FETs are in a line, this means the input should be on one side, the output on the other side, and equal amounts of copper for both. Basically all FETs should have equal resistance including copper connections, traces, etc. Otherwise the FETs located closer to the power supply will get more current. Likewise, driver in the middle and short tracks to the gates for minimum skew. One gate resistor per FET, otherwise they can oscillate.</p> <p>With diodes, it's the opposite: Vf has a negative tempco, which goes against current sharing.</p> <blockquote> <p>I was planing on taking the back emf from the inductors and using it to implement a regenerative breaking by charging a capacitor and then a charging circuit will utilize this power.</p> </blockquote> <p>If you use synchronous MOSFETs instead of diodes, you can have regenerative braking. In this case, braking recharges the battery: the pair of synchronous FETs act as a buck converter when accelerating, but when braking the current changes direction so they act as a boost converter from motor to battery.</p> <p>In case the battery is disconnected during braking (or its voltage is too high so it can't accept charge current) this will dump braking energy into the supply bus capacitors on your board. The controller must be smart enough to detect an unsafe increase on the supply bus due to regen braking, and switch instead to shorting the motor using the synchronous MOSFET. In this case braking power is lower, but the energy is dissipated in the motor's internal resistance, which is fine. An alternative is to use a resistor to dump the excess power, but it is going to be large, heavy and expensive.</p> <p>Here's a bit of <a href="https://pastebin.com/D9zRMDBB" rel="nofollow noreferrer">python code</a> for plotting dissipation versus number of MOSFETs and RdsON. It only takes into account conduction losses though, no switching losses.</p>
<p>I'm designing a brushed DC motor controller for an 8.3 kW, 24 V, 350 A forklift motor.</p> <p>I will be controlling only one direction so I'm using a 70 kHz PWM from an MCU.</p> <p>The circuit will be a push-pull transistor pair (TIP122 and TIP126) for driving the IRF3205 MOSFET. The circuit will consist of 12 parallel MOSFETs and their drivers.</p> <p><a href="https://i.stack.imgur.com/3zFAy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3zFAy.png" alt="enter image description here" /></a></p> <p>Note: Here I used BD140 and 139. This wouldn't be used, it is just for my first test.</p> <p>How should I do proper thermal management? Is there anything wrong with my idea?</p> <p>I have calculated the heat that needs to be dissipated which is (Rdson * I^2) = 0.008*30^2 = 7.2 W and since I'm using 12 it will be 86.4 W of heat. I want to ensure the junction doesn't heat much above 100°C. Ambient worst case would be 50°C so in free air about 1 W would make the junction reach 112.5°C, I had an idea to use a Peltier for active cooling, but I really have no idea how to calculate the actual or approximate values.</p> <p>I also don't know if my design is sufficient. I want to test this design at home and I don't have anyway of putting such a high load nor do I have a supply that can deliver such power. I believe MOSFETs behave differently when the load is higher. I can try a single MOSFET at 30 A and then parallel them, but I want to know how can I view the time it takes to saturation and cut off on an oscilloscope. I'm using a Siglent SDS1104X-E.</p> <p>One additional problem. Is there a way to limit such high currents if a single MOSFET got much higher load, without putting the MOSFET in active region as that would increase losses and thus the heat generated? I thought about changing the PWM frequency. Is this practical?</p> <p>Note: I will be implementing much more in the circuit like fault detection and swapping MOSFETs and monitoring the current and heat of the MOSFETs and much more but I want to ensure the basic circuit is functional first.</p>
8.3 kW DC brushed motor controller thermal management
2023-12-28T15:33:29.743
695693
|power-electronics|simulation|
<p>Try using different solver settings. Put in series resistance across all inductors and switches (estimate wire resistance and put it in the simulation). Also you probably need to put in a real diode model instead of the default one.</p>
<p>Whole day i am trying to simulate this converter to get current for transformer windings which will be than used for simulation (core + copper losses). But i am just not able to get this working. I was trying to change settings of transient simulation according to twinbuilder built in documentation, but no results were achieved. EDIT: I though issue are diodes, but i have figure out that there is need for Mutual inductance between secondary windings in this case &quot;M3&quot;.<br /> <a href="https://i.stack.imgur.com/L6K0X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L6K0X.png" alt="enter image description here" /></a></p>
ANSYS - transformer issue (Convergence not achieved)
2023-12-28T17:55:33.507
695706
|capacitor|diodes|diode-clamp|ideal|
<blockquote> <p>That is when the source voltage declines from its peak to 0 the right terminal of the capacitor must decline to 0 as well since the other branch is short circuited and current won't flow through the resistor.</p> </blockquote> <p>That's the source of your confusion. You are correct that at peak input voltage the left side of C8 is at +20 V and the right side at 0 V. As the left side starts to fall the voltage across the capacitor tends to remain constant so the right side will fall from 0 V to a negative value. If R26 is a very high value the output voltage would reach -40 V. In practice the load resistor will be taking some charge from the capacitor and you won't get the full 40 V.</p> <p>This is a very simple voltage-doubler circuit.</p> <p>Add the output voltage to the trace and watch the first few cycles after power on. You can also watch what happens if you power on at positive-going zero-cross, negative-going or at 90° or 270°.</p> <hr /> <p>From the comments:</p> <blockquote> <p>still have a slight confusion....if capacitance is high then when the left terminal is about to increase from 0 to 20V but due to it beinh capacitor it should obstruct the change of Vc so shouldn't right terminal rise from 0V? and this causes forward bias?</p> </blockquote> <p><img src="https://i.stack.imgur.com/IDEPB.png" alt="schematic" /></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fIDEPB.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p> <p><em>Figure 1. Simulation circuit.</em></p> <p><a href="https://i.stack.imgur.com/6v2gg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6v2gg.png" alt="enter image description here" /></a></p> <p><em>Figure 2. Blue: input. Orange: output.</em></p> <ul> <li>Note that the output starts to follow the rising input at 0° but soon D1 is forward biased and so it gets clamped at 0.7 V.</li> <li>At 90° the input has reached peak and now starts to decrease. It can be seen that the output voltage starts to go down with the input. The traces now stabilise with almost 40 V across C1. (The &quot;almost&quot; is because D1 is costing 0.7 V and there will be a small discharge of C1 through R1.)</li> </ul>
<p>I'm currently having problem in understanding the dynamics of capacitor when it is in connection with an ideal diode. In the circuit below we can see a sinusoidal source of 40V peak to peak and a frequency of 1000.</p> <p><a href="https://i.stack.imgur.com/EMe3Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EMe3Q.png" alt="enter image description here" /></a></p> <p>This picture below is the source voltage. <a href="https://i.stack.imgur.com/mNsen.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mNsen.png" alt="enter image description here" /></a> Now my actually query is that, when we are working with clamper the capacitor must have a potential difference across its terminals which is equal to the input voltage which is 20V for this case.</p> <p>Since we are thinking about ideal diode(although PSPICE does not have any ideal diode source but it works as the exponential model) and ideal source(as PSPICE works with sources). When the source voltage is in positive cycle the diode is in forward bias and that branch happens to act as a short circuit. So the right terminal of the capacitor must have 0V potential as it is in short circuit with ground and the left terminal adjusts itself with the supplied source voltage. Once the input voltage reaches its peak the potential difference across the capacitor is 20V and normally the clamping capacitor should maintain that 20V potential difference throughout. But here is where I am facing problem grasping its dynamics. That is when the source voltage declines from its peak to 0 the right terminal of the capacitor must decline to 0 as well since the other branch is short circuited and current won't flow through the resistor. So when the input voltage reaches back to 0V the potential difference across the capacitor also declines to 0V. Then how are we able to clamp the circuit?</p> <p>Well there might be some misconceptions regarding my assumptions. I am not quite sure if these are the misunderstanding regarding my question or not. That is we are assuming that the source is ideal which is an impractical assumption. So in reality the source has internal resistance so it adjusts itself in such a way that even though the diode is in forward bias the capacitor is able to maintain that potential difference. Again the PSPICE model works quite well because the diode isn't ideal so it adjusts itself with the supplied voltage.</p> <p>I hope I am able to interprete my query.</p>
How does clamping circuit work when ideal diode is used?
2023-12-28T21:04:04.123
695716
|power|redundancy|
<p>If you have two independent fans and two independent 12 V sources, then try this:</p> <p>Source #1 powers both fan #1 and the relay.</p> <p>The relay NO (Normally Closed) contacts go between source #2 and fan #2.</p> <p>When Fan #1 is up and running, the relay coil is energized, holding the NC contacts open. When source #1 is off, the NC contacts close, completing the circuit from source #2 to fan #2.</p> <p>UPDATE:</p> <blockquote> <p>if I pull the power from FAN 1, FAN2 should kick in and be powered.</p> </blockquote> <p>Here is a schematic of my reading of your requirements. Turning off or unplugging Source #1 enables power to Fan #2.</p> <p><a href="https://i.stack.imgur.com/pGojm.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pGojm.gif" alt="enter image description here" /></a></p>
<p>Trying to learn electronics.</p> <p>I am thinking about trying to create a circuit that has 2 DC fans with independent power sources. Only 1 will be working at any one time.</p> <p>It will sit on my desk and cool me and my coworkers down on a warm day :). And if I pull the power from FAN 1, FAN2 should kick in and be powered.</p> <p>I tried with 2 cheapy 12 V fans from aliexpress... I tried with a relay and an l9110 but am not sure how to implement the 'if this one fails, that one gets power'.</p> <p>I don't need to do it with these parts, it's just the parts I tried and have. So I am willing to purchase new components.</p> <p>Can you point me in the direction of the right components?</p>
Redundant Power Supply for a DC Fan
2023-12-28T22:04:57.857
695720
|communication|modulation|power-line-communication|
<blockquote> <p>For the AC power to be viable as a power source, I would assume that the frequency and amplitude needs to be steady.</p> </blockquote> <p>The fundamental frequency is quite steady - much better than 1% in the US grid. But the harmonic content is highly variable. High frequency additions due to data transmission are of no significance in relation to the primary function of power delivery.</p> <p>I’ve seen the mains waveform anywhere between a visually perfect sine wave to something that looked like it was drawn by a drunk person. In both of those limiting cases, the data transmission signal would be too small to see on an oscilloscope time domain display. Of course it would be easy to see on a log (dB)-scale frequency domain display of a spectrum analyzer.</p> <p>As an aside, almost anything modern and electronic can run from DC and is slightly more efficient that way. So the exact mains waveform is of no big importance as long as the polarity changes are not too slow. A square wave works from day 40Hz down to 0Hz. Above 40Hz up to about 400Hz, a “sine wave”, even highly distorted one, works fine. That’s because the AC mains gets directly rectified in modern power supplies - it doesn’t feed a transformer at mains frequency. Universal motors also work fine at DC mains (hence their name!). The devices that need mains between 50-60Hz are induction and synchronous motors, and devices with a mains-transformer-based power supplies. The latter - transformer-based supplies - will usually work OK up to 400Hz, with the rectifier getting more efficient as the frequency goes up.</p>
<p>[I am not an EE so bear with me with this] I've been learning about power line communication and see that it is mainly achieved by modulating the carrier signal (for this discussion let's say that's 60Hz AC power). For the AC power to be viable as a power source, I would assume that the frequency and amplitude needs to be steady. Therefore, if you modulate the freq. or amplitude of this signal, then I would think that would basically eliminate it as a viable power source. How is PLC possible without eliminating the line as a viable source?</p>
How is power line communication (PLC) possible without screwing up the line as a viable power source?
2023-12-29T00:03:53.370
695724
|transistors|identification|
<p>The part marked <code>SB</code> is a <a href="https://www.mouser.com/datasheet/2/149/BSS123L-469259.pdf" rel="noreferrer">Fairchild (now Onsemi) BSS123L</a> N-channel MOSFET.</p> <p><a href="https://i.stack.imgur.com/xL7cy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xL7cy.png" alt="enter image description here" /></a></p> <p>The markings were changed on newer parts, but we can see in the following picture of a Onsemi <a href="https://www.mouser.com/PCN/onsemi_Final_PCN_Document_PB22130XA_%2810%29.pdf" rel="noreferrer">product bulletin</a> that Fairchild/Onsemi used this marking style in the past:</p> <p><a href="https://i.stack.imgur.com/8XVPf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8XVPf.png" alt="enter image description here" /></a></p> <p>(Source: <a href="https://www.mouser.com/PCN/onsemi_Final_PCN_Document_PB22130XA_%2810%29.pdf" rel="noreferrer">mouser.com</a>)</p> <hr /> <p>Since the second part uses a similar marking style, it's likely a <a href="https://pdf1.alldatasheet.net/datasheet-pdf/view-marking/50818/FAIRCHILD/BSS84.html" rel="noreferrer">Fairchild/Onsemi BSS84</a> P-channel MOSFET.</p> <p><a href="https://i.stack.imgur.com/N4xve.png" rel="noreferrer"><img src="https://i.stack.imgur.com/N4xve.png" alt="enter image description here" /></a></p>
<p>I'm trying to identify 2 transistors, Q15 marked 'SP' and Q16 marked '!SB'.</p> <p><a href="https://i.stack.imgur.com/0fwN0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0fwN0.jpg" alt="enter image description here" /></a></p>
What are the 2 transistors with markings SP and !SB?
2023-12-29T01:11:43.530
695729
|voltage|power|diodes|zener|
<blockquote> <p>I'm not sure if the Zener during breakdown will pass the full VCC voltage, or if it'll pass (VCC - 3.3V)?</p> </blockquote> <p>The voltage at the anode of the Zener diode will be <span class="math-container">\$V_{CC}\$</span>-3.3 V, assuming <span class="math-container">\$V_{CC}\ge\$</span> 3.3 V.</p>
<p>I'm designing a circuit where there is an analog switch that turns a load on. I specifically need the load to turn on only when the voltage is above a certain level. The analog switch takes VCC and an enable pin that closes the switch when pulled high (0.7 x VCC) and opens the switch when low (0.3 x VCC.) Specifically, I want this switch to close when voltages are above 3.3V and open when below 3.3V.</p> <p>A very simplified schematic is below, but effectively, I am using a Zener diode on the enable pin with a Zener voltage of 3.3V. My thinking is, when VCC &gt; 3.3V, the Zener is in breakdown and the enable pin will see 3.3V (or around there accounting for minor voltage drop). When VCC &lt; 3.3V, the pulldown will bring the enable pin low.</p> <p><a href="https://i.stack.imgur.com/elp2q.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/elp2q.jpg" alt="enter image description here" /></a></p> <p>I'm definitely a bit iffy on this solution, though. I've not seen anywhere discussing the voltage at the anode of the Zener. I'm not sure if the Zener during breakdown will pass the full VCC voltage, or if it'll pass (VCC - 3.3V.)</p> <p>I'm also aware that Zeners are not very accurate - but my application really does not need exactness, anywhere +/- 10-15% is fine. I just need some kind of &quot;trigger&quot; effectively.</p>
Zener diode - What voltage at the anode at breakdown?
2023-12-29T05:04:47.647
695730
|microchip|mplabx|xc32|
<p>This answer, in particular, answers the question <strong>How to renew your paid Pro license when it has expired or is about to expire</strong>.</p> <p>It turns out that Microchip's license renewal server was down. Microchip said (see below):</p> <blockquote> <p>It was caused due to an overzealous firewall rule on our server, which blocked all incoming traffic.</p> </blockquote> <h2>Work-around: free license</h2> <p>As a workaround in case this ever happens again, you can follow my instructions right now to install a permanent free license you can use in the event your pro license is expired and cannot be renewed due to the license server being down: <a href="https://electronics.stackexchange.com/a/696172/26234">How do I make my Microchip MPLAB X IDE project use the free version of the XC32 compiler?</a>.</p> <p>Trial and error tells me that if you have this free license installed at the same time as your paid Pro license, the IDE will try to always use your paid Pro license even if it is expired and not working. In that case, you can temporarily move your paid Pro license out of the license directory to disable it. The paid Pro license file is located here:</p> <ul> <li>Windows - <code>%SystemDrive%\ProgramData\Microchip\xclm\license\microchip-1.lic</code></li> <li>Mac - <code>/Library/Application\ Support/microchip/xclm/license/microchip-1.lic</code></li> <li>Linux - <code>/opt/microchip/xclm/license/microchip-1.lic</code></li> </ul> <p>Again, just move it out of that directory, while leaving only the free <code>xc32fpp-1.lic</code> file there instead, to use the free license.</p> <h2>Microchip's response to my support case</h2> <p>Microchip replied to my support request on 30 Dec. 2023 12:15pm with the following message:</p> <blockquote> <p>Hi Gabriel,</p> <p>We are aware of issues with the page and have reported this to the respective team.</p> <p>While we work through this case, you may use the attached PRO Mode workstation license.</p> <p>The PRO Mode license will allow you to use the compiler in PRO Mode.</p> <p>Download the zip file, unzip it, locate the &quot;.bat&quot; file; and double click on it to run the batch file (for Windows machine).</p> <p>Run the script corresponding to your OS, if you are using Linux or Mac.</p> <p>This will create a license file in the license folder on the machine and activate the compiler with PRO Mode Optimizations.</p> <p>Path of License directory on different OS's:</p> <ul> <li>Windows 10/8/7 - <code>%SystemDrive%\ProgramData\Microchip\xclm\license</code></li> <li>Mac - <code>/Library/Application\ Support/microchip/xclm/license</code></li> <li>Linux - <code>/opt/microchip/xclm/license</code></li> </ul> <p>This will activate the compiler on your machine with PRO Mode Optimizations.</p> <p>Regards,</p> <p>[name]</p> </blockquote> <p>The zip file they sent me includes license files for Windows, Mac, and Linux, for all 3 compilers: XC8, XC16, and XC32, which work with <em>any</em> host ID (the license files contain <code>hostid=ANY</code>) and expire on 29 Jan. 2024.</p> <p>Installing the license file on Linux installed license file <code>microchip-1.lic</code> at <code>/opt/microchip/xclm/license/microchip-1.lic</code>.</p> <p>On 2 Jan. 2024 10:39am they then followed up again and said:</p> <blockquote> <p>Hi Gabriel,</p> <p>The issue is now fixed. It was caused due to an overzealous firewall rule on our server, which blocked all incoming traffic.</p> <p>Thanks,</p> <p>[name]</p> </blockquote> <p>Despite my frustration, that's pretty good support.</p> <h2>How to renew your paid Microchip XC32 Compiler Pro license when it has expired or is about to expire</h2> <p>(and now that the license server is back up)</p> <p>First off, installing the pro license they gave me above does work. It expires on 24 Jan. 2024, however, as can be seen by opening the installed license file in a text editor.</p> <p>I tried putting my old Pro license file back to see if it would auto-renew, but it didn't. It doesn't work.</p> <p>So, I have to re-download and re-install my paid Pro license.</p> <h4>Steps to renew your paid Pro XC32 compiler license</h4> <h4>Quick summary</h4> <ol> <li>Once your license auto-renewal has been paid, go here and re-download your license: <a href="https://www.microchipdirect.com/software-products" rel="nofollow noreferrer">https://www.microchipdirect.com/software-products</a>. <ol> <li>The new license has a new expiration date built into it, so a new, renewed license file must be manually downloaded and installed every month.</li> </ol> </li> <li>Extract the zip file, and run the executable inside it which corresponds to your OS. <ol> <li>The 3 license installer files are: <pre><code>linux.sh mac.sh windows.bat </code></pre> </li> <li>For Linux, that would look like this: <pre class="lang-bash prettyprint-override"><code>cd path/to/extracted/dir chmod +x linux.sh # make the Linux license file installer executable ./linux.sh # run it (do *not* use `sudo`!) </code></pre> </li> </ol> </li> <li>Done! <ol> <li>The new license key has been installed at <code>/opt/microchip/xclm/license/microchip-1.lic</code> on Linux, or at <code>C:\ProgramData\Microchip\xclm\license\microchip-1.lic</code> on Windows, where the <code>-1</code> part of <code>microchip-1.lic</code> is an automatically-incrementing number.</li> <li>On both Linux and Windows, you must delete or remove the old license files to make the latest one get used. I simply created a <code>DISABLED</code> dir at <code>/opt/microchip/xclm/license/DISABLED</code> on Linux, and <code>C:\ProgramData\Microchip\xclm\license\DISABLED</code> on Windows, and drug all of the old license files into it to &quot;disable&quot; them.</li> <li>Close and re-open the IDE. <ol> <li>This appears to be <em>not required</em> actually, on both Linux and Windows, but is not a bad idea to do it anyway.</li> </ol> </li> </ol> </li> </ol> <h4>Details</h4> <ol> <li><p>Open your expired <code>microchip-1.lic</code> license file at the paths shown above and look for the license key in it to see which license key you are using with this license. Look for this line:</p> <pre><code>hostid=112233445566 issued=17-nov-2023 options=1111-2222-3333-4423 </code></pre> <p>The <code>options</code> field is your license key.</p> </li> <li><p>Go here to manage your paid license subscriptions / &quot;Software Products&quot;: <a href="https://www.microchipdirect.com/software-products" rel="nofollow noreferrer">https://www.microchipdirect.com/software-products</a>. You'll have to sign in.</p> <p>Here's what I see. Find the license key which matches your license file above. I've circled mine here:</p> <p><a href="https://i.stack.imgur.com/AKO2P.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AKO2P.jpg" alt="enter image description here" /></a></p> </li> <li><p>Click the &quot;Download License&quot; button for that license.</p> <p>That will open this window. You'll see your license key in the URL at the top, and your Host ID listed under &quot;Existing Machines&quot;.</p> <p>If your license key is <code>1111-2222-3333-4423</code>, then the URL to that window is therefore: <a href="https://www.microchipdirect.com/GetLicense.aspx?id=1111-2222-3333-4423" rel="nofollow noreferrer">https://www.microchipdirect.com/GetLicense.aspx?id=1111-2222-3333-4423</a></p> <p><a href="https://i.stack.imgur.com/FNcWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FNcWm.png" alt="enter image description here" /></a></p> </li> <li><p>Verify that the &quot;Host ID&quot; listed in the window above matches the Host ID of your machine, as shown by <code>xclm -hostinfo</code> at the command-line.</p> <p>If you use the wrong host ID, the license will fail to work in the end and you'll get this error when you try to build:</p> <pre><code>error: MPLAB XC32 C++ license not activated </code></pre> <p>If the &quot;Host ID&quot; listed in the window above matches the host ID of your machine, continue to the next step.</p> <p>If it doesn't, it means either your license file is for a different machine, <em>or</em> the <code>xclm</code> tool is showing a different Host ID this time, which is possible, because it is a buggy tool and your Host ID is really just the MAC address (with<em>out</em> the colons) of one of your several network interfaces, which can change if you use USB dongles or have an Ethernet card <em>and</em> a WiFi adapter. If that's the case, you might have to email Microchip for support to change or re-register this license key. I'm not sure. In the MPLAB X IDE you can also go to Tools --&gt; Licenses --&gt; Activate Workstation License, which brings you here, to <strong>register and activate your license for the first time</strong>, which you would have already done before: <a href="https://www.microchip.com/rlmmigrationtool/GetXCLicense.aspx" rel="nofollow noreferrer">https://www.microchip.com/rlmmigrationtool/GetXCLicense.aspx</a>. I don't know if it will let you re-register your license key here. I think it will <em>not</em>, and Microchip will have to help you.</p> <p>You can see all of your MAC addresses on your system, to see if <em>one</em> of them matches your &quot;Host ID&quot; shown in the browser window above, as follows:</p> <pre class="lang-bash prettyprint-override"><code># Linux, in the terminal ip link show | grep ether # Windows, in the Command Prompt (cmd.exe) ipconfig /all | findstr &quot;Physical Address&quot; </code></pre> </li> <li><p>In the window above, click the &quot;Download License&quot; button.</p> <p>This will give you a .zip file with the Host ID in its name, such as <code>112233445566.zip</code>.</p> </li> <li><p>Extract the zip file, and run the executable inside it which corresponds to your OS.</p> <p>Ex: for Linux:</p> <pre class="lang-bash prettyprint-override"><code>cd 112233445566 # change directories into the extracted dir chmod +x linux.sh # make it executable ./linux.sh # run it (do *not* use `sudo`!) </code></pre> </li> <li><p>Close and re-open your IDE.</p> <p>If using Git for version control, you should also refresh the project and ensure your <code>.gitignore</code> file is configured properly. See my step where I mention &quot;Refresh the project in the IDE&quot;, <a href="https://electronics.stackexchange.com/a/696172/26234">here, for details</a>.</p> </li> <li><p>Your XC32 Pro license file is now installed!</p> <p>You'll see it now in your license file directory. Here are the license files I now see in my <code>/opt/microchip/xclm/license</code> dir on Linux:</p> <pre class="lang-bash prettyprint-override"><code>microchip-1.lic # my old, expired XC32 Pro license microchip-2.lic # my new, valid XC32 Pro license I just installed! xc32fpp-1.lic # my FREE XC32 license I installed as a work-around </code></pre> <p>The free license allows compiling C and C++ with optimization levels <code>-O0</code> or <code>-O1</code>. For <code>-O2</code>, <code>-O3</code>, or <code>-Os</code>, you need the Pro license.</p> <p>Compilation now works, and the latest Pro license (<code>microchip-2.lic</code>) will automatically be used!</p> <p>You can now delete the old, expired license file, if you want, but there's really no need.</p> </li> <li><p>Check your license file expiration dates.</p> <p>Open each license file and look for this line:</p> <pre><code>LICENSE microchip swxc32-cpp 1.0 27-dec-2023 uncounted </code></pre> <p>The part just before the <code>uncounted</code> word is your license expiration date. This license expired 27 Dec. 2023.</p> <p>My new license expires 27 Jan. 2024, and the <code>xc32fpp-1.lic</code> is <code>permanent</code>, which means it never expires. It shows this:</p> <pre><code>LICENSE microchip swxc32-fpp 1.1 permanent uncounted </code></pre> </li> </ol> <h2>References</h2> <ol> <li>My answer: <a href="https://electronics.stackexchange.com/a/696172/26234">How do I make my Microchip MPLAB X IDE project use the free version of the XC32 compiler?</a></li> </ol> <h2>See also</h2> <ol> <li><a href="https://onlinedocs.microchip.com/oxy/GUID-7A7E8B19-1D3A-4880-88ED-ACA262E1EB09-en-US-1/GUID-4F00D32A-941E-4E46-8CA4-31B1FF3A334C.html" rel="nofollow noreferrer">Microchip: How to obtain a license file</a></li> </ol>
<p>I have two development computers, one is Windows 11, and one is Linux Ubuntu 22.04, each with their own Microchip XC32 compiler license activated for use in the MPLAB X IDE v6.10.</p> <p>Both licenses are auto-renewed and recently paid for, and worked for a while, but are no longer working. Both licenses now refuse to work, and erroneously state they are expired. Their initial 30 days or so <em>did</em> work for each of them, but their <em>renewals</em> did not. When I try to re-download either license, I get this error:</p> <blockquote> <p>Error has occured. Please try again.404~Error:-160:</p> </blockquote> <p>I've tried in the Chrome, Edge, and Firefox browsers.</p> <p>Here is the licensing error I get when I try to build:</p> <blockquote> <p>Subscription License has not been renewed - the activation server &quot;http://keyverify.microchip.com&quot; gave the unexpected result -160</p> <p>License has expired</p> </blockquote> <p>But again, both licenses <em>are</em> recently renewed, and the payments have fully processed, and I received email confirmations for their renewals.</p> <p>I just bought a 3rd license, brand new. I tried to download it. It gives the same error.</p> <p>Anyone else having license problems? Is the license server down? Any known issues or solutions?</p> <hr /> <p>I've created a support ticket, emailed, and called, for two days, and have reached nobody. I will report back what I eventually find. And, I've posted on the Microchip forum here: <a href="https://forum.microchip.com/s/topic/a5CV400000008DhMAI/t393468" rel="nofollow noreferrer">https://forum.microchip.com/s/topic/a5CV400000008DhMAI/t393468</a></p> <p>Screenshot of the error when I try to download the license:</p> <p><a href="https://i.stack.imgur.com/6nYwf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6nYwf.jpg" alt="enter image description here" /></a></p>
Microchip XC32 compiler license erroneously expiring and unable to download: `Error has occured. Please try again.404~Error:-160:`
2023-12-29T05:26:18.570
695731
|frequency|ultrasound|piezo|piezoelectricity|
<p>Use the transducer as the tuned element in a <a href="https://www.apogeeweb.net/article/147.html" rel="nofollow noreferrer">&quot;crystal&quot; oscillator</a> with no other resonant circuit. Check the output with an oscilloscope or frequency counter. A one-transistor <a href="https://www.tutorialspoint.com/sinusoidal_oscillators/sinusoidal_crystal_oscillators.htm" rel="nofollow noreferrer">Pierce oscillator</a> or <a href="https://eepower.com/technical-articles/introduction-to-quartz-crystal-oscillators/" rel="nofollow noreferrer">Colpitts oscillator</a> should work.</p> <p>You can also check the resonant frequency <em>in situ</em> that way, since placing the transducer in a cavity can shift the frequency, or make it prefer harmonics or subharmonics.</p> <p>For that matter, use the oscillator to drive the device in your application.</p>
<p>The crystal looks like in the given image I want to find the resonating frequency, whether is it variable or fixed.</p> <ol> <li>I find its manufacturer has not given much detail about it.</li> <li>Does a piezo resonate on a variable frequency or will it resonate on fixed frequency only?</li> </ol> <p><a href="https://i.stack.imgur.com/IfDnD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IfDnD.png" alt="Piezo Crystal Chip" /></a></p>
How can I find the resonating frequency of a piezo crystal?
2023-12-29T05:32:13.793
695734
|voltage|circuit-analysis|kirchhoffs-laws|nodal-analysis|
<blockquote> <p>we see that current can enter/exit only through nodes V1 and V3.</p> </blockquote> <p>False. It can exit via <span class="math-container">\$V_2\$</span> (through <span class="math-container">\$R_3\$</span>.)</p> <blockquote> <p>So,our KCL equation should read: <span class="math-container">\$\frac{V_1}{R_1}+\frac{V_3}{R_5}=0\$</span>.</p> </blockquote> <p>False. It would, however, be true to say that <span class="math-container">\$\frac{V_1}{R_1}+\frac{V_3}{R_5}+\frac{V_2}{R_3}=0\$</span>.</p> <blockquote> <p><em>we are able to ignore the resistances <span class="math-container">\$R_2,R_4\$</span></em>.</p> </blockquote> <p>False. You cannot, for the above reasons.</p> <p>You drew your red dashed circle, as you chose. If you look closely at its perimeter you can readily see that there are four exits, not two. These exits from your circle include <span class="math-container">\$R_2\$</span> and <span class="math-container">\$R_4\$</span>. So you don't get to just eliminate them at a whim. It will be true that the currents in all four resistors must total to zero. But you would need to know <span class="math-container">\$V_2\$</span> in order to work out the curents in <span class="math-container">\$R_2\$</span> and <span class="math-container">\$R_4\$</span>. Using your circle, <span class="math-container">\$\frac{V_1}{R_1}+\frac{V_1-V_2}{R_2}+\frac{V_3-V_2}{R_4}+\frac{V_3}{R_5}=0\$</span>. Not as simple as you put it.</p> <p>Instead, you may draw your supernode circle so that it surrounds the entire loop that includes <span class="math-container">\$R_2\$</span> and <span class="math-container">\$R_4\$</span> (those resistors you wanted to ignore) and, especially, <span class="math-container">\$V_2\$</span>. This is a different loop. But now it has only three exits. And this is why I said <span class="math-container">\$\frac{V_1}{R_1}+\frac{V_2}{R_3}+\frac{V_3}{R_5}=0\$</span> is true, which adds a necessary adjustment to your equation.</p> <p>Regardless, you need <span class="math-container">\$V_2\$</span> included in your solution approach.</p>
<p><a href="https://i.stack.imgur.com/yKm8o.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yKm8o.jpg" alt="enter image description here" /></a></p> <p>Here,as per the circuit,we can take <span class="math-container">\$V_1\$</span> and <span class="math-container">\$V_3\$</span> with the voltage source across them as a supernode(as the area marked in red). In the red marked portion i.e supernode,we see that current can enter/exit only through nodes <span class="math-container">\$V_1\$</span> and <span class="math-container">\$V_3\$</span>. So,our KCL equation should read: <span class="math-container">\$\frac{V_1}{R_1}+\frac{V_3}{R_5}=0\$</span>. But if we apply KCL individually at all three nodes and add the equations,we get <span class="math-container">\$\frac{V_1}{R_1}+\frac{V_2}{R_3}+\frac{V_3}{R_5}=0\$</span> which means our supernode should also consist of the node <span class="math-container">\$V_2\$</span> and <em>we are able to ignore the resistances <span class="math-container">\$R_2,R_4\$</span></em>. But how can we realize which nodes we have to include in the supernode after already having chosen two nodes? Surely writing all the KCL equations and adding them up will be a cumbersome task,so is there any way we can decipher which nodes which have to include in the supernode equation for KCL?</p>
Including resistance between supernodes
2023-12-29T06:03:11.020
695746
|pcb-design|ptc|
<p>If you want a simple solution, consider a <strong>thermostatic switch</strong>. These are passive devices, typically a bimetallic strip pushing a contact, often in a sealed package. Some are specifically designed for freeze protection in water pipes, and so have the thermal switching suitable for your application. A typical one I found opens on temperature rise: open by 7°C, close by 2°C, which may be exactly what you need. Connect with your heater chosen empirically.</p> <p>Many shapes and form factors are available: here's a typical pipe-mount one:</p> <p><a href="https://i.stack.imgur.com/jxipG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jxipG.png" alt="enter image description here" /></a></p> <p><em>From <a href="https://senasys.com/product/2570l439-34-epoxy-sealed-thermostat/" rel="nofollow noreferrer">Senasys</a>, which advertises its products for <a href="https://senasys.com/preventing-frozen-pipes/" rel="nofollow noreferrer">freeze protection</a>. Very many other industrial manufacturers produce comparable products.</em></p>
<p>I am trying to prevent the wind sensor from freezing - I know there are heated ones but they are not cheap. These versions have 1-4W heating, so I think it would be enough to have this range of heat dissipation. I have a 5V power source with enough power.</p> <p>I've come up with three options:</p> <ol> <li>PTC heater - the one I like best because it is sort of self regulating BUT it seems there are no elements with a 10-20˚C limit.</li> <li>Simple fixed resistor - this would heat up and use power even in very hot weather and could damage the part being heated. Not battery powered but don't want to waste power either.</li> <li>PCB with microcontroller, heating resistor, mosfet etc ....</li> </ol> <p>I would prefer simple to complex, but it seems there is no other option than the third. Are there any other options? How to prevent ice on the wind sensor properly?</p>
Something to prevent wind sensor from freezing
2023-12-29T08:55:23.313
695750
|resonance|
<blockquote> <p><em>Why does S-param resonance behavior differ from formula?</em></p> </blockquote> <p>Because you have not used the correct formula. You stated this: -</p> <blockquote> <p><em><span class="math-container">\$w0=\dfrac{1}{LC}=1GHz\$</span></em></p> </blockquote> <p>A more suitable formula is this (note the square root of L and C): -</p> <p><span class="math-container">$$\omega_0=\dfrac{1}{\sqrt{LC}}$$</span></p> <p>If you enter the values of 1 nF &amp; 1 nH you get a natural resonant frequency of 159.15 MHz. The above formula yields radians per second and, to get hertz, you must divide by <span class="math-container">\$2\pi\$</span>.</p>
<p>The general formula for resonance is <span class="math-container">\$w_0=\frac{1}{LC}\$</span> . A simulation was built with such inductor and capacitor so the resonance will be at 1GHZ.However as you can see in the result ,the plot shows a very small Q factor resonance and its resonating not at a frequency which differs the formula. Where did i go wrong?</p> <p><span class="math-container">$$ w_0=\frac{1}{LC}=1 GHz $$</span></p> <p><a href="https://i.stack.imgur.com/sxDj3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sxDj3.png" alt="ADS ADS schematics" /></a></p> <p><a href="https://i.stack.imgur.com/DvvSy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DvvSy.png" alt="ADS plot" /></a></p>
Why does S-param resonance behavior differ from formula?
2023-12-29T10:43:35.247
695754
|voltage|current|high-voltage|cables|testing|
<p>I have no experience in this sort of testing but I read it as follows:</p> <p><a href="https://i.stack.imgur.com/SyoHo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SyoHo.png" alt="enter image description here" /></a></p> <p><em>Figure 1. Testing a layer with even and odd number of cores. Image original.</em></p> <ul> <li>To test core to core insulation on a layer the polarity is reversed on each adjacent conductor as shown in (a). All the blues can be connected to one terminal and all the reds to the other. This allows testing of the whole layer in one test.</li> <li>In (b) which has an odd number of cores we can see that there are two blues side by side so they would not be stressed by the group test. As a result the first and last cores would need to be tested separately.</li> </ul>
<p>I was going through Indian standards for high voltage testing of multi core PVC insulated cables (Up to 1.1kV). Can someone please guide me with the following two points.</p> <p>A) Connection to be done in 12 core and 20 core cables?</p> <p>B) What is the purpose for the second point (for more than 4 cores) mentioned?</p> <p>Below is a snippet from the Indian standard:</p> <p><a href="https://i.stack.imgur.com/IMUsU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IMUsU.jpg" alt="enter image description here" /></a></p> <p>Link to the full standard <a href="https://law.resource.org/pub/in/bis/S05/is.10810.45.1984.pdf" rel="nofollow noreferrer">IS 10810-45 (1984): Methods of Test for Cables, Part 45: High Voltage Test [ETD 9: Power Cables]</a></p>
High voltage testing of multi core cables
2023-12-29T11:55:27.247
695765
|circuit-analysis|capacitor|
<p>The transient state is there because the voltage source was started at phase zero. That's not where it would be in the steady state when the capacitor's instantaneous voltage was zero.</p> <p>Look at the phase shift between the voltage source and the capacitor voltage in the steady state.</p> <p>Since this is an RC circuit, the voltage source and capacitor voltage are two separate waveforms. <em>It helps to plot them both at the same graph</em> - you'll see how the phase shift stabilizes in the steady state.</p> <p>Then all you have to do to avoid the startup transient is to start the voltage source at the correct phase - same it would have in the steady state instantaneously at the times when the capacitor voltage is zero.</p> <p>When plotting, fit fewer cycles on the graph, so it's easier to see the relative phase of the two waveforms.</p>
<p>I am confused about one of the core fundamentals of electrical components. How does a capacitor work under AC conditions? I know that a capacitor has two states (transient and steady.) This happens for DC circuits as well.</p> <p>Let us assume that we have built an AC RC circuit with a sinusoidal source. Initially the capacitor will be in its transient state as it was completely chargeless beforehand. We already know that a capacitor tries to hinder the change in its potential difference so when a source tries to induce charge, it obstructs and gets charged gradually and hence potential difference across it changes slowly depending on its capacitance. At the initial stage the capacitor shows some weird behavior but eventually it gets stable which we call the steady state of the capacitor. During steady state, the capacitor has its potential difference changed sinusoidally. If the capacitor intends to obstruct the change in its potential difference then why is it able to change that so easily in steady state? It is understandable for lower frequency, but at higher frequency shouldn't it pose some problems as it has to change its potential difference almost abruptly?</p> <p>Again if it can change so smoothly along a sinusoid then why is there a transient state to even start with? I mean in steady state there is also some point when <span class="math-container">\$V_C = 0\$</span> but still it is able to change its voltage so smoothly but at the initial stage it acts weirdly. <a href="https://i.stack.imgur.com/cc8sq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cc8sq.png" alt="enter image description here" /></a> <a href="https://i.stack.imgur.com/MKWpK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MKWpK.png" alt="enter image description here" /></a></p>
How does a capacitor work under AC?
2023-12-29T13:48:16.197
695770
|voltage|operational-amplifier|output|
<p>What goes wrong is that you assume that you have an ideal op-amp in your hands that has an output that can go right up (and down) to supply voltages.</p> <p>No such thing exists in real life and all opamps have outputs that can only go somewhat near the supply voltages.</p> <p>How near depends on the op-amp model.</p> <p>You have an archaic op-amp model designed in 1960s, more than 50 years ago. The output cannot go near supply voltages by design. The data sheet tells a reasonable expectation would be 2-3 volts less than supplied voltages.</p> <p>More modern op-amps may boast a feature called rail-to-rail output, which means the output can go much more near to supply voltages by design, meaning maybe few tens of millivolts.</p> <p>Since you said you will use the op-amp as comparator, please note that op-amps make really poor comparators. If you put too much difference between inputs, the op-amp may work unexpectedly and give a false comparison result.</p> <p>If you want a comparator, use a comparator instead of an op-amp.</p>
<p>I am trying to calculate the output voltage of a UA741 with non-inverting input 5V and inverting input 3V. As I understand, Vout = Aol * (V+ - V-), but because Aol is very large and my op-amp is fed with +-10V, I was expecting my output to be just 10V. When I tried the circuit on a breadboad I get a voltage that is not even close to that.</p> <p>Could someone give me a little push on understanding what part (if not all) of my experiment is wrong?</p>
UA741 output voltage
2023-12-29T14:28:02.557
695774
|voltage|transistors|pwm|
<p>You definitely want to use circuit 2.</p> <p>Circuit 1 hides a property of bipolar transistors: they can work in reverse. NPN is NPN whichever N comes first. Of course, they're optimized with the emitter and collector predefined, so they won't be as efficient in reverse...but with 3.3V available on the base and emitter, I wouldn't be surprised to see something close to 3.3V on the collector as well.</p> <p>Circuit 2 is much more apt. You enjoy the full gain of the transistor, and it doesn't necessarily invert, since a high input corresponds to 2.5V across the load (which I assume is strapped between the 2.5V source and the collector). (Your PWM out should be on the transistor collector, though, as the node you indicated will sit at 2.5V constantly.)</p> <p>If your load is inductive, you should also put a diode across it to prevent damage to the transistor when it's switched off.</p>
<p>I have a raspberry pi that generates a 3.3V pwm. I want to bring down the pwm high voltage to 2.5V for my application. So instead of going from 0 to 3.3V, the output pwm should go from 0 to 2.5V while maintaining the same duty cycle and frequency. I found two ways to do this and have attached the circuit diagrams below:</p> <p>Way 1:</p> <p><a href="https://i.stack.imgur.com/dYMoc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dYMoc.png" alt="enter image description here" /></a></p> <p>Way 2:</p> <p><a href="https://i.stack.imgur.com/pZhuo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pZhuo.png" alt="enter image description here" /></a></p> <p>I wanted to know if there is any reason to chose one way over the other. Way 2 seems simpler and more intuitive. The load is a nitinol wire, which needs to be energized using the pwm. Does the load have any effect on the circuit choice? Any general comments that could improve my theoretical understanding of the two circuits and their differences?</p>
Change pwm voltage using transistor switch
2023-12-29T14:57:22.083
695775
|integrated-circuit|ltspice|model|
<h2>LTspice's groups.io community</h2> <p>You should sign up for groups.io's LTspice group. It's an impressive community that is (or has been) extremely well-managed by Helmut. It's the <em><strong>second</strong></em> place to go, if the manufacturers themselves don't provide models.</p> <p>It's also a place to go when asking questions about the use of LTspice, solving difficult problems you face, and in general when you need serious and thoughtful help specific to LTspice. There are many experts there. And they respond well and quickly.</p> <p>What you want is <a href="https://groups.io/g/LTspice/files/z_yahoo/Lib/NE567" rel="nofollow noreferrer">here</a>. Once you sign up (and there used to be an approval process which is easily passed), you have access to their message board and files. Please do sign up.</p> <h2>LTspice common models, subcircuits, and assemblies</h2> <p><em>(Short history note: There was first LTspice IV. Then came LTspice XVII. Then came LTspice. All of these have been built using tools that helped to allow its availability under operating systems other than Windows. However, the first two didn't obey new rules from Microsoft about file folder placement. This last one does.</em>)</p> <p>LTspice (and LTspice XVII) have default locations where they look for assemblies, models, and subcircuits. After installing LTspice, you should familiarize yourself with their locations. It can be important to know.</p> <p>In general, they will be located starting at some root folder location created during installation. In that root folder, you will find a folder called <strong>lib</strong>. This is where you will find three more folders: <strong>cmp</strong>, <strong>sub</strong>, and <strong>sym</strong>.</p> <p>In the first, <strong>cmp</strong>, is found the default files used to hold <em>simple</em> models of parts, such as BJTs, MOSFETs, diodes, etc. You can enhance those files as you see fit and your new models will be searchable when looking to change a diode part number, for example.</p> <p>In the second, <strong>sub</strong>, is found the provided subcircuit models that were installed. You can add to this folder, if you want. If so, LTspice will be able to find that subcircuit or model file when it looks.</p> <p>In the third, <strong>sym</strong>, is found the assembly drawings (and their meta data) that were also installed. You can add to this folder, if you want. If so, LTspice will add those drawing symbols to the list you get when hitting the F2 key.</p> <p>You can create other folders as you see fit and place them where you want. Often, this is a good idea to avoid some clutter as you accumulate models from different sources. But if you do this, you need to let LTspice know about them. It doesn't have a crystal ball. So you will need to click on the <em>hammer</em> symbol (or use the <em>Tools/Control Panel</em> menu option) to pull up the tools dialog. There, you will look for and select the tab called <strong>Sym. &amp; Lib. Search Parts</strong>. And there you can add directories that LTspice should consider when looking for things you have placed elsewhere. Add them and click OK. Then restart LTspice just to be sure it knows about them.</p> <h2>567 stuff you want</h2> <p>You now have enough information to know where and how to save the following files.</p> <p>I can provide what they have at the LTspice groups.io site. All of these files were contributed by <strong>Michael Wilson</strong>. You are in his debt.</p> <p><em>(It appears to be <code>idealized</code> [so may deviate from actual behavior] and something performed or otherwise captured during EE449 in the winter of 2011. Hopefully it still meets your needs.)</em></p> <p>This first file is the LTspice model for the NE567A. It can be given any file extension you want. So if you have a preference, go with it. But it is common to use <strong>SUB</strong> (for <em>subcircuit</em>) or <strong>MOD</strong> (for <em>model</em>). In this case, it's a subcircuit. So I'd recommend you use <strong>SUB</strong> as the file extension. Michael chose to call it <strong>XNE567A.SUB</strong>.</p> <pre><code>* C:\Users\Mike\Documents\Cal Poly\EE449Winter11\PLL ToneDetect\Phase *Detectors10a_nuVco.asc .SUBCKT XNE567A 1 2 3 4 5 6 7 8 Q1 2 N016 N020 0 NPN Q2 2 N017 N021 0 NPN Q3 4 N017 N020 0 NPN Q4 4 N016 N021 0 NPN Q5 N020 3 N026 0 NPN Q6 N021 P001 N027 0 NPN Q7 N029 B N030 0 NPN Q11 4 Y N022 0 NPN Q12 4 X N023 0 NPN Q13 1 X N022 0 NPN Q14 1 Y N023 0 NPN Q16 N022 N027 N031 0 NPN Q17 N023 N026 N031 0 NPN R1 N016 A 20k R3 N018 N017 10k R4 N018 N016 10k R6 M P001 21k R7 M 3 21k R8 N026 N029 .5k R9 N027 N029 .5k R10 N030 0 2.45k R11 4 2 10k Q19 N031 B N034 0 NPN R15 N034 0 2.7k R16 4 1 10k V3 B 0 1.35 Q20 N014 N012 N010 0 PNP Q21 N012 N012 N011 0 PNP Q22 N012 P002 N024 0 NPN Q23 N012 N024 N028 0 NPN Q24 N010 N025 N028 0 NPN Q25 N010 1 N025 0 NPN R18 4 N011 5k R19 4 N010 5k R20 N024 N028 5k R21 N025 N028 5k Q26 N028 N032 N033 0 NPN R22 N033 0 5k V8 N032 0 1.4 R23 P002 N019 1k V9 N019 0 3.7 Q27 N013 N014 N015 0 NPN Q28 8 N015 0 0 NPN R24 4 N013 10k R26 N015 0 10k XU1 N008 6 4 0 N006 LT1018 V6 N007 0 2.5 R13 N008 N007 10k R14 N006 N008 68k Q15 4 N006 N002 0 2N3904 Q18 0 N006 N002 0 2N3906 Q29 Y N003 N005 0 NPN Q30 N005 N009 P003 0 NPN Q31 X N004 N005 0 NPN R29 P003 0 900 R30 N001 Y 2k R31 N001 X 2k V7 N004 0 2 V10 N009 0 1.22 R32 4 N001 4k V11 N003 6 -.5 R33 N006 A 6k R34 A 4 4.0k R35 A 0 12k B1 0 6 I=(i(R25))*(V(2)-3.8)*2 R12 0 7 10 R25 N002 5 1 R27 4 8 10Meg R28 4 7 100Meg R36 5 6 2.27meg C4 6 0 .001f V1 N018 0 3.8 V2 M 0 2.5 .model NPN NPN .model PNP PNP *.lib C:\PROGRA~2\LTC\LTSPIC~1\lib\cmp\standard.bjt .lib standard.bjt * C3 Filter Cap\nPin 1 * C2 Loop Filter\nPin 2 * External\nPull up * Pin 8 * Quad\nPhase * In Phase * Ext Cap * Pin 3 * Pin 4 * Pin 7\nGround * Ext Cap * Ext Cap .lib LTC1.lib .backanno .ends </code></pre> <p>This second file is the LTspice drawing assembly and meta data file for the NE567A. It should be provided the <strong>ASY</strong> extension. Michael chose to call it <strong>XNE567A.ASY</strong>.</p> <pre><code>Version 4 SymbolType CELL LINE Normal -20 -128 -20 -112 LINE Normal 20 -128 20 -112 LINE Normal -8 -100 8 -100 RECTANGLE Normal -112 -128 112 128 ARC Normal -20 -124 4 -100 -20 -112 -8 -100 ARC Normal -4 -124 20 -100 8 -100 20 -112 WINDOW 0 0 -64 Center 0 WINDOW 3 0 64 Center 0 SYMATTR Value XNE567A SYMATTR Prefix X SYMATTR SpiceModel XNE567A.sub SYMATTR Value2 XNE567A SYMATTR Description An idealized NE567 Tone Decoder with Oscillator PIN -112 -96 LEFT 8 PINATTR PinName Out Fil C3 PINATTR SpiceOrder 1 PIN -112 -32 LEFT 8 PINATTR PinName Loop Fil C2 PINATTR SpiceOrder 2 PIN -112 32 LEFT 8 PINATTR PinName INPUT PINATTR SpiceOrder 3 PIN -112 96 LEFT 8 PINATTR PinName Vcc PINATTR SpiceOrder 4 PIN 112 96 RIGHT 8 PINATTR PinName Time R1 PINATTR SpiceOrder 5 PIN 112 32 RIGHT 8 PINATTR PinName Time R1 C1 PINATTR SpiceOrder 6 PIN 112 -32 RIGHT 8 PINATTR PinName Gnd PINATTR SpiceOrder 7 PIN 112 -96 RIGHT 8 PINATTR PinName Out OC PINATTR SpiceOrder 8 </code></pre> <p><strong>Please take note:</strong> There is a line in this file <code>SYMATTR SpiceModel XNE567A.sub</code> and this is <em><strong>very important</strong></em>. When LTspice loads up the drawing assembly file and draws it, it also takes note of this line which gives the file name for the model or subcircuit that LTspice should use with this symbol. Make <em><strong>sure</strong></em> that this name matches up with whatever file name you chose, earlier. Otherwise, LTspice will fail to find the model and will provide an error. This linkage is important for symbols. (Not important if you don't use symbols and prefer to just write out Spice cards.)</p> <p>The third and fourth files below are two test files you can use to validate the model, itself. These are schematic files. You can place them wherever you want and load them up as a schematic to run.</p> <p>Michael chose to call this one <strong>XNE567_testA.asc</strong>:</p> <pre><code>Version 4 SHEET 1 880 680 WIRE 48 80 0 80 WIRE 112 80 48 80 WIRE 368 80 336 80 WIRE 480 80 368 80 WIRE 544 80 480 80 WIRE -320 112 -448 112 WIRE -64 144 -64 80 WIRE -32 144 -64 144 WIRE 64 144 32 144 WIRE 112 144 64 144 WIRE 432 144 336 144 WIRE -448 160 -448 112 WIRE -448 160 -496 160 WIRE -64 160 -64 144 WIRE -288 176 -352 176 WIRE 432 176 432 144 WIRE -128 208 -144 208 WIRE 80 208 -64 208 WIRE 112 208 80 208 WIRE 496 208 336 208 WIRE -320 240 -320 112 WIRE -288 240 -320 240 WIRE -496 256 -496 240 WIRE -352 272 -352 176 WIRE 112 272 96 272 WIRE 384 272 336 272 WIRE 416 272 384 272 WIRE 496 272 496 208 WIRE -352 304 -352 272 WIRE 96 320 96 272 WIRE 96 336 96 320 WIRE -496 384 -496 336 WIRE -352 384 -496 384 WIRE -272 384 -352 384 WIRE -272 416 -272 384 FLAG 432 176 0 FLAG 96 416 0 FLAG -64 160 0 FLAG 96 320 5v FLAG 368 0 5v FLAG -448 224 0 FLAG -272 416 0 FLAG 480 80 out FLAG 48 80 Out_Filt FLAG 64 144 Loop_Filt FLAG 80 208 Input FLAG -352 272 Freq FLAG 384 272 VCO FLAG 496 336 0 SYMBOL cap 0 64 R90 WINDOW 3 -23 37 VTop 2 WINDOW 0 46 7 VBottom 2 SYMATTR Value .02µ SYMATTR InstName C1 SYMBOL cap 32 128 R90 WINDOW 3 -13 57 VTop 2 WINDOW 0 47 56 VBottom 2 SYMATTR Value .01µ SYMATTR InstName C2 SYMBOL cap -64 192 R90 WINDOW 0 0 32 VBottom 2 WINDOW 3 32 32 VTop 2 SYMATTR InstName C3 SYMATTR Value .01µ SYMBOL res 352 -16 R0 SYMATTR InstName R1 SYMATTR Value 10k SYMBOL voltage 96 320 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL voltage -352 288 R0 WINDOW 123 24 124 Left 2 WINDOW 39 0 0 Left 2 WINDOW 3 31 72 Left 2 SYMATTR Value 40 SYMATTR InstName V3 SYMBOL SpecialFunctions\\modulate -288 176 R0 WINDOW 3 -22 -50 Left 2 WINDOW 0 51 32 Left 2 SYMATTR Value mark = 1k space = 0 SYMATTR InstName A1 SYMBOL voltage -496 240 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 WINDOW 0 33 54 Left 2 WINDOW 3 -31 -146 Left 2 SYMATTR InstName V4 SYMATTR Value PULSE(0 150m 0 200u 200u 5m 10m) SYMBOL res -512 144 R0 WINDOW 0 -19 31 Left 2 WINDOW 3 -36 65 Left 2 SYMATTR InstName R2 SYMATTR Value 10k SYMBOL cap -464 160 R0 WINDOW 3 32 45 Left 2 SYMATTR Value .04µ SYMATTR InstName C4 SYMBOL res 512 256 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R4 SYMATTR Value 2.27k SYMBOL cap 480 272 R0 SYMATTR InstName C6 SYMATTR Value .01µ SYMBOL XNE567A 224 176 R0 SYMATTR InstName U1 TEXT -168 296 Left 2 !.tran 0 25m 0 1u TEXT -312 328 Left 2 ;Frequency TEXT -528 336 Left 2 ;Pulse Rate/\nAmplitude </code></pre> <p>The following one Michael chose to call <strong>XNE567_testB.asc</strong>. It appears to be a discrete component version of the IC, together with a test harness:</p> <pre><code>Version 4 SHEET 1 1476 1048 WIRE -512 -1504 -848 -1504 WIRE -224 -1504 -512 -1504 WIRE -512 -1440 -512 -1504 WIRE -512 -1360 -576 -1360 WIRE -464 -1360 -512 -1360 WIRE -448 -1360 -464 -1360 WIRE -576 -1344 -576 -1360 WIRE -464 -1344 -464 -1360 WIRE -1184 -1328 -1216 -1328 WIRE -1072 -1328 -1104 -1328 WIRE -1248 -1312 -1328 -1312 WIRE -1328 -1296 -1328 -1312 WIRE -1248 -1296 -1248 -1312 WIRE -1216 -1264 -1216 -1328 WIRE -992 -1264 -1216 -1264 WIRE -704 -1264 -992 -1264 WIRE -576 -1248 -576 -1264 WIRE -576 -1248 -640 -1248 WIRE -464 -1248 -464 -1264 WIRE -368 -1248 -464 -1248 WIRE 0 -1248 -48 -1248 WIRE 32 -1248 0 -1248 WIRE -576 -1216 -576 -1248 WIRE -464 -1216 -464 -1248 WIRE -1328 -1200 -1328 -1216 WIRE -1328 -1200 -1376 -1200 WIRE -1248 -1200 -1328 -1200 WIRE -1216 -1200 -1216 -1264 WIRE -1216 -1200 -1248 -1200 WIRE -1168 -1200 -1216 -1200 WIRE -1072 -1200 -1072 -1328 WIRE -1072 -1200 -1088 -1200 WIRE -784 -1200 -992 -1200 WIRE -848 -1168 -848 -1504 WIRE -704 -1168 -704 -1184 WIRE -640 -1168 -704 -1168 WIRE -352 -1168 -400 -1168 WIRE -1328 -1136 -1376 -1136 WIRE -528 -1120 -576 -1120 WIRE -464 -1120 -528 -1120 WIRE -1328 -1104 -1328 -1136 WIRE -1216 -1104 -1216 -1200 WIRE -1184 -1104 -1216 -1104 WIRE -1104 -1088 -1120 -1088 WIRE -1024 -1088 -1104 -1088 WIRE -912 -1088 -912 -1120 WIRE -912 -1088 -1024 -1088 WIRE -1296 -1072 -1344 -1072 WIRE -1200 -1072 -1216 -1072 WIRE -1184 -1072 -1200 -1072 WIRE -784 -1072 -784 -1200 WIRE -784 -1072 -848 -1072 WIRE -528 -1072 -528 -1120 WIRE -224 -1072 -224 -1504 WIRE 368 -1072 -224 -1072 WIRE 608 -1072 368 -1072 WIRE 928 -1072 608 -1072 WIRE 992 -1072 928 -1072 WIRE 1008 -1072 992 -1072 WIRE -848 -1056 -848 -1072 WIRE -352 -1056 -352 -1088 WIRE 608 -1056 608 -1072 WIRE -416 -1024 -464 -1024 WIRE 928 -1024 928 -1072 WIRE -912 -1008 -912 -1088 WIRE -1200 -992 -1200 -1072 WIRE -1104 -992 -1104 -1088 WIRE -1104 -992 -1120 -992 WIRE -1024 -976 -1024 -1008 WIRE -1024 -976 -1088 -976 WIRE -976 -976 -1024 -976 WIRE -1088 -960 -1088 -976 WIRE -1024 -960 -1024 -976 WIRE 608 -960 608 -976 WIRE 656 -960 608 -960 WIRE 368 -944 368 -992 WIRE 608 -944 608 -960 WIRE -848 -928 -848 -960 WIRE 32 -928 32 -1248 WIRE 96 -928 32 -928 WIRE -1520 -912 -1680 -912 WIRE -1504 -912 -1520 -912 WIRE -1456 -912 -1504 -912 WIRE -1408 -912 -1456 -912 WIRE -1376 -912 -1408 -912 WIRE 448 -896 432 -896 WIRE 544 -896 448 -896 WIRE 928 -896 928 -944 WIRE 1008 -896 1008 -1072 WIRE 1136 -896 1008 -896 WIRE -528 -880 -528 -896 WIRE 1008 -880 1008 -896 WIRE 1136 -864 1136 -896 WIRE 96 -848 96 -864 WIRE 864 -848 608 -848 WIRE -1376 -816 -1376 -832 WIRE 368 -800 368 -848 WIRE 448 -800 448 -896 WIRE 448 -800 368 -800 WIRE 1008 -768 1008 -800 WIRE 1024 -768 1008 -768 WIRE 1056 -768 1024 -768 WIRE 1136 -768 1136 -784 WIRE 1136 -768 1056 -768 WIRE -1744 -752 -1760 -752 WIRE -1680 -752 -1744 -752 WIRE -1520 -752 -1520 -832 WIRE -1520 -752 -1680 -752 WIRE -1264 -752 -1264 -880 WIRE -1264 -752 -1520 -752 WIRE -1056 -752 -1264 -752 WIRE -48 -752 -48 -832 WIRE -48 -752 -416 -752 WIRE 32 -752 32 -928 WIRE 32 -752 -48 -752 WIRE 1008 -736 1008 -768 WIRE -960 -720 -1408 -720 WIRE -928 -720 -960 -720 WIRE -528 -720 -928 -720 WIRE -224 -720 -224 -1072 WIRE -224 -720 -528 -720 WIRE -64 -720 -224 -720 WIRE -1520 -688 -1520 -752 WIRE -1408 -688 -1408 -720 WIRE -1056 -688 -1056 -752 WIRE -960 -688 -960 -720 WIRE -528 -688 -528 -720 WIRE -416 -688 -416 -752 WIRE -64 -688 -64 -720 WIRE 32 -688 32 -752 WIRE 928 -688 928 -800 WIRE 944 -688 928 -688 WIRE -1760 -672 -1760 -688 WIRE 368 -656 368 -800 WIRE 464 -656 368 -656 WIRE 656 -656 656 -960 WIRE 656 -656 576 -656 WIRE -1584 -640 -1600 -640 WIRE -1264 -640 -1344 -640 WIRE -1120 -640 -1264 -640 WIRE -736 -640 -816 -640 WIRE -256 -640 -352 -640 WIRE -128 -640 -256 -640 WIRE -256 -608 -256 -640 WIRE 224 -608 192 -608 WIRE 768 -608 720 -608 WIRE 800 -608 768 -608 WIRE -1408 -592 -1520 -592 WIRE -1008 -592 -1056 -592 WIRE -960 -592 -1008 -592 WIRE -528 -576 -528 -592 WIRE -464 -576 -528 -576 WIRE -416 -576 -416 -592 WIRE -416 -576 -464 -576 WIRE -176 -576 -176 -592 WIRE -64 -576 -64 -592 WIRE 0 -576 -64 -576 WIRE 32 -576 32 -592 WIRE 32 -576 0 -576 WIRE -1264 -560 -1264 -640 WIRE -816 -560 -816 -640 WIRE -816 -560 -1184 -560 WIRE -592 -544 -592 -640 WIRE -176 -544 -176 -576 WIRE -176 -544 -592 -544 WIRE 96 -544 96 -640 WIRE 96 -544 -176 -544 WIRE 944 -544 944 -688 WIRE -1600 -528 -1600 -640 WIRE -896 -528 -896 -640 WIRE -896 -528 -1600 -528 WIRE -1600 -512 -1600 -528 WIRE -1408 -496 -1408 -592 WIRE 192 -496 192 -528 WIRE 464 -496 464 -656 WIRE 576 -496 576 -656 WIRE -1008 -480 -1008 -592 WIRE -1264 -448 -1344 -448 WIRE -1232 -448 -1264 -448 WIRE -736 -448 -848 -448 WIRE 368 -448 368 -560 WIRE 400 -448 368 -448 WIRE 656 -448 656 -560 WIRE 656 -448 640 -448 WIRE -848 -432 -848 -448 WIRE -848 -432 -864 -432 WIRE -464 -432 -464 -576 WIRE -1408 -384 -1408 -400 WIRE -1184 -384 -1408 -384 WIRE -528 -384 -544 -384 WIRE -1408 -368 -1408 -384 WIRE 464 -368 464 -400 WIRE 512 -368 464 -368 WIRE 576 -368 576 -400 WIRE 576 -368 512 -368 WIRE -1152 -352 -1152 -448 WIRE -1120 -352 -1152 -352 WIRE -848 -352 -848 -432 WIRE -848 -352 -1120 -352 WIRE -1264 -336 -1264 -448 WIRE -1216 -336 -1264 -336 WIRE -1008 -336 -1008 -384 WIRE -544 -336 -544 -384 WIRE -544 -336 -1008 -336 WIRE 368 -336 368 -448 WIRE 656 -336 656 -448 WIRE -1008 -320 -1008 -336 WIRE 944 -304 944 -464 WIRE 1008 -304 1008 -640 WIRE 1008 -304 944 -304 WIRE -1408 -272 -1408 -288 WIRE -1264 -272 -1408 -272 WIRE 0 -272 0 -576 WIRE -1408 -256 -1408 -272 WIRE 512 -256 512 -368 WIRE 512 -256 368 -256 WIRE 656 -256 512 -256 WIRE -1264 -240 -1264 -272 WIRE -1008 -240 -1264 -240 WIRE -1184 -192 -1184 -384 WIRE -64 -192 -64 -224 WIRE -64 -192 -1184 -192 WIRE 512 -128 512 -256 WIRE 544 -128 512 -128 WIRE -1408 -112 -1408 -160 WIRE -464 -112 -464 -336 WIRE -224 -112 -464 -112 WIRE 0 -112 0 -176 WIRE 0 -112 -224 -112 WIRE -1216 -80 -1216 -336 WIRE -224 -80 -224 -112 WIRE 688 -80 608 -80 WIRE -1216 -32 -1216 -80 WIRE -288 -32 -352 -32 WIRE -1408 0 -1408 -32 WIRE -1408 0 -1744 0 WIRE -352 0 -352 -32 WIRE -352 0 -416 0 WIRE -1408 16 -1408 0 WIRE 544 16 544 -32 WIRE -224 32 -224 16 WIRE -1216 48 -1216 -32 WIRE 688 48 688 0 WIRE 544 112 544 96 WIRE 944 112 944 -304 WIRE 944 112 544 112 WIRE 544 128 544 112 WIRE -432 144 -560 144 WIRE -352 144 -352 80 WIRE -352 144 -432 144 WIRE -224 144 -224 112 WIRE -224 144 -352 144 WIRE -560 160 -560 144 WIRE -1568 192 -1696 192 WIRE -64 224 -64 176 WIRE -64 224 -432 224 WIRE -1696 240 -1696 192 WIRE -1696 240 -1744 240 WIRE -1536 256 -1600 256 WIRE -1216 288 -1216 112 WIRE -1216 288 -1392 288 WIRE -1568 320 -1568 192 WIRE -1536 320 -1568 320 WIRE -1744 336 -1744 320 WIRE -1600 352 -1600 256 WIRE -1600 384 -1600 352 WIRE -1744 464 -1744 416 WIRE -1600 464 -1744 464 WIRE -1520 464 -1600 464 WIRE -1520 496 -1520 464 FLAG -1408 16 0 FLAG -560 160 0 FLAG -1344 -208 B FLAG -416 0 B FLAG -1600 -432 A FLAG -1376 -816 0 FLAG -1408 -912 5v FLAG -928 -720 5v FLAG -48 -912 5v FLAG -1760 -672 0 FLAG 544 128 0 FLAG 688 48 0 FLAG 768 -608 pin1 FLAG -48 -1248 pin1 FLAG 192 -496 0 FLAG -256 -608 X FLAG -176 -576 Y FLAG -1744 -752 Pin2 FLAG -1504 -912 Pin4 FLAG 992 -1072 5v FLAG 1056 -768 Pin8 FLAG -1216 -32 Pin3 FLAG -1152 -1056 0 FLAG -1152 -1120 5v FLAG -1344 -992 0 FLAG -1328 -1104 0 FLAG -848 -928 0 FLAG -1216 -1200 Tri FLAG -1248 -1296 0 FLAG -528 -880 0 FLAG -512 -1440 5v FLAG -352 -1056 0 FLAG -416 -944 0 FLAG -992 -1264 Tri FLAG -368 -1248 X FLAG -640 -1248 Y FLAG -1024 -880 5v FLAG -1088 -880 0 FLAG -976 -976 A FLAG -1264 -880 vl FLAG -1072 -1200 5 FLAG -1248 -1200 6 FLAG 0 -1248 1 FLAG 1024 -768 8 FLAG -1216 -80 3 FLAG -1680 -752 2 FLAG -1456 -912 4 FLAG -432 224 7 FLAG -64 96 5v FLAG -1120 -352 M FLAG -1680 -832 0 FLAG 96 -848 0 FLAG -736 -560 0 FLAG -736 -368 0 FLAG -1696 304 0 FLAG -1520 496 0 FLAG -1600 352 Freq SYMBOL npn -1584 -688 R0 SYMATTR InstName Q1 SYMBOL npn -1120 -688 R0 SYMATTR InstName Q2 SYMBOL npn -1344 -688 M0 SYMATTR InstName Q3 SYMBOL npn -896 -688 M0 SYMATTR InstName Q4 SYMBOL npn -1344 -496 M0 SYMATTR InstName Q5 SYMBOL npn -944 -480 M0 SYMATTR InstName Q6 SYMBOL npn -1344 -256 M0 SYMATTR InstName Q7 SYMBOL npn -592 -688 R0 SYMATTR InstName Q11 SYMBOL npn -128 -688 R0 SYMATTR InstName Q12 SYMBOL npn -352 -688 M0 SYMATTR InstName Q13 SYMBOL npn 96 -688 M0 SYMATTR InstName Q14 SYMBOL npn -528 -432 R0 SYMATTR InstName Q16 SYMBOL npn -64 -272 R0 SYMATTR InstName Q17 SYMBOL res -1616 -528 R0 SYMATTR InstName R1 SYMATTR Value 20k SYMBOL res -1168 -576 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 -23 19 VTop 2 SYMATTR InstName R3 SYMATTR Value 10k SYMBOL res -800 -656 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R4 SYMATTR Value 10k SYMBOL res -848 -448 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R6 SYMATTR Value 21k SYMBOL res -1136 -464 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R7 SYMATTR Value 21k SYMBOL res -1424 -384 R0 SYMATTR InstName R8 SYMATTR Value .5k SYMBOL res -1024 -336 R0 SYMATTR InstName R9 SYMATTR Value .5k SYMBOL res -1424 -128 R0 SYMATTR InstName R10 SYMATTR Value 2.45k SYMBOL res -1536 -928 R0 SYMATTR InstName R11 SYMATTR Value 10k SYMBOL npn -288 -80 R0 SYMATTR InstName Q19 SYMBOL res -240 16 R0 SYMATTR InstName R15 SYMATTR Value 2.7k SYMBOL res -64 -928 R0 SYMATTR InstName R16 SYMATTR Value 10k SYMBOL voltage -352 -16 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V3 SYMATTR Value 1.35 SYMBOL pnp 544 -848 M180 SYMATTR InstName Q20 SYMBOL pnp 432 -848 R180 SYMATTR InstName Q21 SYMBOL npn 304 -656 R0 SYMATTR InstName Q22 SYMBOL npn 400 -496 R0 SYMATTR InstName Q23 SYMBOL npn 640 -496 M0 SYMATTR InstName Q24 SYMBOL npn 720 -656 M0 SYMATTR InstName Q25 SYMBOL res 352 -1088 R0 SYMATTR InstName R18 SYMATTR Value 5k SYMBOL res 592 -1072 R0 SYMATTR InstName R19 SYMATTR Value 5k SYMBOL res 352 -352 R0 SYMATTR InstName R20 SYMATTR Value 5k SYMBOL res 640 -352 R0 SYMATTR InstName R21 SYMATTR Value 5k SYMBOL npn 608 -128 M0 SYMATTR InstName Q26 SYMBOL res 528 0 R0 SYMATTR InstName R22 SYMATTR Value 5k SYMBOL voltage 688 -96 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V8 SYMATTR Value 1.4 SYMBOL res 320 -624 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R23 SYMATTR Value 1k SYMBOL voltage 192 -624 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 WINDOW 0 -39 3 Left 2 SYMATTR InstName V9 SYMATTR Value 3.7 SYMBOL npn 864 -896 R0 SYMATTR InstName Q27 SYMBOL npn 944 -736 R0 SYMATTR InstName Q28 SYMBOL res 912 -1040 R0 SYMATTR InstName R24 SYMATTR Value 10k SYMBOL res 928 -560 R0 SYMATTR InstName R26 SYMATTR Value 10k SYMBOL Comparators\\LT1018 -1152 -1088 R0 SYMATTR InstName U1 SYMBOL voltage -1344 -1088 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V6 SYMATTR Value 2.5 SYMBOL res -1200 -1088 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R13 SYMATTR Value 10k SYMBOL res -1104 -1008 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R14 SYMATTR Value 68k SYMBOL npn -912 -1168 R0 WINDOW 0 30 39 Left 2 WINDOW 3 31 64 Left 2 SYMATTR InstName Q15 SYMATTR Value 2N3904 SYMBOL pnp -912 -960 M180 WINDOW 0 50 30 Left 2 WINDOW 3 42 58 Left 2 SYMATTR InstName Q18 SYMATTR Value 2N3906 SYMBOL npn -640 -1216 R0 SYMATTR InstName Q29 SYMBOL npn -464 -1072 M0 SYMATTR InstName Q30 SYMBOL npn -400 -1216 M0 SYMATTR InstName Q31 SYMBOL res -544 -992 R0 SYMATTR InstName R29 SYMATTR Value 900 SYMBOL res -592 -1360 R0 SYMATTR InstName R30 SYMATTR Value 2k SYMBOL res -480 -1360 R0 SYMATTR InstName R31 SYMATTR Value 2k SYMBOL voltage -352 -1184 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V7 SYMATTR Value 2 SYMBOL voltage -416 -1040 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V10 SYMATTR Value 1.22 SYMBOL res -528 -1456 R0 SYMATTR InstName R32 SYMATTR Value 4k SYMBOL voltage -704 -1168 R180 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 WINDOW 3 14 98 Left 2 SYMATTR Value -.5 SYMATTR InstName V11 SYMBOL res -1040 -1104 R0 SYMATTR InstName R33 SYMATTR Value 6k SYMBOL res -1040 -976 R0 SYMATTR InstName R34 SYMATTR Value 4.0k SYMBOL res -1104 -976 R0 SYMATTR InstName R35 SYMATTR Value 12k SYMBOL bi -1328 -1296 R0 WINDOW 3 -252 -6 Left 2 SYMATTR Value I=(i(R25))*(V(vl)-3.8)*2 SYMATTR InstName B1 SYMBOL res -448 128 R0 SYMATTR InstName R12 SYMATTR Value 10 SYMBOL res -976 -1216 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R25 SYMATTR Value 1 SYMBOL res 992 -896 R0 SYMATTR InstName R27 SYMATTR Value 10Meg SYMBOL res -80 80 R0 SYMATTR InstName R28 SYMATTR Value 100Meg SYMBOL res -1072 -1216 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R36 SYMATTR Value 2.27meg SYMBOL cap -1344 -1200 R0 SYMATTR InstName C4 SYMATTR Value .001f SYMBOL voltage -736 -656 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value 3.8 SYMBOL voltage -736 -464 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V2 SYMATTR Value 2.5 SYMBOL res 1120 -880 R0 SYMATTR InstName R2 SYMATTR Value 10k SYMBOL cap 112 -864 R180 WINDOW 0 24 56 Left 2 WINDOW 3 24 8 Left 2 SYMATTR InstName C1 SYMATTR Value .02µ SYMBOL cap -1776 -752 R0 WINDOW 3 -53 12 Left 2 SYMATTR Value .01µ SYMATTR InstName C2 SYMBOL cap -1392 -1200 R0 WINDOW 0 -15 15 Left 2 WINDOW 3 -34 58 Left 2 SYMATTR InstName C3 SYMATTR Value .01µ SYMBOL res -1088 -1344 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R5 SYMATTR Value 2.27k SYMBOL voltage -1680 -928 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V4 SYMATTR Value 5 SYMBOL voltage -1600 368 R0 WINDOW 123 24 124 Left 2 WINDOW 39 0 0 Left 2 WINDOW 3 31 72 Left 2 SYMATTR Value 40 SYMATTR InstName V5 SYMBOL SpecialFunctions\\modulate -1536 256 R0 WINDOW 3 -22 -50 Left 2 WINDOW 0 51 32 Left 2 SYMATTR Value mark = 1k space = 0 SYMATTR InstName A1 SYMBOL voltage -1744 320 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 WINDOW 0 33 54 Left 2 WINDOW 3 -31 -146 Left 2 SYMATTR InstName V12 SYMATTR Value PULSE(0 150m 0 200u 200u 5m 10m) SYMBOL res -1760 224 R0 WINDOW 0 -19 31 Left 2 WINDOW 3 -36 65 Left 2 SYMATTR InstName R17 SYMATTR Value 10k SYMBOL cap -1712 240 R0 WINDOW 3 32 45 Left 2 SYMATTR Value .04µ SYMATTR InstName C5 SYMBOL cap -1232 48 R0 SYMATTR InstName C6 SYMATTR Value .01µ TEXT 40 -816 Left 4 ;Output Filter \nCap Pin 1 TEXT -1744 -712 Left 4 ;Loop Filter \nPin 2 TEXT 1184 -840 Left 4 ;External\nPull up TEXT 1048 -744 Left 4 ;Pin 8 TEXT -1304 -664 Left 4 ;Quad\nPhase TEXT -320 -488 Left 4 ;In Phase TEXT -1176 72 Left 4 ;Ext Input \nCap TEXT -1296 24 Left 4 ;Pin 3 TEXT -1680 -928 Left 4 ;Pin 4 TEXT -1728 -72 Left 4 ;Pin 7\nGround TEXT -1576 -1208 Left 4 ;Ext Cap\nOscillator TEXT -1120 -1400 Left 4 ;Ext Resistor\nOscillator TEXT -1848 -920 Left 4 ;External\nVcc TEXT -1544 376 Left 2 !.tran 0 25m 0 1u TEXT -1560 408 Left 2 ;Frequency TEXT -1776 416 Left 2 ;Pulse Rate/\nAmplitude TEXT -1680 88 Left 4 ;External Test\nSource TEXT -928 -88 Left 2 !.lib standard.bjt </code></pre> <h2>summary</h2> <p>Hope that helps out. I've only done a preliminary test using his first test program and it looks good. Also, everything seemed to run as I expected. So no troubles using them.</p>
<p>From searching the web it seems it is not included with the installation of LTspice, so I will have to add it as a 3rd-party model.</p> <p>I am fairly new to LTspice and I'm not sure how to do this as I haven't had to yet. I haven't found information on this IC in LTspice. Does anyone know where I can get an LM567 model for LTspice?</p>
How can I add an LM567 in LTspice?
2023-12-29T15:03:11.243
695782
|relay|pwm|low-power|
<p>Use a fet, relays have a high switching time. Use a low side n-mosfet with a low RDS on. Make sure the Vds is rated for the max voltage across the part. Make sure you don't exceed the gate voltage, and make sure the gate switches fast enough so you don't burn it out. (you want the fet either on or off but not in between as that is when max power is dissipated)</p>
<p>I've been using coil relays for automotive electrical stuff for years, but in the MCU / embedded world there are PWM driven relays as well. I get that 5v will operate the coil on the smaller 10 amp relays, but is 5v at 1 - 2 amps (planning on having a secondary feed halfway down the strip, so 2 relays) enough current to use the coil type. Nearly everything in a car runs at 7 - 10 amps. Seems like it will be fine, I just don't want to find out the hard way it is not and burn the house down.</p> <p>I will not come close to the open/close limits on the relays and the PWM could introduce lots of noise if it is low quality. Are the PWM type relays robust enough for LED's?</p> <p>Did some searching and found these Q&amp;A:</p> <p><a href="https://electronics.stackexchange.com/questions/241212/relay-vs-mosfet-or-igbt">Relay Vs MOSFET or IGBT</a></p> <p><a href="https://electronics.stackexchange.com/questions/263697/long-run-voltage-drop">Long run Voltage drop</a></p> <p>Which make me think it is okay, but....</p>
Relay for long LED run need 4 amps - MOSFET or Coil?
2023-12-29T16:23:26.487
695789
|microchip|mplabx|
<p><a href="https://electronics.stackexchange.com/questions/695789/how-do-i-make-my-microchip-mplab-x-ide-project-use-the-free-version-of-the-xc32?noredirect=1&amp;lq=1#comment1853082_695789">@Rodo's link</a> works!--so long as the Microchip license server is up (it's been down the last two weeks or so at the end of 2023, but is up as of 2 Jan. 2024).</p> <p>Setup notes:</p> <p><em>Tested in Linux Ubuntu 22.04 with MPLAB X IDE v6.15 and XC32 compiler v1.42 (very old) and v4.35 (the latest version).</em></p> <ul> <li>I expect this process would also work fine in Windows and MacOS, with slightly different commands is all.</li> <li>To use Git in Windows, you'll need to install <a href="https://gitforwindows.org/" rel="nofollow noreferrer">Git for Windows</a> and run all Linux-like commands inside the MSYS2-based <em>Git Bash</em> terminal. My personal <a href="https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/issues/27#issue-1950880578" rel="nofollow noreferrer">Git For Windows installation instructions are here</a>.</li> <li>To run build commands in Windows at the command-line, and/or get access to other Linux tools installed by the <code>pacman</code> package manager, you'll need MSYS2. See my instructions here: <a href="https://stackoverflow.com/a/77407282/4561887">Installing &amp; setting up MSYS2 from scratch, including adding all 7 profiles to Windows Terminal</a>.</li> </ul> <h2>How to install the free XC32++ compiler license (including <code>.gitignore</code> setup and refreshing the project)</h2> <h2>Shorter summary</h2> <ol> <li><p>Download and install the latest MPLAB X IDE: <a href="https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide" rel="nofollow noreferrer">https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide</a></p> <p>The latest at the time of this writing is v6.15.</p> <p>The latest IDEs work with even the oldest XC32 compilers and do not affect compilation output.</p> </li> <li><p>Download and install the XC32 compiler of your choice: <a href="https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc32" rel="nofollow noreferrer">https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc32</a></p> <p>Use whatever your project or company requires. Even old compilers such as v1.42 work fine with the latest IDEs and the free license below.</p> <p>The latest XC32 compiler at the time of this writing is v4.35.</p> </li> <li><p>Download and install a free XC32 compiler license: <a href="https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2" rel="nofollow noreferrer">https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2</a></p> <p>For the &quot;Your MAC Address&quot; box, enter the &quot;Host id&quot; as shown in the output of <code>xclm -hostinfo</code>. On Linux and Mac, run that in the terminal. On Windows, run that in the Command Prompt (cmd.exe) or in the Git Bash terminal. This <code>xclm</code> XC32 Compiler License Manager command-line tool was installed for you when you installed the XC32 compiler above.</p> <p>The &quot;Host id&quot; shown by that command is the same as:</p> <ol> <li>On Linux: the first MAC address (with<em>out</em> any colons) shown in the output of <code>ip link show | grep ether</code>.</li> <li>On Windows: one of the MAC addresses (it seems to change on me) shown in the output of <code>ipconfig /all | findstr &quot;Physical Address&quot;</code>, when run in the Command Prompt (cmd.exe).</li> </ol> <p>If you use the wrong host ID, the license will fail to work in the end and you'll get this error when you try to build:</p> <pre><code>error: MPLAB XC32 C++ license not activated </code></pre> </li> <li><p>With the MPLAB X IDE, XC32 compiler, and a free compiler license all installed, you can now compile C or C++ in the IDE up to optimization level <code>-O1</code> without any warnings or issues.</p> <p>There are no program size constraints with the free compiler license.</p> <p>For full support of optimization levels &gt; <code>-O1</code>, you'll need to buy a pro license <a href="https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler" rel="nofollow noreferrer">or compile a license-free version of the XC32 compiler from source yourself</a>.</p> <ol> <li>Pro licenses are here; there are various options: <a href="https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/licenses" rel="nofollow noreferrer">https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/licenses</a>. <ol> <li>The subscription license is probably the cheapest, at &lt; $50/month, and is what I use. But, if the license renewal server is down and it's time for your license to auto-renew, you may lose your ability to compile for days or weeks, <a href="https://electronics.stackexchange.com/q/695730/26234">which has happened to me</a>. Get it here: <a href="https://www.microchip.com/en-us/development-tool/SW006023-SUB" rel="nofollow noreferrer">https://www.microchip.com/en-us/development-tool/SW006023-SUB</a>.</li> </ol> </li> </ol> </li> </ol> <h2>More details, and screenshots</h2> <ol> <li><p>Ensure you have downloaded and installed the MPLAB X IDE and an XC32 compiler. Once you have extracted the compiler down to a <code>.run</code> file, such as <code>xc32-v4.35-full-install-linux-x64-installer.run</code>, the installation command in Linux looks like this:</p> <pre class="lang-bash prettyprint-override"><code>chmod +x xc32-v4.35-full-install-linux-x64-installer.run sudo ./xc32-v4.35-full-install-linux-x64-installer.run </code></pre> <p>During the install, you'll see this window where you get to choose the &quot;Free&quot; license option. In my experience (perhaps just with their older XC32 compilers, since I'm using an older version actually), this selection does absolutely nothing and means absolutely nothing:</p> <p><a href="https://i.stack.imgur.com/AK5Xv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AK5Xv.jpg" alt="enter image description here" /></a></p> <p>When the installer completes, you can confirm you have no free license whatsoever by looking in the <code>/opt/microchip/xclm/license</code> dir. A free license would be here: <code>/opt/microchip/xclm/license/xc32fpp-1.lic</code>.</p> <p>Note: here are the license directory paths for all three main OSs:</p> <ul> <li>Windows - <code>%SystemDrive%\ProgramData\Microchip\xclm\license</code></li> <li>Mac - <code>/Library/Application\ Support/microchip/xclm/license</code></li> <li>Linux - <code>/opt/microchip/xclm/license</code></li> </ul> <p>You can also find the license path by running this command:</p> <pre class="lang-bash prettyprint-override"><code>xclm -licensepath </code></pre> <p>The generic help menu can be shown like this, but I don't know how to use the other commands nor what they're useful for, yet:</p> <pre class="lang-bash prettyprint-override"><code>xclm </code></pre> <p>If you try to build, you may see this:</p> <pre><code>main.cpp:1:0: note: Visit http://www.microchip.com/MPLABXCcompilers to acquire a free C++ license make[0]: *** [nbproject/Makefile-MY_PROJECT.mk:3943: build/MY_PROJECT/production/_ext/935690222/my_file.o] Error 255 another_file.cpp:1:0: error: MPLAB XC32 C++ license not activated </code></pre> <p><strong>You have no &quot;activated&quot; free license!</strong></p> </li> <li><p>So, <a href="https://electronics.stackexchange.com/questions/695789/how-do-i-make-my-microchip-mplab-x-ide-project-use-the-free-version-of-the-xc32?noredirect=1&amp;lq=1#comment1853082_695789">as @Rodo said</a>, go here to download a free license!: <a href="https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2" rel="nofollow noreferrer">https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2</a>. Use that link exactly. The <code>?id=step2</code> part at the end is required.</p> <p>You'll see this: <a href="https://i.stack.imgur.com/bEteH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bEteH.jpg" alt="enter image description here" /></a>.</p> <p>In the &quot;Your MAC Address&quot; box, enter the MAC address (with<em>out</em> any colons) shown in the first line of the output of this command:</p> <pre class="lang-bash prettyprint-override"><code>ip link show | grep ether </code></pre> <p>So, if your output looks like this:</p> <pre><code>$ ip link show | grep ether link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff link/ether 0c:0b:0a:09:08:07 brd ff:ff:ff:ff:ff:ff link/ether 0d:0e:0f:1a:1b:1c brd ff:ff:ff:ff:ff:ff </code></pre> <p>...then the MAC address you should enter is: <code>010203040506</code>.</p> <p>You can confirm this by running this command:</p> <pre class="lang-bash prettyprint-override"><code>xclm -hostinfo </code></pre> <p>where <code>xclm</code> is the XC32 License Manager executable that is now installed on your system since you ran the XC32 compiler installer above. <code>which xclm</code> shows that it is located in <code>/opt/microchip/xc32/v4.35/bin/xclm</code>, for instance.</p> <p>The output of <code>xclm -hostinfo</code> looks like this. Notice that the &quot;host id&quot; is the same as the MAC address we entered above:</p> <pre class="lang-bash prettyprint-override"><code>Host id is: 010203040506 Host name is: gabriel-my-computer </code></pre> <p>Then, choose your OS from the dropdown and click the <code>Get free XC32++ license</code> button.</p> <p>Microchip's license server will make a custom free license for you, so long as it is working. I has been down for several weeks at the end of 2023/beginning of 2024, hence <a href="https://electronics.stackexchange.com/q/695730/26234">my question here</a>. I don't know if this <a href="https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2" rel="nofollow noreferrer">https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2</a> link worked during that time.</p> <p>You'll now get to download a file called <code>cpluslic.sh</code>, for instance.</p> </li> <li><p>Install the license.</p> <p>On Linux, the commands are:</p> <pre class="lang-bash prettyprint-override"><code>chmod +x cpluslic.sh ./cpluslic.sh </code></pre> <p>You'll see this output:</p> <pre><code>Detected operating system: Linux Creating license file /opt/microchip/xclm/license/xc32fpp-1.lic </code></pre> <p>You'll now see a license file at <code>/opt/microchip/xclm/license/xc32fpp-1.lic</code>.</p> <p>Notes:</p> <ol> <li><p>Running this <code>.sh</code> license installer will fail if you haven't installed an XC32 compiler yet. The license installer looks for the existence of the <code>/opt/microchip/xclm/license</code> dir to see if you have the compiler installed, and fails if that directory doesn't exist.</p> </li> <li><p>If you open your installed license file in a text editor (ex: run <code>code /opt/microchip/xclm/license/xc32fpp-1.lic</code> to open it in MS VSCode), you'll see the words <code>permanent uncounted</code> in it, which means that this free license <em>never</em> expires! That's great! If it expires, you'll see an expiration date there instead, such as this: <code>27-dec-2023 uncounted</code>. In my paid, monthly-subscription Pro licenses, they expire every month. That full line in the license file looks like this (expires 27 Dec. 2023 in this case):</p> <pre><code>LICENSE microchip swxc32-cpp 1.0 27-dec-2023 uncounted </code></pre> <p>or this (never expires):</p> <pre><code>LICENSE microchip swxc32-fpp 1.1 permanent uncounted </code></pre> </li> <li><p>My experimentation shows that:</p> <ol> <li><p>The name of the license file doesn't really matter, so you can rename them to help you keep track of your licenses. Ex: here I have added <code>_free</code> and <code>_pro</code> to the end of my default license file names so I can remember which is which: all inside the <code>/opt/microchip/xclm/license</code> dir:</p> <pre class="lang-bash prettyprint-override"><code>microchip-1_pro.lic # my old, expired XC32 Pro license microchip-2_pro.lic # my new, valid XC32 Pro license I just installed! xc32fpp-1_free.lic # my FREE XC32 license I installed as a work-around </code></pre> </li> <li><p>You can have multiple licenses installed at once, but if a pro license exists, the IDE will try to use the latest pro license <em>even if it is expired</em>. So, to force your free license to be used instead, move all pro licenses out of the license directory.</p> </li> <li><p>If multiple pro licenses are installed, the latest one will be used, so there is no need to delete old pro licenses as you renew and install new pro licenses. For more on this, see my answer here: <a href="https://electronics.stackexchange.com/a/695772/26234">How to renew your paid Microchip XC32 Compiler Pro license when it has expired or is about to expire</a>.</p> </li> </ol> </li> </ol> </li> <li><p>Refresh the project in the IDE, and delete auto-generated content that should be ignored.</p> <p><em>Note: I don't know if this part is strictly required here, but I've found that in <code>git checkout</code>s the MPLAB X IDE and the configuration files frequently get out of sync, as the IDE only reads the project config files at certain times, and it uses and writes back old/stale/wrong data if you don't do this. So, it's not a bad idea to do this after any <code>git checkout</code> which modifies the project configuration file, or whenever making big settings changes such as to license files.</em></p> <p>Close your project in the IDE (right-click it --&gt; Close), then close the IDE.</p> <p>Manually delete all auto-generated content and build files, and commit the change to <code>git</code>:</p> <pre class="lang-bash prettyprint-override"><code>cd MyProject.X rm -r \ .generated_files/ \ build/ \ dist/ \ nbproject/Makefile-* \ nbproject/Package-* \ nbproject/private/ \ private/ \ debug/ git add -A git commit -m &quot;Remove auto-generated files&quot; </code></pre> <p>Run <code>prjMakefilesGenerator MyProject.X</code> to regenerate the build files. I have <code>prjMakefilesGenerator</code> as a symlink (in my PATH) pointing to <code>/opt/microchip/mplabx/v6.15/mplab_platform/bin/prjMakefilesGenerator.sh</code>. If you don't, run it explicitly instead:</p> <pre class="lang-bash prettyprint-override"><code>/opt/microchip/mplabx/v6.15/mplab_platform/bin/prjMakefilesGenerator.sh path/to/MyProject.X </code></pre> <p>Then, re-open the IDE, and reopen the <code>MyProject.X</code> project directory.</p> <p><strong>Additional notes:</strong></p> <ol> <li><p>To properly ignore the auto-generated files, add this to your <code>.gitignore</code> file too. From <a href="https://github.com/ElectricRCAircraftGuy/eRCaGuy_MPLABX/blob/main/.gitignore" rel="nofollow noreferrer">my <code>.gitignore</code> file for MPLAB X IDE projects here</a>:</p> <pre class="lang-bash prettyprint-override"><code># MPLAB X Generated Project Files .generated_files/ build/ dist/ **/nbproject/Makefile-* **/nbproject/Package-* **/nbproject/private/ private/ </code></pre> </li> <li><p>Once you've manually deleted the above files once <em>and</em> committed this change to git, <em>and</em> you have created the <code>.gitignore</code> file with the contents above, you can forcefully remove all ignored files next time with my <a href="https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/useful_scripts/git-rm_ignored_files.sh" rel="nofollow noreferrer"><code>git-rm_ignored_files.sh</code></a> script from my <a href="https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles" rel="nofollow noreferrer">eRCaGuy_dotfiles</a> repo. It calls <code>git clean -Xdn</code> and <code>git clean -Xdf</code> which do this.</p> </li> </ol> </li> <li><p>(Optional) View your license in the MPLAB X IDE via Tools --&gt; Licenses --&gt; Change Licensing Type.</p> </li> <li><p>Voilà! You can now compile!</p> <p>Click the little arrow to the right of this button here:</p> <p><a href="https://i.stack.imgur.com/3MwkN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3MwkN.png" alt="enter image description here" /></a></p> <p>And select &quot;Clean and Build&quot;, as shown here:</p> <p><a href="https://i.stack.imgur.com/qwIw2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qwIw2.png" alt="enter image description here" /></a></p> <p>In the build output window at the bottom-right of the IDE, you'll see <code>CLEAN SUCCESSFUL (total time: 51ms)</code> in green at the top of the build output. Several seconds (or dozens of seconds for large projects) later, you'll see this at the bottom of the build output, with the <code>BUILD SUCCESSFUL (total time: 9s)</code> part in green:</p> <pre><code>BUILD SUCCESSFUL (total time: 9s) Loading code from /home/gabriel/GS/dev/my_repo/MyProject.X/dist/default/production/MyProject.X.production.hex... Program loaded with pack,PIC32MZ-EF_DFP,1.3.58,Microchip Loading completed </code></pre> <p>The build was successful!</p> <p>This free license file appears to work on <em>any</em> version of the XC32 compiler, including very old versions such as XC32 v1.42, as well as the newest versions such as v4.35, which is currently the latest.</p> <p>The free license works perfectly fine, for both C and C++, even with optimization level <code>-O1</code> set for both of them. Using higher optimization levels than that will still build successfully, but will produce a warning that &quot;Optimization level &gt; 1&quot; is ignored and not supported by the free license version of the compiler. See my test results below. Therefore, for full support of optimization levels &gt; <code>-O1</code>, you'll need to buy a pro license <a href="https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler" rel="nofollow noreferrer">or compile a license-free version of the XC32 compiler from source yourself</a>.</p> </li> </ol> <p><em>You can stop reading here if that's all you needed.</em></p> <hr /> <h2>Testing compiler optimization levels with the free compiler license</h2> <p>My microcontroller has:</p> <ul> <li>RAM: 512 KiB</li> <li>Flash: 2 MiB</li> </ul> <p>I tested all optimization levels with the free compiler, using XC32 version 1.42 (I know, very old), setting the optimization level in both the <code>xc32-gcc</code> <em>and</em> <code>xc32-g++</code> settings at the same time. See screenshots in the question for these settings. Get my <a href="https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/useful_scripts/size_mcu.sh" rel="nofollow noreferrer"><code>size_mcu</code></a> script to run on the <code>.elf</code> firmware files from my <a href="https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles" rel="nofollow noreferrer">eRCaGuy_dotfiles</a> repo.</p> <p>The <code>xc32-size</code> executable is located at <code>/opt/microchip/xc32/v1.42/bin/xc32-size</code>.</p> <p>Here are the results with the free compiler, to see which optimization levels it accepts and how this affects the build size:</p> <ol> <li><p><code>-O0</code> - builds successfully</p> <ol> <li>Size reported in the bottom-left GUI window in the IDE: <ol> <li>Data Used: 480190 bytes (92%)</li> <li>Program Used: 1739476 bytes (83%)</li> </ol> </li> <li>Size reported by my <code>size_mcu</code> script: <pre><code>$ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288 size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = text rodata data bss dec hex filename 1242536 496964 16789 464225 2220514 21e1e2 MyProject.X/dist/default/production/MyProject.X.production.elf FLASH used . . . . . . . . . = 1756289 bytes ( 83.746%). Remaining is 340863 bytes ( 16.254%). . . . . . . . . . . . . . . . . . . . . . . . . Max is 2097152 bytes. SRAM used by global variables = 16789 bytes ( 3.202%). Remaining is 507499 bytes ( 96.798%) for local (stack) variables or RTOS stack &amp; heap. Max is 524288 bytes. </code></pre> </li> </ol> </li> <li><p><code>-O1</code> - builds successfully</p> <ol> <li>Size reported in the bottom-left GUI window in the IDE: <ol> <li>Data Used: 478878 bytes (91%)</li> <li>Program Used: 1283428 bytes (61%)</li> </ol> </li> <li>Size reported by my <code>size_mcu</code> script: <pre><code>$ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288 size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = text rodata data bss dec hex filename 789524 493928 15709 463993 1763154 1ae752 MyProject.X/dist/default/production/MyProject.X.production.elf FLASH used . . . . . . . . . = 1299161 bytes ( 61.949%). Remaining is 797991 bytes ( 38.051%). . . . . . . . . . . . . . . . . . . . . . . . . Max is 2097152 bytes. SRAM used by global variables = 15709 bytes ( 2.996%). Remaining is 508579 bytes ( 97.004%) for local (stack) variables or RTOS stack &amp; heap. Max is 524288 bytes. </code></pre> </li> </ol> </li> <li><p><code>-O2</code> - ignores the option and builds successfully at <em>approximately</em> the <code>O1</code> level; produces the following warning while compiling:</p> <pre><code>main.c:1:0: warning: Compiler option (Optimization level &gt; 1) ignored because the free XC32 C compiler does not support this feature. [enabled by default] // ^ cc1: note: Disable the option or visit http://www.microchip.com/MPLABXCcompilers to purchase a new MPLAB XC compiler license. </code></pre> <p>Notice that in the size results below, the &quot;Data Used&quot; is exactly identical to the <code>O1</code> results above, but the &quot;Program Used&quot; is slightly larger. Also, comparing the <code>O1</code> and <code>O2</code> hex files using <code>meld</code> shows that they differ significantly. So, I don't know what the compiler is doing here, but it's definitely not <code>O2</code>, and is not <em>quite</em> the same thing as <code>O1</code>!</p> <ol> <li>Size reported in the bottom-left GUI window in the IDE: <ol> <li>Data Used: 478878 bytes (91%)</li> <li>Program Used: 1288296 bytes (61%)</li> </ol> </li> <li>Size reported by my <code>size_mcu</code> script: <pre><code>$ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288 size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = text rodata data bss dec hex filename 794372 493948 15709 463993 1768022 1afa56 MyProject.X/dist/default/production/MyProject.X.production.elf FLASH used . . . . . . . . . = 1304029 bytes ( 62.181%). Remaining is 793123 bytes ( 37.819%). . . . . . . . . . . . . . . . . . . . . . . . . Max is 2097152 bytes. SRAM used by global variables = 15709 bytes ( 2.996%). Remaining is 508579 bytes ( 97.004%) for local (stack) variables or RTOS stack &amp; heap. Max is 524288 bytes. </code></pre> </li> </ol> </li> <li><p><code>-O3</code> - ignores the option and builds successfully at <em>approximately</em> the <code>O1</code> level. It produces the same warning as the <code>-O2</code> option above, and its size results differ slightly from both the <code>-O1</code> and <code>-O2</code> options above.</p> <p>Same type of warning:</p> <pre><code>main.c:1:0: warning: Compiler option (Optimization level &gt; 1) ignored because the free XC32 C compiler does not support this feature. [enabled by default] // ^ cc1: note: Disable the option or visit http://www.microchip.com/MPLABXCcompilers to purchase a new MPLAB XC compiler license. </code></pre> <ol> <li>Size reported in the bottom-left GUI window in the IDE: <ol> <li>Data Used: 478874 bytes (91%)</li> <li>Program Used: 1288072 bytes (61%)</li> </ol> </li> <li>Size reported by my <code>size_mcu</code> script: <pre><code>$ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288 size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = text rodata data bss dec hex filename 794148 493948 15709 463989 1767794 1af972 MyProject.X/dist/default/production/MyProject.X.production.elf FLASH used . . . . . . . . . = 1303805 bytes ( 62.170%). Remaining is 793347 bytes ( 37.830%). . . . . . . . . . . . . . . . . . . . . . . . . Max is 2097152 bytes. SRAM used by global variables = 15709 bytes ( 2.996%). Remaining is 508579 bytes ( 97.004%) for local (stack) variables or RTOS stack &amp; heap. Max is 524288 bytes. </code></pre> </li> </ol> </li> <li><p><code>-Os</code> - ignores the option and builds successfully at <em>approximately</em> the <code>O1</code> level, but a tiny bit smaller in program space. It produces the same warning as the <code>-O2</code> and <code>-O3</code> options above, and its size results differ slightly from both the <code>-O1</code> and <code>-O2</code> options above.</p> <p>Same type of warning:</p> <pre><code>main.c:1:0: warning: Compiler option (Optimization level &gt; 1) ignored because the free XC32 C compiler does not support this feature. [enabled by default] // ^ cc1: note: Disable the option or visit http://www.microchip.com/MPLABXCcompilers to purchase a new MPLAB XC compiler license. </code></pre> <ol> <li>Size reported in the bottom-left GUI window in the IDE: <ol> <li>Data Used: 478878 bytes (91%)</li> <li>Program Used: 1244452 bytes (59%)</li> </ol> </li> <li>Size reported by my <code>size_mcu</code> script: <pre><code>$ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288 size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = text rodata data bss dec hex filename 750360 494116 15709 463993 1724178 1a4f12 MyProject.X/dist/default/production/MyProject.X.production.elf FLASH used . . . . . . . . . = 1260185 bytes ( 60.090%). Remaining is 836967 bytes ( 39.910%). . . . . . . . . . . . . . . . . . . . . . . . . Max is 2097152 bytes. SRAM used by global variables = 15709 bytes ( 2.996%). Remaining is 508579 bytes ( 97.004%) for local (stack) variables or RTOS stack &amp; heap. Max is 524288 bytes. </code></pre> </li> </ol> </li> <li><p>[Several days later, once my Pro license was active again] As a comparison to the <em>real</em> <code>-Os</code> optimization level with a functional Pro license, here is the output. You can see that the size program size shrunk another 2~3%, so <code>-Os</code> is fully functioning now with the Pro license:</p> <p>No warnings.</p> <ol> <li>Size reported in the bottom-left GUI window in the IDE: <ol> <li>Data Used: 478886 bytes (91%)</li> <li>Program Used: 1184936 bytes (57%)</li> </ol> </li> <li>Size reported by my <code>size_mcu</code> script: <pre><code>$ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288 size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = text rodata data bss dec hex filename 690048 494912 15709 464001 1664670 19669e MyProject.X/dist/default/production/MyProject.X.production.elf FLASH used . . . . . . . . . = 1200669 bytes ( 57.252%). Remaining is 896483 bytes ( 42.748%). . . . . . . . . . . . . . . . . . . . . . . . . Max is 2097152 bytes. SRAM used by global variables = 15709 bytes ( 2.996%). Remaining is 508579 bytes ( 97.004%) for local (stack) variables or RTOS stack &amp; heap. Max is 524288 bytes. </code></pre> </li> </ol> </li> </ol> <h2>Final comments: PIC32 vs STM32 tools</h2> <p>I've found Microchip's IDE, software, configurations, compiler, licenses, support libraries and packages, and GUI configuration tools for microcontroller peripherals to be more irritating, difficult to use, and buggy than ST's comparable tools. Part of that is probably because Microchip's MPLAB X IDE is based on Netbeans instead of Eclipse.</p> <p>Microchip's MPLAB X IDE is cross-platform (Windows, Mac, and Linux), and Netbeans-based. It feels a bit outdated. Their compiler is GCC-based, but locked out with paid licenses which have been integrated into the GPL source code (which is 100% legal and fine in that regard, but irritating). Their license fees are onerous and their license server flaky, costing me days of paid development time. I have built the full XC32 compiler suite royalty-free from source on both Windows and Linux, but have not integrated it for use yet. Feel free to compile it yourself and join the effort to have a royalty-free open source XC32 compiler for PIC32 mcus. Here's my repo: <a href="https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler" rel="nofollow noreferrer">https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler</a>. See the open issues.</p> <p>I still have much to learn about PIC32, but after my many trials with the MPLAB X IDE glitches and quirks, and with my extensive problems with the XC32 compiler licenses, my recommendation is currently this: for anyone looking for a general-purpose high-end microcontroller, I therefore definitely recommend <strong>STM32</strong> ARM-core over PIC32. ST's tools are much better and easier to use. STM32CubeIDE is better, their STM32CubeMX code generator is better, and their support libraries are easier to find and use. Also, all STM32Cube libraries are on GitHub too! See here for the STM32F* chips: <a href="https://github.com/orgs/STMicroelectronics/repositories?q=stm32cubeF&amp;type=all&amp;language=&amp;sort=name" rel="nofollow noreferrer">https://github.com/orgs/STMicroelectronics/repositories?q=stm32cubeF&amp;type=all&amp;language=&amp;sort=name</a>, and here for the STM32H* chips: <a href="https://github.com/orgs/STMicroelectronics/repositories?q=stm32cubeh&amp;type=all&amp;language=&amp;sort=name" rel="nofollow noreferrer">https://github.com/orgs/STMicroelectronics/repositories?q=stm32cubeh&amp;type=all&amp;language=&amp;sort=name</a>.</p> <p>ST's STM32CubeIDE is also cross-platform (Windows, Mac, Linux), and is Eclipse-based, which is better I think. Last I checked, all of ST's software and compiler tools are also royalty-free (no cost) and open source, which is great. No license server problems and lost development time when they are down, and no extra costs.</p> <p>Having said all that, Arduino is amazing, and I love the simplicity and power of Atmel AVR chips. And, Microchip now makes them all. :) When it comes to PIC32 vs STM32, however, I'm currently leaning towards STM32, but I still have much to learn about both.</p> <h2>See also</h2> <ol> <li>My Q&amp;A: <a href="https://electronics.stackexchange.com/a/695772/26234">How to renew your paid Microchip XC32 Compiler Pro license when it has expired or is about to expire</a></li> <li>My question: <a href="https://electronics.stackexchange.com/q/363931/26234">How do I find out at compile time how much of an STM32's Flash memory and dynamic memory (SRAM) is used up?</a> <ol> <li><a href="https://electronics.stackexchange.com/a/523439/26234">My long answer</a></li> <li>My <a href="https://electronics.stackexchange.com/a/598163/26234">Script/command to auto-calculate Flash and SRAM usage for you</a></li> </ol> </li> </ol>
<p>I was previously compiling my C and C++ PIC32 mcu project in Microchip's MPLAB X IDE v6.15 with a paid Pro XC32 compiler license. My license has expired and <a href="https://electronics.stackexchange.com/q/695730/26234">no amount of buying a new one will fix it</a>, so meanwhile I'd like to compile with the free license.</p> <p>On Linux Ubuntu 22.04, I reinstalled the license, but this time chose the &quot;Free&quot; option at the end of the installer process, and yet the compiler is still complaining about the license being gone.</p> <p>Everything on the Microchip website indicates that the free compiler should work just fine: <a href="https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers#" rel="nofollow noreferrer">https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers#</a> (emphasis added):</p> <blockquote> <p>Are you looking for code optimizations? Our <strong>free</strong> MPLAB XC C Compiler comes with the majority of the optimizations you need to reduce your code size and increase its efficiency. If you're unsure which optimizations are best for your design, our <strong>free</strong> MPLAB XC Compiler Advisor can help you find the best optimizations for your project. Specifically, <strong>the free compiler contains these optimizations:</strong></p> <ul> <li>O0 - Ensures that your code is in its pristine state</li> <li>O1 - Invokes all optimizations that won't affect debugging</li> <li>O2 - Invokes a balanced set of speed and size optimizations</li> </ul> <p>When you purchase one of our PRO licenses, you also get the following optimizations:</p> <ul> <li>Os - Gives maximum code size reductions</li> <li>O3 - Gives the best speed optimizations</li> <li>mpa (Procedural Abstraction) - Reduces code size even further</li> </ul> </blockquote> <p>My gcc optimization level is set to <code>1</code>:</p> <p><a href="https://i.stack.imgur.com/LPALc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LPALc.png" alt="enter image description here" /></a></p> <p>And my g++ optimization level is also <code>1</code>:</p> <p><a href="https://i.stack.imgur.com/VvtTH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VvtTH.png" alt="enter image description here" /></a></p> <p>Yet, I still get this error when building:</p> <blockquote> <p>Subscription License has not been renewed - the activation server &quot;http://keyverify.microchip.com&quot; gave the unexpected result -160</p> <p>License has expired</p> </blockquote> <p>So, what project settings do I need to change to make it build with the free compiler?</p> <p>Note that at one point I also tried deleting my license file at <code>/opt/microchip/xclm/license/microchip-1.lic</code>, but I got the same result. (Though maybe I needed to close and reopen the project, not just the IDE?)</p> <p>It's possible I'm misunderstanding the license. Is it free only for C, not C++ projects? I can't find that documented anywhere though.</p> <hr /> <p>Note: If anyone in the community wants to work on using a free, GPL, non-paid XC32 compiler, join me here: <a href="https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler" rel="nofollow noreferrer">https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler</a></p>
How do I make my Microchip MPLAB X IDE project use the free version of the XC32 compiler?
2023-12-29T17:21:14.863
695796
|amplifier|power-amplifier|
<p>With no signal the amplifier should be biased such that both transistors conduct equally and the voltage at the junction of R3, R4, and Rp is zero wrt ground. On a positive going signal Q1 will conduct more and Q2 less, unbalancing the output causing current through Rp. On a negative going signal the reverse happens</p> <p>In practice there will generally be a slight offset voltage at the output due to the transistors not being exact complements of each other. This will cause a current in Rp with no signal. This can be addressed by capacitively coupling Rp or adding an offset adjust circuit.</p>
<p><a href="https://i.stack.imgur.com/sCKFT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sCKFT.jpg" alt="enter image description here" /></a></p> <p>In the class, we found the voltage Vceq2 as 2*Vbe+(R3+R4)*Io, where Io is current through resistors R3 and R4.</p> <p>How are those two currents equal? Should there be a part that goes through Rp?</p>
AB class amplifier
2023-12-29T18:11:13.987
695798
|power-supply|bridge-rectifier|negative-voltage|
<p>I haven't searched for Rod Elliot's article (and you didn't provide a link) but the design looks very like it has been taken directly from the LM317 datasheet.</p> <p>The LM317 ajusts the V<sub>out</sub> to 1.25 V above the voltage on ADJ. That means that with a single-rail supply the variable voltage output can only go down to 1.25 V. If you want to be able to adjust to 0 V then you need to somehow be able to pull ADJ down to -1.25 V.</p> <blockquote> <ol> <li>What is the purpose of R1, R2, C2, C3 in series with the secondary winding and the second bridge rectifier creating the negative rail?</li> </ol> </blockquote> <p>The resistors, R1 and R2, give some current limiting and this may have been added to limit current into Zener D10. More on this later. C2 and C3 provide isolation between the positive and negative rail rectifiers.</p> <blockquote> <ol start="2"> <li>Would this circuit work without them?</li> </ol> </blockquote> <p>No. Imagine they're left out. Now look what happens when the top of the secondary winding goes positive:</p> <p><a href="https://i.stack.imgur.com/n7ZKd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/n7ZKd.png" alt="enter image description here" /></a></p> <p><em>Figure 1. If R1, R2, C2 and C3 are omitted the secondary will be short-circuited.</em></p> <blockquote> <ol start="3"> <li>What is the purpose of D10?</li> </ol> </blockquote> <p>D10 is a simple voltage regulator to limit the voltage into U2 to -15 V. Power dissipation in D10 is limited by R1 and R2.</p> <blockquote> <ol start="4"> <li>Finally, does this circuit work because the negative voltage rail is only being used at small voltage and small current, or would a similar circuit work for a symmetric split rail supply?</li> </ol> </blockquote> <p>This circuit is specifically designed to overcome a limitation of the LM317. It could provide a larger (more negative) voltage but the power out will be limited by R1, R2, C2 and C3. Very often this is enough when the current required by the negative rail is modest in relation to the positive rail.</p>
<p>Rod Elliot has a dual bench power supply project on his web site (project 223, see schematic below). I'm trying to understand his method for adding a low voltage negative rail without using an additional secondary winding. My questions are - What is the purpose of C2, C3 in series with the secondary winding and the second bridge rectifier creating the negative rail? Would this circuit work without them? Finally, does this circuit work because the negative voltage rail is only being used at small voltage and small current, or would a similar circuit work for a symmetric split rail supply?</p> <p><a href="https://i.stack.imgur.com/V2j7i.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V2j7i.gif" alt="Dual Power Supply - Rod Elliot" /></a> <a href="https://sound-au.com/project223.htm" rel="nofollow noreferrer">Project 223 Dual Power Supply Elliot Sound Products</a></p>
How does this negative voltage rail work?
2023-12-29T18:46:49.970
695810
|identification|surface-mount|
<p>Possibly a variation of the Panasonic <a href="https://www.mouser.com/datasheet/2/315/aqv_dip_short_circuit_protection_catalog-1299266.pdf" rel="nofollow noreferrer">AQV216H</a> MOSFET-output SSR.</p> <p>Panasonic offers the AQV258H5 in a 5-pin SMD DIP for applications that require higher creepage distances than the standard 6-pin SMD DIP.</p>
<p>I have no idea what this component is, but the package looks roughly like an SMT version of an old-fashioned DIP package with 6 pins and pin 5 cut off (shortened, hanging).</p> <p>The markings are very small and hard to read because of the reflection from the conformal coating, but I think I read them correctly.</p> <ul> <li>Package: DIP-6 (black 6-pin DIP-like SMT package with pin 5 cut off)</li> <li>Markings: V216HC4 newline 22301 (as best I can read through conformal coating)</li> <li>PCB-ID: LPC101, LPC102, LPC103</li> </ul> <p>Please have a look and see if you can identify it. I had no luck with many online searches.</p> <p><a href="https://i.stack.imgur.com/7AG81.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7AG81.jpg" alt="enter image description here" /></a></p>
Identify surface mount component: DIP-6 size marked V216HC4 newline 22301
2023-12-29T19:47:35.963
695814
|control|
<p>First, we need to name each node:</p> <p><a href="https://i.stack.imgur.com/dBEKT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dBEKT.jpg" alt="enter image description here" /></a></p> <p>Now, let's write down the equations for each node:</p> <ul> <li><span class="math-container">$$\text{S}_1=\text{U}-\text{S}_3\tag1$$</span></li> <li><span class="math-container">$$\text{S}_2=\text{S}_1\cdot\frac{5}{\text{s}+2}\tag2$$</span></li> <li><span class="math-container">$$\text{Y}=\text{S}_2\cdot\frac{1}{\text{s}}\tag3$$</span></li> <li><span class="math-container">$$\text{S}_3=\text{S}_2\cdot4+\text{Y}\tag4$$</span></li> </ul> <p>So, combinding gives:</p> <p><span class="math-container">$$\text{Y}\cdot\text{s}\cdot\frac{\text{s}+2}{5}=\text{U}-\left(\text{Y}\cdot\text{s}\cdot4+\text{Y}\right)\space\Longleftrightarrow\space\frac{\text{Y}}{\text{U}}=\frac{5}{5+\text{s}\left(22+\text{s}\right)}\tag5$$</span></p>
<p>The problem is the one at the top of the page. I was able to reduce the first block diagram into the feedback loop block and I got H(s) = 4s + 1 using the identities in the book. I've spent hours playing with the 5 identities to try and reduce it to the 3rd G(s) block with a feedback loop gain of 1 but I haven't been successful.</p> <p>The closest I've gotten was in combining the feedback loop block of G and H into one block and trying to find some parallel combination with a gain of 1 but it hasn't worked.</p> <p><a href="https://i.stack.imgur.com/t2ltw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t2ltw.jpg" alt="enter image description here" /></a></p> <p>&quot;Linear control systems&quot; Charles Rohrs, James Melsa, Donald Schultz McGraw Hill, 1993</p>
Can anyone point me in the right direction to solve this control systems problem?
2023-12-29T21:56:38.560
695833
|led|mosfet-driver|
<p>Here's is an example using this <a href="https://sten-eswitch-13110800-production.s3.amazonaws.com/system/asset/product_line/data_sheet/233/PVA3.pdf" rel="nofollow noreferrer">SPDT PB switch</a> with RGB LEDs built in.<br /> (One potential source is <a href="https://www.digikey.com/en/products/detail/e-switch/PVA3F2B0SS3R1/8539887?utm_adgroup=&amp;utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=PMax%20Shopping_Product_Low%20ROAS%20Categories&amp;utm_term=&amp;utm_content=&amp;utm_id=go_cmp-20243063506_adg-_ad-__dev-c_ext-_prd-8539887_sig-EAIaIQobChMI8sGQ3b-2gwMVpkxHAR3yEwmMEAQYASABEgKSuvD_BwE&amp;gad_source=1&amp;gclid=EAIaIQobChMI8sGQ3b-2gwMVpkxHAR3yEwmMEAQYASABEgKSuvD_BwE" rel="nofollow noreferrer">Digikey</a>).</p> <p>You would wire up the LEDs as needed to create the color you want at each switch position.</p> <p>As shown when the switch is unactivated the color output would be White since all three LEDs would be enabled. When the switch is pressed the NC pin opens and the Blue LED is disabled, the combined color then changes to Amber, since only the Red and Green LEDs would remain enabled.</p> <p>Since I wouldn't want to take all the fun out of designing this I didn't calculate all of the component values.</p> <p>To select the appropriate current limiting resistor for each LED use:<br /> R = (V<span class="math-container">\${_i}{_n}\$</span> - V<span class="math-container">\${_f}{_L}{_E}{_D}\$</span>) / I<span class="math-container">\${_L}{_E}{_D}\$</span></p> <p>To create a simple surge protection for the circuit you can use a Zener diode shunt and a low current series fuse. You did not list what the potential surge voltage might be so the Zener voltage, power rating, and the fuse amperage need to be selected with that in mind.<br /> .</p> <p><a href="https://i.stack.imgur.com/w8XIs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w8XIs.jpg" alt="enter image description here" /></a><br /> .</p> <p>In case you are persistent in using a feed back system from the ECU (with added wiring) to control the LED colors you could use simple diodes to direct the signals to the correct LED group. See the modified circuit below. Here the YELLOW signal line enables only the Red and Green LEDs, while the WHITE signal line enables the Red, Green, and Blue LEDs.</p> <p>This alternate arrangement would also give you the option to dim the LEDs if that feature were desired. You would use a PWM signal on the YELLOW and WHITE signal lines. .</p> <p><a href="https://i.stack.imgur.com/IYNMB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IYNMB.jpg" alt="enter image description here" /></a></p> <p>.</p>
<p>I am designing a switch for vehicle door control. The details are as follows:</p> <ol> <li>Switch is non latching and it communicates with vehicle ECU on hardwire.</li> <li>When the switch is not pressed it should send 12V to ECU on a hardwire and ECU will send signal to turn on a white LED inside switch.</li> <li>When the switch is pressed it should send 12V on another hardwire to ECU and ECU will send another signal to turn on a amber LED inside switch.</li> <li>The circuit will have surge protection.</li> </ol> <p>We cannot use microcontroller for this, we have to design the circuit with minimum number of components.</p> <p>Can somebody help me designing this circuit ?</p>
Switch Design for door control
2023-12-30T04:59:11.010
695838
|frequency|esp32|microphone|sound|decibel|
<p>Simple: if it's louder than 200 decibels, you're dead.</p> <p>Anything less than that becomes an exercise in measuring transducer displacement at increasing frequencies from infrasound to ultrasound.</p> <p>Somewhere in there the devices popularly known as microphones are relevant.</p> <hr /> <p>Noting what others have said and considering current privacy considerations, I would suggest that the issue is not so much what sort of transducer is used but what is retained in recognisable form or sent to an external server.</p>
<p>I am trying to measure sound intensity in decibels without using microphone in a home automation project. Due to privacy concerns, I don't want to use a microphone in the device. Is there any way I can measure sound intensity without a microphone using an ESP32 microcontroller with some precision?</p>
Is there any way to measure sound intensity in decibels without using a microphone?
2023-12-30T07:44:53.290
695843
|parallel|eeprom|pinout|
<p><a href="https://electronics.stackexchange.com/a/695851/10810">Other answers</a> cover the historical and upgrade-path aspects of this mapping.</p> <p>But...</p> <p>The exact assignment of the data and address lines to binary digits of the address doesn't matter for async SRAM at all. It matters for synchronous SRAM/DRAM only to the extent that there are out-of-band configuration data that needs to be exchanged between the host and the memory device, so the host needs to know what the mapping is, but it's otherwise arbitrary.</p> <p>For PROM it only matters to the extent that both the programmer and the end user must agree on <em>an</em> order for data and address lines. It doesn't matter what it actually is. And certainly it doesn't need anything to do with the labels proffered in the datasheets for the parts.</p> <p>In practice, given the constraints of 2-layer designs, you could tell designers that understood this from those who didn't. The ones who understood it would route with attention to layout, not address pin assignments. Compact layout had EMC, cost and reliability benefits.</p> <p>Those who were less experienced would be beholden to arbitrary labels on the pin's chips, and the layout would take more space and have unnecessary complexity.</p> <p>Sure, there's nothing wrong with &quot;obeying&quot; the labels in a datasheet - but <em>they</em> are arbitrary to begin with. As long as the actual mapping is documented for diagnostics and firmware PROM replacements and such, it's all good.</p>
<p>Many of the parallel memory chips I’ve come across have counterintuitive address line pinouts. Take the AT28C256 32KB EEPROM, for example:</p> <p><a href="https://i.stack.imgur.com/S6qRL.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/S6qRL.jpg" alt="AT28C256 DIP-28 Pinout" /></a></p> <p>The data pins are in near-ascending order (only interrupted by GND), and address pins for A0-A7 are also grouped in an expected manner, but the rest of the address pins are scattered. This is a JEDEC standard pinout, so there must be a reason for it, but I can’t make any sense of it. Why not assign address lines A0-A14 to adjacent pins on the package?</p>
What is the reasoning behind parallel memory pinouts?
2023-12-30T09:38:18.957
695855
|communication|wireless|energy|data-rate|
<p>The total data delivered is <span class="math-container">$$bits = \Delta t_1 R_1 + \Delta t_2 R_2$$</span> The total energy consumed is <span class="math-container">$$joules = \Delta t_1 P_1 + \Delta t_2 P_2$$</span> So the overall efficiency is <span class="math-container">$$\frac{bits}{joules} = \frac{\Delta t_1 R_1 + \Delta t_2 R_2} {\Delta t_1 P_1 + \Delta t_2 P_2}$$</span> If all of the <span class="math-container">\$\Delta t\$</span>s are the same, then they can be factored out and cancelled, and you just have <span class="math-container">$$\frac{bits}{joules} = \frac{R_1 + R_2}{ P_1 + P_2}$$</span></p>
<p>The energy efficiency (EE) in wireless communications is usually calculated as the ratio of data rate to power consumption: how many data (in bits per second) are delivered per consumed power (in watts)? This is usually calculated at some fixed time instant.</p> <p>I have multiple time instants. So, I am confused on how to compute the EE. Let us say there are two time instants, each of duration <span class="math-container">\$\Delta\$</span>t. In the first period, the data rate is <span class="math-container">\$R_1\$</span> bits/s and the consumed power is <span class="math-container">\$P_1\$</span> watts. In the second period the data rate is <span class="math-container">\$R_2\$</span> bits/s and the consumed power is <span class="math-container">\$P_2\$</span> watts. Which one is correct <span class="math-container">$$\text{EE}=\frac{R_1+R_2}{P_1+P_2},$$</span> or <span class="math-container">$$\text{EE}=\frac{(R_1+R_2)}{2(P_1+P_2)}$$</span>?</p> <p>In the first formula, I just summed the data rate over the two time instants and divided by the sum of the consumed power over the two time instants.</p> <p>In the second formula, I computed how many bits are delivered during the two time instants: <span class="math-container">\$\Delta R_1 + \Delta R_2\$</span>. Then I divided the number of bits delivered by the energy consumed (in watt-seconds), which is I computed as: <span class="math-container">\$2\Delta(P_1+P_2)\$</span>. I think this is wrong.</p>
How to compute the energy efficiency in bits/s/watt
2023-12-30T14:36:54.637
695869
|rf|antenna|wifi|
<blockquote> <p>Why is the plastic cover so big, if the antenna inside is so small ?</p> </blockquote> <p>Marketing. Hard to explain why a smaller antenna might work just as well.</p> <p>Also, it seems that the polymer encasing comes in a standard size – deviating from that might cost <em>more</em> than using a smaller enclosure, due to <em>economies of scale</em>.</p>
<p>I am developing a land to land rover remote control system which will operate on 2.4 GHz. I bought several antennas to mount on the rover to test the range (I currently don't have access to any RF measurement tools). Out of curiosity, I disassembled some of the antennas. Most of them were constructed like the bottom antenna (bundled with SIYI MK32E) or were using PCBs. The top antenna, Taoglas GW.71.5153, is different. It has only very short, dipole like structure, and the rest of the plastic is empty!</p> <p>Why is the plastic cover so big, if the antenna inside is so small? Is the design correct, or is this manufacture mistake and the antenna is incomplete?</p> <p><a href="https://i.stack.imgur.com/yIn1k.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yIn1k.jpg" alt="GW.71.5153 and SIYI Antenna" /></a></p>
Commercial 2.4GHz antenna construction differences
2023-12-30T16:43:37.353
695878
|operational-amplifier|amplifier|differential-amplifier|
<p>Take note of this stated in the data sheet (page 12) regarding the LT1817 you have attempted to use for generating a DC mid-rail voltage (DC_BIAS): -</p> <blockquote> <p><strong>The LT1815/LT1816/LT1817 are optimized for high bandwidth and low distortion applications. They can drive a capacitive load of 10pF in a unity-gain configuration and more with higher gain.</strong></p> </blockquote> <p>In other words, that op-amp (with 100 nF on the output) will turn into an oscillator and, you'll get the likely strange behaviour you see.</p> <p><a href="https://i.stack.imgur.com/Yp0Tt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yp0Tt.png" alt="enter image description here" /></a></p>
<p>The example circuit on the schematic generates square wave like output and the signal appears at the top of that square wave (see the scope output screenshot).</p> <p>All i need is to amplify differential signal while converting it to a single ended signal and place it on a 1.65V fix dc bias voltage to be able to sample it with 0-3.3V ADC.</p> <p>What is the reason of this output.</p> <p><a href="https://www.analog.com/media/en/technical-documentation/data-sheets/181567fb.pdf" rel="nofollow noreferrer">LT1817 Datasheet</a></p> <p><a href="https://i.stack.imgur.com/lYlEW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lYlEW.png" alt="example schematic" /></a> <a href="https://i.stack.imgur.com/UxYMT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UxYMT.jpg" alt="Scope output" /></a> <a href="https://i.stack.imgur.com/ZYMAm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZYMAm.png" alt="dc bias circuit" /></a> <a href="https://i.stack.imgur.com/zjNi1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zjNi1.png" alt="differential signal source" /></a></p>
Differential Signal Amplification with Op-Amp DC Biasing Problem
2023-12-30T18:43:31.650
695881
|microcontroller|arm|texas-instruments|jtag|openocd|
<h2>CJTAG</h2> <p>CJTAG is defined in <a href="https://standards.ieee.org/ieee/1149.7/7703/" rel="nofollow noreferrer">IEEE-Std-1149.7</a>, an extension to JTAG. A TAP with .7 functionality is called a TAPC in the spec.</p> <p>Main idea behind 1149.7 is to provide alternate wire protocols for JTAG, among which some use only two wires (TCK and TMS, called TCKC and TMSC in .7 world). This involves transmitting data that is usually on TDI/TDO through TMSC.</p> <h2>CJTAG in CC2652</h2> <p>Nonetheless, CC2652 TAPC also supports &quot;classic&quot; 1149.1 4-wire protocol. Thing is you have to reconfigure the TAPC to switch to this mode. This involves writing to TAPC registers with a specific protocol (not using TDI and TDO, as they are not specified at this time).</p> <h2>CJTAG TAPC registers</h2> <p>Each TAPC has a set of registers that can be written to. This uses the protocol defined in 1149.7 chapter 9, explained as well in <a href="https://www.ti.com/lit/ug/swcu185f/swcu185f.pdf" rel="nofollow noreferrer">CC2652 Reference Manual</a> chapter 6.2.1.</p> <p>Basically, this uses the usual JTAG TAP states, in an unusual yet standard and benign way, to transfer data. It uses three operations:</p> <ul> <li>DR Capture,</li> <li>DR Shift,</li> <li>Run/Test-Idle.</li> </ul> <p>RTI state marks the boundary of the command, Capture moves between successive values, Data value is the count of bits transferred with Shift. Everything is done using an instruction where DR shifts never harm, like Bypass or IDCODE. Note a TAP is mandated by standard to be reset in one of these states.</p> <h2>Changing to 4-wire JTAG</h2> <p>This requires to send the following commands to TAPC:</p> <ul> <li>Control level lock to 2,</li> <li>STC2, unconditionally (c = 0), APFC (bb = 0), on (v = 1),</li> <li>STMC, StateCtl (bbb=0), ECL (xy=1).</li> </ul> <p>This is translated to the following shift counts separated by RTI:</p> <ul> <li>Constant, [0, 0, 1],</li> <li>CP0 = 0b00010, CP1(cbbvv) = 0b01001, i.e. [2, 9],</li> <li>CP0 = 0b00000, CP1(bbbxy) = 0b00001, i.e. [0, 1].</li> </ul> <p>This translates to the following sequence (intermediate state are omitted):</p> <ul> <li>RTI,</li> <li>Capture DR, Update DR, Capture DR, Update DR, Capture DR, Shift DR 1 cycle, Update DR, RTI,</li> <li>Capture DR, Shift DR 2 cycles, Update DR, Capture DR, Shift DR 9 cycles, Update DR, RTI,</li> <li>Capture DR, Update DR, Capture DR, Shift DR 1 cycle, Update DR, RTI.</li> </ul> <p>Note if no Shift happens between Capture and Update, you must go through the following states: Capture, Exit1, (optionally Pause and Exit2), Update. This effectively shifts no bit between Capture and Update, and is called a Zero-bit shift (ZBS). If not marked above, going from Update to capture must happen through the &quot;short&quot; path that goes from Update to Select DR (TMS=1).</p> <p>Note that the actual TDI value is meaningless, here counts the number of states you run through Shift DR.</p> <p>If ever you reset the TAP, you must go through this again.</p> <h2>Are we there yet ?</h2> <p>Of course not.</p> <p>CC26xx features a TAP router called iCEpick that allows to dynamically connect / disconnect other TAPs from the chip in the chain. By default, iCEpick does not expose any other TAP than its own. We need to enable the Cortex' one, but first, we need to set the connect register (See Ti CC2652RM, 6.3.2.8)</p> <p>ARM JTAG-DP enablement is performed through the Router register (See 6.3.3) with:</p> <ul> <li>Write-enable = 1,</li> <li>Block = Debug,</li> <li>Number = 0,</li> <li>Value bit 8 = 1.</li> </ul> <p>This boils down to a write to</p> <ul> <li>IR = 7, DR = 0x89 (8 bits)</li> <li>IR = 2, DR = 0xa0280127 (32 bits), run for 10 cycles.</li> </ul> <p>After this, ARM JTAG-DP is in the chain, and enumeration may happen normally.</p> <h2>Flash programming</h2> <p>Like most ARM Cortex-M based microcontrollers, CC26xx are programmed by using the main memory bus to issue commands to the flash controller (I already did a breakdown of all this in <a href="https://electronics.stackexchange.com/questions/390556/how-does-jtag-program-an-mcu/390613#390613">another answer</a>).</p> <h2>Chip Mass-erase</h2> <p>Besides ARM JTAG-DP (that allows debug and programming), CC26xx features another TAP called &quot;WUC&quot; that can be connected to the chain through iCEpick. This TAP has a few commands defined in the TRM (chapter 6.8), one of which is CHIP_ERASE_REQ (IR=1, DR=2). Actual usage of this command is a bit underdefined.</p> <h2>OpenOCD</h2> <p>All above is basically performed in OpenOCD's TCL inits: <a href="https://github.com/openocd-org/openocd/blob/master/tcl/target/ti-cjtag.cfg" rel="nofollow noreferrer">cJTAG init</a>, <a href="https://github.com/openocd-org/openocd/blob/master/tcl/target/icepick.cfg" rel="nofollow noreferrer">iCEpick init</a>.</p> <h2>Notes</h2> <p>Don't expect any answer when issuing TAPc register writes, there is no defined response possible, not even at the protocol level.</p> <p>iCEpick has a lot of registers, you can basically enumerate all sub-TAPs. This is mostly explained in the datasheet.</p> <p>You may run TMS as slow as necessary, even 0.1 Hz. I would not recommend to bit-bang this by hand anyway.</p> <p>Most of the standard concepts and workings are explained in the <a href="https://www.ti.com/lit/ug/swcu185f/swcu185f.pdf" rel="nofollow noreferrer">CC2652 Reference Manual</a>. Problem with this datasheet is terrible writing. Once you read the standard and understand it, you start understanding the datasheet.</p>
<p>As in <a href="https://electronics.stackexchange.com/questions/586055">another question</a>, I have a CC2652 which is locked in cJTAG mode. I would like to completely erase the flash memory so that the bootloader is re-enabled, but I don't have a JTAG or cJTAG debugger (the bootloader uses serial UART for which I already have the FT232RL).</p> <p>So, for just this one &quot;Erase Flash&quot; cJTAG command, plus all the handshaking protocols needed around it, how can I bit bang the TCK and TMS signals? I have an Arduino (and other programmable microprocessors with GPIO pins) to easily control the TCK and TMS signals.</p> <p>A complete answer with all toggles and time points is probably too much to ask for here, so just a crude flow sequence would be fine.</p> <p>Firstly, I am wondering how much I can slow the TCK clock down. Could I just manually toggle this clock signal every 10 seconds and walk through the TMS toggling manually (either 0V, or 3V, or high-impedance when a response is expected)?</p> <p>Secondly, I am wondering what responses will come on TMS. Are there just a few ACK/NAK along the way? With wishful thinking for ACKs only, can I just ignore responses?</p> <p>This would make for a good low-level-timing cJTAG learning example (I can't find any oscilloscope timing diagrams of cJTAG communication on the internet to help me understand this though it seems like most embedded microcontrollers are moving to cJTAG). The full spec might be in <a href="https://www.ti.com/lit/ug/swcu185d/swcu185d.pdf" rel="nofollow noreferrer">TI's application note</a> but, before I dig into it, I want to estimate how much time this whole project would take me...I really don't want to spend weeks on this, but I often fall down these &quot;rabbit holes&quot; and regret it in the end.</p>
CJTAG Bit Banging - Just Erase the Flash
2023-12-30T18:58:55.433
695882
|arduino|analog|filter|hardware|
<blockquote> <p>The purpose of Resistor R8 was to limit current for the D4 5.1V Zener in case the analog input saw more than 5V so as to not damage the mcu pin. But because it was in series with the analog input, it would create a voltage drop and therefore skew results.</p> </blockquote> <p>Analog inputs draw negligible leakage current when the ADC is not sampling. During sampling, they draw a small current spike to charge the current capacitor. In your case this current comes from the 100nF filter cap, and voltage drop on the 1k resistor will be negligible.</p> <p>If you measure 0.1V across the 1k resistor, that's 100µA which is orders of magnitude too high.</p> <p>Maybe you forgot to disable the micro's internal pullup/pulldown on the analog input, or the Zener diode has too much leakage.</p> <blockquote> <p>I am guessing the simplest solution would be a low pass filter with R = 100K and C = 150nF but figured this was a good learning opportunity to explore op-amps too.</p> </blockquote> <p>Every time the ADC samples, it draws a spike of current to charge its internal sampling capacitor. The minimum source impedance specified in the datasheet is calculated so the sampling capacitor charges fast enough to settle to &lt;1LSB of the target voltage within the sampling time window. However if you put a filter cap on the input, then the source resistance is near zero, as the sampling capacitor charges directly from the cap. This also discharges your filter cap every time the ADC samples. For accurate measurement, if your source impedance is higher than the maximum specified in the datasheet, then the cap should be 2^N times higher than the ADC sampling cap (with N ADC bits) so when the ADC pulls charge from it, voltage on the sampling cap does not decrease more than 1LSB.</p> <p>Also if your source impedance is higher than the maximum specified in the datasheet, sampling too frequently will discharge the filter cap before it has time to recharge via the source resistance, so you have to be careful about that.</p> <p>Some micros have very accurate ADCs, others not so much. It's important to look at the ENOB (Effective Number of Bits) or SNR (Signal Noise Ratio) in the datasheet. If a 12-bit ADC has 9 ENOB (like many STM32) then you get 9 bits of ADC and 3 bits of noise on top for free.</p> <p>Also the accuracy of your ADC is the accuracy of the voltage reference used by the ADC, because the digital output value is the ratio of input voltage and reference voltage. If the reference is VCC and it has some ripple on it due to varying supply current draw, then your ADC will lose accuracy. Solutions are a separate reference chip which can be a cheap LDO, or at least some decent filtering, or using the internal reference.</p> <p>Arduino boards are made cheap, they use VCC as reference and use 2 layer board with no ground plane, and there are few ground pins on the connector. This means any current going in and out of the pins will have its return current in the single ground pin, which creates voltage drop. So the actual potential of &quot;ground&quot; as seen by the ADC inside the micro may be different from what you think &quot;0V&quot; is. A proper PCB where you know where &quot;0V&quot; actually is really helps.</p>
<p>I am designing a SMPS (see <a href="https://electronics.stackexchange.com/q/687177/11683">previous question</a> if curious) and need to provide the mcu with an output feedback voltage to dial in the duty cycle for closed loop control.</p> <p>Using an Arduino (Leonardo in this case), I am always frustrated with the fluctuation of 'counts' returned from AnalogRead(). I have tried slowing the polling (I only want 50-100ms response), running average software filters, and other software band-aids. The purpose of this question is whether it can be solved in hardware instead so I can tinker and learn a bit.</p> <p>Version 1 of my circuit looked like this: <a href="https://i.stack.imgur.com/6vB0I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6vB0I.png" alt="Analog Input Version 1" /></a></p> <p>The purpose of Resistor R8 was to limit current for the D4 5.1V Zener in case the analog input saw more than 5V so as to not damage the mcu pin. But because it was in series with the analog input, it would create a voltage drop and therefore skew results. As the load resistance varied (potentiometer) so did the voltage across R8 and it was hard to calibrate the analog input in software.</p> <p>I then began learning about using an op-amp as a buffer instead which has &quot;infinite&quot; input resistance, and therefore whatever series resistor value was chosen would be magnitudes smaller and have minimal effect on the outcome.</p> <p>Version 2 of my circuit looks like this: <a href="https://i.stack.imgur.com/RvDqm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RvDqm.png" alt="Analog Input Version 2" /></a></p> <p>The output is much more stable, but my question is whether I am 'over-doing' it with this circuit?. How do you calculate an RC time constant when the op-amp has infinite resistance? As stated above, I want my response time to be 50-100ms with 20-50mV peak to peak range. I feel like this is certainly doable... Any suggestions or tips and tricks would be suggested.</p> <p>I am guessing the simplest solution would be a low pass filter with R = 100K and C = 150nF but figured this was a good learning opportunity to explore op-amps too.</p> <p>PS: the 74LVC2G66 device is what I am using to enable and disable 10K pullup and 10K pulldown resistors for other experiments. When both switches are off, they ~should not effect the series resistance of the analog input.</p>
Improving Analog Input Readings into an Arduino - Circuit Design
2023-12-30T19:05:19.770
695901
|circuit-design|high-voltage|h-bridge|
<p>You missed some completing data: What is the DC resistance of the AC motor? Its nominal current at operation? Full mechanical and without any load)</p> <p>Anyway, I assume the motor is something like 500 W or more, with DC resistance of 30 Ohms or less.</p> <p>D9 and D12 make me think that signals should be something around 12 to 15 Volts. <strong>But Signal1 and Signal2 are 5 V</strong> and so will be UGS of Q1 and Q4 - even less due D10 and D11 (and R12/R11, R13/R14)! UGS can be something around 4.5 V - due to Fig. 1 and Fig. 2 of IRF640 - it is <em>typical</em> to have ca. 0.5 A at 1V UDS at 25°C, even heated up to 150°C (Fig. 2) it will have ca. 2 A at 1 V UDS - your motor probably pulls more, so it will end up with more than 2.5 A at more than 50 V --&gt; more than 100 W, no wonder the MOSFETs burn/overheat. All values above are typical, so some MOSFET may be better! Summarized - <strong>you operate the Q1 and Q4 in bad/worst operation areas</strong> with UGS = ca. 4.5 V or even less!</p> <p>And the 5V signal is really 5V? Depending on the logic family the High can be as low as 2 V for TTL!</p> <p>You definitely need a level shifter that amplifies the 0 and 5V to 0 and 12 V!</p> <p>Additionally you need a push <strong>and pull</strong> driver before the signal1 and signal2 connectors. So remove D10 and D11 (and D9 and D12 are not needed with a 12 V supply). Why? The MOSFETs have a parasite capacitance between Gate and Source of 1.3 nF (typical only!) at 0 V UGS. So the discharge time with R12 or R14 gives 15 k * 1.3 nF = ca. 20 us time constant. That means at switching off the MOSFET the UGS will fall slowly to 0 V and passes some critical areas, where ID and UDS of the MOSFET are producing a lot of power loss. That it could be damaged.</p> <p>The high side (Q2 and Q8) will switch on and off slowly/ier too - as some commenters mentionned. To build a pull push driver for their gates with 12 V supply is even more effort.</p> <p>Instead you could use more signals signal3 for Q2, signal4 for Q8, that have time delay to signal1 and signal2 instead. In such a manner that the slowly switching Q2 and Q8 ocurrs only if both Q1 and Q4 are completely switched off. Then only Q1 and Q4 have to be switched on and off with good push-pull driver by 12 V power supply. In this case the range of PWM will be limited due to the waiting times for Q2 and Q8 completely switching off and on respectively.</p>
<p>I'm trying to design an H-bridge circuit for 165 volts and am having some trouble. The motor I'm driving is actually an AC motor, which is why I'll be switching the signals 60 times per second, with variable offtime to get the motor to the correct speed. This is not where my problem lies however. My problems arise when building the below schematic, I can't get it to work, but it's not a consistent error either, sometimes some MOSFETs stay conducting, sometimes they overheat and sometimes a resistor burns up, it keeps changing. So I was hoping to get some advice from you people as to what might be going wrong. If you'd just look at my schematic, that would be great.</p> <p>Datasheets: <a href="https://www.irf.com/product-info/datasheets/data/irf640.pdf" rel="nofollow noreferrer">IRF640</a>, <a href="http://www.e-ele.net/DataSheet/IRF9640.pdf" rel="nofollow noreferrer">IRF9640</a></p> <p><a href="https://i.stack.imgur.com/tI3y8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tI3y8.png" alt="Schematic" /></a></p>
High voltage (165V) H-bridge design
2023-12-30T23:40:24.223
695903
|led|parallel|series|home-automation|mains-supply|
<p>Addressing the series / parallel question:</p> <blockquote> <p>When drawing ... I put the LEDs in parallel as I thought that would be best - as they would then both have 230V.</p> </blockquote> <p>Some of your confusion is that you are referring to LED lamp bulbs as &quot;LEDs&quot;. The 230 V LED lamps consist internally of many LED in series along with the required power supply to enable continuous operation at the rated voltage, 230 V in this case.</p> <blockquote> <p>I have read that they should be installed in series, but I am confused by this as though I understand that the current then remains constant - I am not understanding regarding the voltage drop as I understand the LEDs being in series would create a voltage divider and would then not provide the 230V required for the LEDs.</p> </blockquote> <p><a href="https://i.stack.imgur.com/4t6Fy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4t6Fy.png" alt="enter image description here" /></a></p> <p><em>Figure 1. An LED mains lamp. Image source: <a href="https://lednique.com/bulbs/dimmers-for-leds/" rel="nofollow noreferrer">LEDnique</a>.</em></p> <p>You will find that the LEDs are wired in series inside the lamp. (Brighter lamps may have parallel strings of series-connected LEDs.)</p> <blockquote> <p>I’m looking to run it through 1 mm<sup>2</sup> wiring, with Waco [Wago?] 32A 3-way connectors. The wiring will be open, in insulated - in the loft space.</p> </blockquote> <p>1 mm<sup>2</sup> wiring would be adequate for lighting but may not be adequate for your local electrical insulation standards. I'm hoping that you mean, &quot;The insulated wiring will be laid on top of the insulation in the loft space.&quot;</p> <blockquote> <p>I am trying to control two 100W LED security lights ...</p> </blockquote> <p>100 W is very powerful for an LED lamp. I suspect that is their &quot;equivalent incandescent bulb light output&quot; and they probably consume &lt; 20 W. Check the packaging.</p>
<p>I am trying to control two 100W LED security lights via a motion sensor. The motion sensor is a Philips Hue and runs on the Zigbee network, the LED’s are 230V.</p> <p>I have purchased a Raspberry Pi and installed home assistant so as to take the Zigbee signal from the sensor and then output a Z-Wave signal to a mains voltage Z-Wave controlled switch.</p> <p>I am now trying to configure how I shall wire it up so I can purchase the wire and install it. I’m looking to run it through 1 mm^2 wiring, with Waco 32A 3-way connectors. The wiring will be open, in insulated - in the loft space.</p> <p>When drawing how I planned to connect everything, I put the LEDs in parallel as I thought that would be best - as they would then both have 230V. From googling and reading numerous posts it appears that is a bad idea as I don’t want the LEDs to catch fire and burn my house down. I have read that they should be installed in series, but I am confused by this as though I understand that the current then remains constant - I am not understanding regarding the voltage drop as I understand the LEDs being in series would create a voltage divider and would then not provide the 230V required for the LEDs.</p> <p>I have attached a photo of the two drawings I have made and hope I have made sense and would appreciate any help with this. If it is so that I should wire them in series, is my drawing correct? If it is not or if I should not then any advice is most gratefully received.</p> <p><a href="https://i.stack.imgur.com/a7lhD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a7lhD.jpg" alt="enter image description here" /></a></p>
Controlling 230V LEDs with a single Z-Wave switch
2023-12-31T02:47:55.163
695906
|mosfet|p-channel|
<p>Simple inverter should work. For Bjt use some signal transistor like 3904. 100k resistor certainly do not affect the signal source.</p> <p><a href="https://i.stack.imgur.com/YY4Bv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YY4Bv.jpg" alt="enter image description here" /></a></p>
<p>So I'm basically trying to take a control signal from one device (5 V), and use it to control a 12 V LED strip (1 A or more).</p> <p>The control device is an electronic dance pad (StepManiaX Stage,or Dance Dance Revolution if that helps). I have checked how the signal is output on the electronics and it seems that the signal wire is constantly at 5 V, but when the panel is stepped on it gets pull down to 0 V (ground). What I want, is to light up the LED strips when that signal is pulled to 0 V which is typically the opposite for when you use a MOSFET as a switch.</p> <p>I have previously used MOSFETs as switches to drive LED strips, but it's always been a high control signal to turn them on. I have tried looking up the answers to this, but I must admit I have become somewhat overwhelmed with something I thought would have a fairly simple solution.</p> <p>My gut tells me I possibly want to use P-channel instead of N-channel, but I can't seem to wrap my head around it.</p> <p>Ideally I also don't want to affect the control signal in any significant way as I am essentially splitting it so it still goes to where it was originally headed, and also to my LED strip circuit, so ideally the solution doesn't introduce any thing weird with the original signal.</p> <p>I mocked up a simple circuit diagram of what I <em>think</em> it would essentially look like.</p> <p><a href="https://i.stack.imgur.com/KFAOj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KFAOj.png" alt="theoretical circuit" /></a></p>
How do I switch on an LED strip when the control signal is pulled low?
2023-12-31T04:09:15.983
695914
|arduino|circuit-design|switches|capacitive|
<p>This is a resistive touch switch; it uses the resistance of the skin to close a circuit, originally probably enabling a base-emitter current to flow in a (Darlington) BJT that does the actual switching.</p> <p>There are many circuits on the interwebs for this, just google &quot;resistive touch switch circuit&quot;.</p>
<p>I have this switch from a Phillips Electronic 212 turntable. It’s simply two metal pieces, one a ring and the other a button like center. I’m not sure but I think that this is a capacitive sensor or button.</p> <p>I need the circuit to connect this switch to an Arduino. When my finger touches both metal parts, the Arduino should read a digital HIGH and when I release a LOW.</p> <p>Perhaps this can be read from analog pins too.</p> <p>I can code whatever this needs to work, but I don’t know what the circuit for something like this would look like.</p> <p>My code would probably depend on the circuit being connected to a digital pin or an analog one.</p> <p>I’m attaching pictures of the switch.</p> <p><a href="https://i.stack.imgur.com/2D8R2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2D8R2.jpg" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/YmfnP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YmfnP.jpg" alt="enter image description here" /></a></p>
Vintage capacitive switch
2023-12-31T06:45:19.100
695929
|keyboard|matrix|
<p>Oh, duh; of course I figure it out moments after I post the question.</p> <p>The diodes prevent a high port C output from driving a low port C output, creating a short circuit between the two that would no doubt make the chip very unhappy.</p> <p>If output PC4 is driven low and output PC5 is driven high, holding down the 0 key will bring the column and PA0 low which is fine, because there's a resistor R66 between the current source and the row and column.</p> <p>However, if you hold down both the 0 and 8 keys, you will have shorted together the two rows. The diodes prevent any shorted rows that are connected to high output row select pins from driving unlimited current into the rows that are connected to ground via the low output row select pin.</p> <p>Is this right?</p>
<p>The following is the keypad circuit of a NEC TK-85 8085 trainer board. Port C-upper of the 8255 programmable peripheral interface is set to output, and you bring low the row you want to scan, leaving the other two rows high. Port A is set to input, and from that you can read off which keys in that row are pressed (and possibly ghost keys if the correct combinations of keys in other rows are pressed).</p> <p>The three 1SS53 diodes are small signal diodes, very much like a 1N4148. If I'm understanding this right, they allow the output port to pull row lines low, but prevent it from driving the row lines high, so that the row lines are floating when when not being actively pulled low.</p> <p>What is the purpose of these three diodes?</p> <p><a href="https://i.stack.imgur.com/N9q7V.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N9q7V.jpg" alt="TK-85 keyboard circuit" /></a></p>
Why are these diodes on the row inputs of this matrix keyboard with column pull-ups?
2023-12-31T12:04:44.207
695932
|signal|display|terminology|
<blockquote> <p>The right signals and data are sent (I checked with a logic analyser), and I can see the display resetting, but not displaying any data.</p> </blockquote> <p>Section <em>7.2 Reset Timing</em> of the S1D13700F01 <a href="https://newhavendisplay.com/content/app_notes/S1D13700.pdf" rel="nofollow noreferrer">datasheet</a> contains:</p> <blockquote> <p>A delay is required following the rising edges of both RESET# and VDD to allow for system stabilization. This delay allows the clock used by the internal oscillator circuit to become stable before use. The <strong>LCDC must not be accessed before the oscillation circuit is stable</strong>.</p> </blockquote> <p>Where the <em>Oscillator stable delay</em> is a minimum of 3 milliseconds:</p> <p><a href="https://i.stack.imgur.com/n0Cv3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n0Cv3.png" alt="enter image description here" /></a></p> <p>The LSA capture in the question shows an attempt to write to the display within tens of microseconds after the rising edge of <code>/RESET</code> and therefore operation of the display may not be reliable.</p> <p>Suggest that insert a minimum delay of 3 milliseconds after the rising edge of <code>/RESET</code> before attempting to write to the display.</p> <blockquote> <p>I am a little confused by the term &quot;strobe&quot; in the datasheet, as that seems to be a pulse, making me think this signal should see a low-to-high to work.</p> </blockquote> <p>I think the NHD-320240WG display has configured the S1D13700F01 controller to use Generic Indirect host interface mode, based upon which signals are shown on the <em>Pin Description and Wiring Diagram on the display datasheet</em>. The S1D13700F01 datasheet <em>Table 11-2 Generic Indirect Addressing Command/Write/Read</em> suggests should be OK with /RD pulled high as just means can't perform a <code>Parameter Read [P#]</code> operation (given the question mentions the application has no need to read from the display).</p>
<p>I am trying to get the <a href="https://newhavendisplay.com/content/specs/NHD-320240WG-BxTFH-VZ.pdf" rel="nofollow noreferrer">NHD-320240WG</a> display to run using my 8 bit hobby computer. I have successfully gotten this display to work with an Arduino and have ported the code to 6502 assembly.</p> <p>When measuring all signals, everything looks fine. The right signals and data are sent (I checked with a logic analyser), and I can see the display resetting, but not displaying any data.</p> <p><a href="https://i.stack.imgur.com/AjHiJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AjHiJ.png" alt="enter image description here" /></a></p> <p>The only thing that is different between the Arduino and 8-bit computer is the /RD signal. According to the <a href="https://newhavendisplay.com/content/app_notes/S1D13700.pdf" rel="nofollow noreferrer">documentation</a>:</p> <blockquote> <p>When the Generic host bus interface is selected, this pin is the active-LOW read strobe (RD#). The S1D13700F01 data output buffers are enabled when this signal is low.</p> </blockquote> <p>so, I have this pin hardwired to +5V, as I never need to read anything from the display.</p> <p>In the Arduino version though, this pin gets a single rising edge, before the reset sequence:</p> <pre><code> DDRC = 0xFF; //set PORTC (control signals) as output, this includes /RD PORTC = 0x00; DDRA = 0xFF; //set PORTA (data signals) as output PORTA = 0x00; pinMode(CS,OUTPUT); digitalWrite(CS, LOW); digitalWrite(RD, HIGH); digitalWrite(WR, HIGH); digitalWrite(RES, LOW); delay(10); digitalWrite(RES, HIGH); delay(100); </code></pre> <p>I am a little confused by the term &quot;strobe&quot; in the datasheet, as that seems to be a pulse, making me think this signal should see a low-to-high to work. Even though it says the output buffers are enabled when the signal <em>is</em> low (as opposed to <em>becomes</em>).</p>
Do I need to edge instead of set a pin that is considered a "strobe"?
2023-12-31T12:59:38.493
695934
|power-electronics|motor-controller|universal-motor|
<p>From a design review standpoint, I would offer these general observations:</p> <ul> <li>No line filter</li> <li>No ESD protection or RFI filtering on the MCU</li> <li>Only one line fused; a second fuse could be added to help rule out ground faults (but shouldn't be necessary as such). (Does seem unlikely, given the full-house GFCI.)</li> <li>Fuse is definitely underrated, if it's exploding! Use a type rated for available mains fault current (at least a couple kA, perhaps even 10kA+). A ceramic type may be needed, or a larger &quot;midget&quot; type.</li> <li>Diode needs to be fast-recovery type; motor inductance will be high enough to run in CCM (continuous conduction mode) even at fairly low throttle (though, see below).</li> <li>Gate resistor is way too small, given the low switching frequency and lack of filtering.</li> <li>Fast switching may drive transient voltages through the motor and wiring. Roughly speaking, the motor will have some RLC equivalent circuit at edge-related frequencies (say 10-100 MHz), which acts as a series resonant circuit or transmission line stub, developing a peak up to double the applied voltage. (Whether this actually occurs to a significant degree, depends on the RLCs.)</li> <li>Beware motors with internal filtering. As brushed type motors are very noisy, they may be equipped with noise filtering, internally or inline in equipment wiring. This was not mentioned, so it's worth noting the possibility at least.</li> <li>The control cannot sense load current</li> </ul> <p>Also just to lampshade the elephant(s) in the room -- I'm guessing the massive 10W power supplies were already on hand? So I'm not dinging that as a design issue per se. (After all, what's better than a 0$ BOM item?..)</p> <p><strong>EMC Points</strong></p> <p>Of course, these probably aren't related to the observed failure; they're added more for completeness. Given you've been testing with a radio, maybe it's fine anyway; do mind to check at multiple frequencies across the band, particularly several adjacent channels at a time, as 20kHz harmonics could skip every other channel and you might simply miss it. (You could also pull a sneaky and make it some oddball 18.573 or whatever kHz, so the harmonics will land well within a channel <em>somewhere</em>. Or, this doesn't matter if it's an &quot;old fashioned&quot; continuously-tuned radio.) Likewise, given observations, maybe the MCU filtering is more nice-to-have rather than necessary; severity depends on software as well i.e. digital filtering / debouncing as well, which is not documented here.</p> <p><strong>Gate Resistor</strong></p> <p>Superjunction MOSFETs really are different beasts from what conventional wisdom says about MOSFETs. First I'll discuss switching speed in the application, then discuss SJ FETs.</p> <p>Faster switching gains you nothing here: suppose allowable dissipation is 1W (none or small heatsink), and load current is up to 1A (well over 100W at 320VDC supply!). A triangular commutation waveform has a dissipation of (total rising plus falling), <span class="math-container">$$ P = V I F_\text{sw} t $$</span> or a time up to 0.16µs is tolerable. With a small heatsink, and limited to lower currents, a sizable fraction of a µs will be tolerable, pushing the cutoff for harmonics below 10MHz.</p> <p>Note that turn-on incurs additional losses <span class="math-container">\$P_\text{on} = \frac{1}{2} V I_{rr} F_\text{sw} t_{rr}\$</span>, for whatever peak recovery current and recovery time the diode has under the conditions (<span class="math-container">\$I_F\$</span> and <span class="math-container">\$dI/dt\$</span> at FET turn-on). Hold onto this thought for later.</p> <p><strong>Superjunction:</strong> the thing is, the drain capacitances (D-G and D-S) behave unlike anything you will find in textbooks, application notes (except for the scant few documenting this) or older books (or newer ones for that matter, when the author(s) simply aren't aware). It well and truly <em>switches</em> between high and low capacitance regimes, at a ballpark 10-50V threshold.</p> <p>Datasheets plot the transition region as a steep capacitance curve, but in fact it is a discontinuity where, during the transition, capacitance is not a meaningful description of the process (the incremental capacitance may explode towards infinity, go negative, back and forth..). The curves look smooth because of measurement method (the discontinuity is smooshed out, more or less).</p> <p>For EMC purposes, the impact is that gate resistance predominantly controls the propagation delay moreso than the voltage rise/fall time, and it controls <span class="math-container">\$dI/dt\$</span> to the extent that this parameter is determined by C<sub>iss</sub> and the transconductance curve (as opposed to source inductance, which degenerates the effect of gate resistance). This is easiest to see looking at Vds vs. Vgs: the bulk of the Miller plateau is at low voltages; the voltage swing is dictated more by load impedance (and what drain capacitance is left) than by gate current.</p> <p>For point of reference, I have a design with 105mΩ transistors (same family, different part) driven with a 22Ω gate resistor. The Vds rise time is ~10ns, giving more-or-less minimal switching loss.</p> <p>At least several hundred Ω gate resistance seems appropriate here, perhaps up to the low kΩ.</p> <p>To control <span class="math-container">\$dV/dt\$</span>, then, we can put back a controlled amount of C<sub>DG</sub>. An R+C is suggested, to dampen potential VHF oscillation. <span class="math-container">\$dI/dt\$</span> can be limited by adding source inductance (perhaps a ferrite bead or several?).</p> <p>Example value would be, let's say... 300V swing, 100ns time, 100Ω gate resistor with 12V drive and 4V Miller plateau = 8V dropped across the resistor or 80mA, so 80mA * 100ns / 300V = 27pF. With a series resistor of 100-1k Ω, say.</p> <p><strong>Motor Paranoia / Filtering</strong></p> <p>This is kind of just, good reasons to filter the output in general, and as mentioned, harmonics or transients can drive peak voltages internal to the windings, or across brushes/commutator, etc.; or if filtering is already present, likely it's not of an impedance and topology friendly to the buck converter and results in large peak currents, excessive ringing, and probably poor PWM control too.</p> <p>The existence of a motor EMI filter is easily verified by inspection, of course. Mind, it could be internal to the motor, which needs to be inspected as well. (Rare I would think? But possible.)</p> <p>Now, output filtering doesn't need to be total; a small series L, then shunt R+C, could be used to chop off the highest harmonics, and give a controlled impedance that acts to terminate or dampen whatever reactances reside in the motor. Typical values might be 3.3µH, 330pF and 100Ω.</p> <p>The downside of a partial (harmonic cut) filter is, its peak current is drawn through the switch every cycle, so still has some voltage overshoot, and the peak current draw increases losses (in addition to the charge in the capacitor, which is burnt in the resistor).</p> <p>A full filter would be reasonable for a higher switching frequency (100kHz say); typical values might be 1.8mH + (33nF || (100nF + 220R)). Cutoff below Fsw avoids wasting harmonic currents, but, obviously, it's much bulkier too.</p> <p><strong>Current Mode Control</strong></p> <p>This is recommended for many reasons: torque control, splitting the output filter poles (when LC filtered; most often for PSUs), electronic protection and potential reduction of cascade failures, etc.</p> <p>Granted, in a simple application like this, I probably wouldn't bother either. But I might consider some mitigation in lieu of it: using an overrated transistor (check!), adding series resistance (a nice big resistor and thermal cutout would probably do fine), even doing the whole damn thing linear isn't out of the question, assuming adequate heatsinking is available. (I have some power transistors on hand that can do this ably; that would look like: a regular phototransistor opto, from +V to G (and divider and G-S pull-down resistors, and zener clamp), for drive; generous source degeneration to set current range; and a PWMDAC and filter would furnish analog control from the MCU. The digital isolator/driver and 2nd power supply would be eliminated. The MCU too could be eliminated, if you're comfortable with analog PID controls and some logic as applicable, but doing it digitally is fine, too.)</p> <p><strong>Diode Recovery</strong></p> <p>This is not to be underestimated, especially for slow recovery types. For point of reference, even the SMPSs of the 70s, running hardly over 20kHz, used what fast rectifiers were available -- maybe 200-500ns in those days, but they were still better than the general-purpose types. As mentioned, the problem is significant: even if recovery current equals load current, if it lasts for a microsecond, that's a lot of power dissipation. Worse, it compounds: it has positive tempco. Even fast-recovery types can run away with modest heatsinking; worst-case heating must be accounted for.</p> <p>The long time constant before failure further supports a thermal mechanism. Particularly at medium duty cycles where average diode current is maximum. Were hot components noted? (Was it just buttoned up and expected to work? Maybe there was no chance to check...)</p> <p><strong>tl;dr</strong></p> <p>A fast recovery rectifier should do the trick. A schottky (SiC) could even be used, rather overkill, but they are nice.</p> <p>Check component temperatures, and add heatsinking as needed.</p> <p>Increase gate drive resistance, and add snubbing elements as needed.</p> <p>Check waveforms to make sure nothing squirrely is happening, the edge rates are as intended, and the motor isn't getting bounced around.</p> <p>A current sensor might be helpful to prove motor current and verify it's not doing anything you would miss with voltage probing alone. A simple way to construct a clip-on current transformer is to use a large enough split-core ferrite bead with ten or so turns of fine wire, terminated into 50 ohms. The frequency response won't be anything impressive, but it'll pick up the high-frequency blips and pings we're looking for here.</p>
<p>I have built a motor controller for my sewing machine that controls the motor speed rather than just controlling the power - in use, it is like the difference between using a soldering iron with temperature control instead using a soldering iron with a simple power control. Typical sewing machine foot pedals control only the power - mine controls the speed using a tachometer.</p> <p>I used the controller for several hours over several days. It did what it was intended to do, namely make it much easier to sew leather and nylon webbing.</p> <p>While I was doing some experiments to see if I needed to do anything to reduce RF interference (listening to an AM radio while running the machine under various loads,) the 16 ampere circuit breaker in the house tripped and the 2 ampere fuse in the controller exploded - literally. The fuse blew with such violence that there was nothing left of it but the metal end caps and some glass splinters.</p> <p>Parts D1, D2, and Q1 all failed. D2 was shorted. Q1 had a short from drain to source. D1 had a short from the AC input to the &quot;+&quot; terminal.</p> <p>I found that I had used a bridge rectifier (D1) rated for 400V instead of the intended 600V, so I replaced all the dead (shorted) parts (and replaced the rectifier with one rated for 800V) and tried again. It ran for a few minutes, then blew again - the fuse exploded and the breaker tripped this time as well.</p> <p>I originally had a UF4007 for D2, so I rebuilt everything and upgraded to a 1N5408 under the assumption that there was too much current for the UF4007. Again, the fuse exploded after just a few seconds and tripped the breaker.</p> <p>I put an NTC in series with the fuse, and replaced all the blown parts (D1, D2, Q1) and tried one last time. This time, the fuse blew but didn't explode. The circuit breaker tripped as well.</p> <p>At this point, I am out of ideas.</p> <p>Things I've considered:</p> <ol> <li>Capacitor C4 (400VDC, 47µF) is damaged. If it were damaged, it should show some sign - bulged, burned, melted plastic sleeve, etc. It shows no obvious damage, and it seems to do its job. I made one try without C4. The motor couldn't maintain its speed. With C4, it maintains its speed, but then the fuse blows. I only ran it for a couple of minutes without C4, so maybe I just didn't run it long enough for it to &quot;go off.&quot;</li> <li>Motor is damaged. The motor turns and runs, so it can't be shorted. If it had to do with the brushes or the commutator, I'd expect to see sparking when the fuse blows - but there is nothing.</li> <li>U3 (ADuM4120) is damaged. If the PWM signal were distorted, then Q1 (NTPF190N65S3H MOSFET) would turn on slowly and overheat, causing it to fail. Q1 fails shorted every time the fuse blows. If Q1 died first, then the motor would speed up. I know that Q1 can stand running the motor at full speed because I specifically tried that out while building the circuit - I made the motor run full speed by setting the PWM duty cycle to 100 percent to see that it would be OK.</li> <li>A short to protective earth somewhere in the motor or the controller housing. This is unlikely since it is always the 16 ampere circuit breaker for the outlet circuit that trips, not the household GFCI.</li> </ol> <p>Datasheets:</p> <ol> <li><a href="https://github.com/JosephEoff/Bigfoot/blob/main/Datasheets/MOSFET-NTPF190N65S3H_D-2319151.pdf" rel="nofollow noreferrer">Q1, NTPF190N65S3H MOSFET</a></li> <li><a href="https://github.com/JosephEoff/Bigfoot/blob/main/Datasheets/BridgeDIOD_S_A0006645055_1-2542889.pdf" rel="nofollow noreferrer">D1, KBP308 bridge rectifier</a></li> <li><a href="https://www.mouser.com/datasheet/2/149/1N5408-888344.pdf" rel="nofollow noreferrer">D2, 1N5408</a></li> <li><a href="https://www.vishay.com/docs/88755/uf4001.pdf" rel="nofollow noreferrer">D2 alternative, UF4007</a></li> <li>I don't have a datasheet for the motor. It is a common 100 watt sewing machine universal motor made for 230VAC.</li> </ol> <p>Circuit diagram:</p> <p><a href="https://i.stack.imgur.com/8eEKp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8eEKp.png" alt="enter image description here" /></a></p> <p>The circuit diagram doesn't include the NTC resistor - I've only added it to the PCB as a tacked on experiment.</p> <p>Layout:</p> <p><a href="https://i.stack.imgur.com/eRz0D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eRz0D.png" alt="enter image description here" /></a></p> <p>Q1 is bolted to the aluminum box with a mica isolator between Q1 and the bare aluminum. I am honestly not sure how much good it does since the tab of Q1 is plastic.</p> <p>The Arduino Nano is programmed as a PID controller. There's a foot pedal with a Hall effect sensor to provide the set point and an infrared photo-interrupter with a slotted disc to detect the rotation speed. Both are purchased modules that connect to the indicated headers on the PCB.</p> <p>The PWM signal runs at 20kHz so I don't hear a squeal from the motor.</p> <p>The circuit itself is on a PCB in a grounded aluminum box. I've also added a ground wire to the motor since the cheap things aren't grounded.</p> <hr /> <p><em>Edit: 2023.01.02</em></p> <p>I've accepted <a href="https://electronics.stackexchange.com/a/695950/47070">Dave Tweed's answer.</a> It gives some suggestions that I can follow up on to eliminate some possible sources of problems.</p> <p><a href="https://electronics.stackexchange.com/a/695946/47070">Spehro Pefhany's answer</a> suggests a short through the coils caused by the insulation in the motor windings not being up to the high voltage pulses. I have no way to check that, except for correcting the things that Dave Tweed suggested then seeing if the fuse still goes bang.</p> <p>Planned changes:</p> <ol> <li>RC snubber across the motor connections on the controller board.</li> <li>Replace D2 with a UF5408. I originally had a UF4007 there, then replaced it with the 1N5408 because of the higher current capability.</li> <li>Lower the PWM frequency to 5kHz.</li> <li>Limit the PWM duty cycle to 70 percent since the DC voltage is higher than the AC RMS voltage (suggested by Transistor in the chat.)</li> <li>Lower the gate resistor to 20 ohms.</li> <li>New PCB layout to address the creepage distance issues.</li> </ol> <p>If none of that helps, then the problem may be with the motor. That would mean I have to scrap the project since the point of it was to make a better controller for the typical motors used on vintage sewing machines.</p>
What is wrong with this DC power supply and motor control?
2023-12-31T14:06:00.850
695940
|frequency|ultrasound|piezo|piezoelectricity|piezoelectric-effect|
<p>The web site you cited gives this description of how to operate a piezoelectric device:</p> <p><code>In general, PZTs are usually operated well below their resonant frequency (fo), particularly when used as a precision positioner. The reason for this is to keep the phase difference between the applied voltage and the PZT's displacement as low as possible. A piezo system is typically run anywhere between DC and &gt;10 kHz.</code></p> <p>This and additional information on how to operate these devices is on this part of their web site:</p> <p><a href="https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=5030" rel="nofollow noreferrer">https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=5030</a></p> <p>The manufacturer did not provide any details on the resonant frequency for the particular device you asked about. However, they do provide the below plot for a different piezoelectric device with flat end plates:</p> <p><a href="https://i.stack.imgur.com/9kISO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9kISO.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/n6CJv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n6CJv.png" alt="enter image description here" /></a></p> <p>This does show that for this particular device the resonant frequency falls off roughly exponentially as the applied load increases.</p> <p>Unfortunately, I could find no similar plot for your device. In view of the advice quoted above, you should operate your device well below the resonant frequency, allowing for it to be lower as the load gets higher.</p>
<p>I am working with a sensor which has piezos in it. I want to know what piezo resonating frequency really means. The piezo I'm using has a resonating frequency of 570kHz as mentioned on the website.</p> <p>What does 570khz really mean? Does it work only on 5tokHz or is 570khz the threshold limit of the piezo sensor? What should be the operating voltage of piezo? They haven't mentioned anything related to it.</p> <p>Manufacturer number of the piezo sensor: PKCEP4 2.0 mm x 2.0 mm x 0.4 mm flat end plate</p> <p><a href="https://www.thorlabs.com/thorproduct.cfm?partnumber=PKCEP4" rel="nofollow noreferrer">Product</a></p> <p><a href="https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=8040&amp;pn=PKCEP4" rel="nofollow noreferrer">This datasheet link</a> is on the above page</p> <p><a href="https://i.stack.imgur.com/yNhPj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yNhPj.png" alt="Piezo Sensor" /></a></p>
Do piezoelectric or piezoceramic sensors have a fixed resonating frequency?
2023-12-31T15:07:54.357
695948
|diodes|oscilloscope|voltage-clipping|
<blockquote> <p>The problem is that shouldn't the maximum voltage be 0.7V when the ac coupling is using since it will remove DC component in the circuit which is the DC source in this case?</p> </blockquote> <p>The AC coupling setting removes the DC component of the <em>signal</em>, not the DC component of the <em>circuit</em>.</p> <p>Basically, AC coupling shows you exactly the same thing that DC coupling would show you, except moved up or down so that the average value of the signal is at 0.</p> <p>If you were using DC coupling, you'd see a signal with a minimum value of -5 V and a maximum value of 2.5 V (so the difference between the minimum and the maximum would be 7.5 V). Since you're using AC coupling, you see exactly the same thing, except that it's moved up a bit. In particular, the difference between the minimum and the maximum on the signal you see is still 7.5 V, exactly as we would expect.</p>
<p>Circuit diagram (Vs is 10 Vpp sin wave at 1 kHz, and the oscilloscope was measuring Vo): <a href="https://i.stack.imgur.com/RZFD5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RZFD5.png" alt="circuit diagram" /></a></p> <p>constructed circuit: <a href="https://i.stack.imgur.com/2eZgC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2eZgC.jpg" alt="constructed circuit" /></a></p> <p>Here is the readings I got (noted that it was using AC coupling by accident): <a href="https://i.stack.imgur.com/DsJzu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DsJzu.jpg" alt="oscilloscope graph" /></a></p> <p>The problem is that shouldn't the maximum voltage be 0.7 V when the AC coupling is using since it will remove DC component in the circuit which is the DC source in this case? Even if the AC coupling doesn't affect the readings, why does the maximum voltage isn't 2.5 V as 0.7 V + 1.8 V = 2.5 V?</p> <p>The only possible reason I can think of is that the wire connections were incorrect, but I tried multiple combinations with simulation still cannot replicate the graph I got from the oscilloscope.</p>
Oscilloscope showed weird readings of a clipping circuit
2023-12-31T17:47:23.423