texts: I want to use a USB connection with the ATmega32u4, but there are 6 pins in the datasheet (http://www.atmel.com/Images/doc7766.pdf) associated with the USB. I don't know which ones connect to the generic USB connections. Can someone show me how they are setup?


texts:
I have been using Arduino IDE for sometime with my Arduino Uno. Recently I heard about Eclipse and I thought give it a shot. I downloaded the c++ version and installed the AVR plugin. Then I tried to configure it following instructions from here: http://www.arduino.cc/playground/Code/Eclipse

When compiled the library, there was some error about 'arduino.h' not found. When I copied that file to the core library, there were more errors now.

Then I downloaded the Eclipse blink example from https://github.com/allgood38/Arduino-Blink-Eclipse-Project. It comes with its own arduino core library and compiled without any troubles. Then I uploaded it to Arduino Uno within the Eclipse itself. Everything went fine except the led on the Uno is not blinking. It just stays ON.

I have tried uploading the compiled HEX file with other program but still the result is same. Please help me to figure out what's wrong here..

If there is anybody out there who have successfully integerated arduino 1.0 with the latest version of Eclipse in windows 7, please post the URL that you have referred.

EDIT: Finally compiled a blinky project without errors. But there is still error on the CoreLibrary project. Here is the screen shot:


texts:
We all know that when the transistor is in its linear or active region, collector current does not increase further. At this point, the base collector junction is reverse bias. But how come there is still a collectr current flowing given the fact that the B-C junction is reversed biased.

Isnt it when a diode is in reverse bias, it blocks current, but how come in this setup above, there is still collector current?? Also why does the current doesn't increase any further?


texts: Pull Up Resistor to Substitute SPDT Function

texts:
I'm creating a circuit to switch and control between two different analog signals, and I'm doing so with JFETs and a CD4013. If I'm using a guitar pedal stomp switch to pull up or down the data line, can I use a pull-up resistor in this configuration to mimic an SPDT switch?

simulate this circuit – Schematic created using CircuitLab


texts: What does a comparator consume compared to an ADC

texts:
Is there a way to calculate the power consumption of a comparator for one single measurement? I would like to compare the power consumption of a comparator with the power consumption of an ADC. I expect the comparator to be able to measure faster and consume less by doing so.
However, I looked into multiple datasheets and could not find any data about power consumption. Why is that? How can I calculate it?

// EDIT:
In order to prevent myself of asking an A-B question here, I want to state my intent with this question: I want to show, that comparators are faster and less power consuming than ADCs while beeing cheaper overall. This is not about special chips but more a general thing I want to know. Therefore I just googled for datasheets instead of looking for specific ones because I am new to this area.

Comparator Datasheets I found or were linked in the comments are:

http://www.ti.com/lit/ds/symlink/tlv3501.pdf
https://www.st.com/resource/en/datasheet/ts881.pdf


texts: NFC 13.56MHz RF - Use inductor in place of pcb trace made antenna

texts:
I need to make a NFC antenna on NFC tranceiver->LC filter->matching circuit->antenna.

Inductance shows to be 1.5uH on an online calculator of nfc antennas. Can I simply just place a good inductor of 1.5uH instead drawing all the antenna? Will work from same distance?


texts: Why is the hit rate so bad until the cache has a certain size?

texts:
For a certain cache, these are the measurements:

Test of different sizes of cache memory, from 16 to 1024 words, Block size = 2 words and assosiativity = 1. Access time: 20 cycles.

Size     16 words 32 words 64 words 128 words 256 words 512 words 1024 words

Hit rate   1%       1%         1%      1%        1%       17%      50%

Cycle count 44841 44521   43881   42601       40041      34841   19481

Why does hit rate look like it does? Why is the rate so bad until the size reaches a certain size?


texts:
I plan to use a microcontroller on my project. But I don't know which one should I use. I know the features the microcontroller will need to have but many manufacturers can fit my need.

Should I choose TI, Microchip, Arm? What is the difference except operating voltage level?


texts: Capacitors, ground between connection, Colpitts oscillator

texts:
For the Colpitts oscillator circuit shown (from a YouTube video), the video author said that the capacitors C1 and C2 are in series, which makes sense since there is a common connection point for C1 and C2 at the bottom, while the inductor is between the other ends of the capacitors.

What is puzzling me is the ground between the capacitors’ common connection point.  Since current will flow into or out of the ground, how does the ground’s presence affect the “series capacitor” notion, for lack of a better way of saying it?


texts: Voltage across Zener diode is higher than the Zener voltage

texts:
I have this circuit:

Assuming that the knee current is 0.2 mA and that the Zener voltage at current 5 mA is 7V. I would like to find the voltage across the load. I am however confused with the question since I assumed that the voltage across a Zener diode cannot go above it's Zener voltage, i.e. 7V, even if the answer of this question is 7.12 V. How come?


texts: LMR62421 Boost converter output voltage drops periodically

texts:
I have tried to build a boost converter using a LMR62421 from Texas Instruments to get 21V at the output from a 3.3V input. To do so I used its datasheet (link above) but also I used the Texas Instruments website through WEBENCH that allows to get a recommended schematic of what the user is trying to achieve (here 3.3V to 21V boost converter).
Anyway, the 21V is used to supply a display backlight (110mA @ 21V TYP.).
Here below the schematic I have done:

simulate this circuit – Schematic created using CircuitLab
So when the backlight is disconnected from the boost converter, I have 21V (more or less) at the output. But when I connect the load, the voltage drops periodically to 15V with a 28Hz frequency. Thus, my backlight flickers and it's disco time. To be more specific, the pictures below show some measurements with an oscilloscope when the backlight is connected:

frequency = 28Hz approx.

Vout max = 20.2V approx.

Vout min = 15.3V approx.

The whole boost converter is on a PCB. The backlight is composed of two LEDs network. I tried to disconnect one of them but the result is the same. I also have a MOSFET after the output but I have bypassed it (with or without : same effect).
What I can't figure out is this 30Hz value. Do you have an idea where it may comes from?
Thank you for your help !
EDIT regarding first comments :
Right now the power supply comes from the laboratory. It can supply 3.3V and it is quite stable.
For the layout guidelines, the datasheet gives recommendation for the WSON package (SEPIC configuration). I am using the SOT-23 one. But here below is my layout :

Boost PCB layout
The inductance is a SRN6045-220M from Bourns. For this part number, the saturation current is given at 1.9A.
Concerning the input capacitance. I will try to put a bigger one and keep you informed.
The chip can shutdown by itself if its junction temperature exceeds 160°C but here it is not reached. Moreover, it has a 10°C hysteresis before turning on after a shutdown. I doubt a thermal issue, the frequency is too constant in my opinion (but I may be wrong). I will measure the load current though.
Current load measurement
I measured the current through the load. To do so I used a 50 mOhm resistor between LED cathode and ground. Here are three oscilloscope pictures. In blue is the output voltage of the boost converter. In yellow the voltage across the 50 mOhm resistor  :

In this first screenshot we can see the same evolution of the output voltage as before (blue). In yellow the voltage across the 50 mOhm. Obviously, when the output voltage is below a certain threshold (LED network) the current is equal to 0 A. When the output voltage is high enough, the current seems to be provided (at 25ms/div, we can't see much more).

Let's take a look closer to the current channel :

When we go for 250ns/div we can see above how the current behaves (this is when the output voltage is high enough to supply the LED network, otherwise it is equal to 0 A). There is a 1.6 MHz frequency which corresponds to the switch frequency of the LMR62421.

The picture above is for a time division equal to 25ns/div. The highest voltage peak measured here is equal to 280 mV, so the peak current is equal to 5.6 A (!). Thus I am wondering : is it normal ?
I have changed my input capacitance from 4.7uF to 22uF. The frequency of the voltage drop has changed from 30Hz to 10Hz (give or take).
The input voltage is not really stable. It highly looks like a square waveform with a ppk of 200mV (Vmax = 3.3V, Vmin = 3.1V). Yet, the power supply is usually stable (tested with an other load) but when it is connected to the boost converter, this kind-of square waveform appears at the input.
One more thing I forgot to tell about : the 3.3V also supplies a microcontroller.


texts: Are there any effects on capacitance and inductance when operating at audio-frequency (i.e. 1kHz - 20kHz)?

texts:
At the moment, I study something about audio-frequency track circuits for railway applications and to understand its operation, an accurate model of such a circuit is required.

The circuit of audio-frequency track circuits uses the actual railway track as a conductor to let the current flow through. Also, since the normal length of track circuits can be in a range of 400 m to 2 km, these tracks may be treated as transmission lines.

Normally, transmission lines can be modeled as lumped or distributed parameters, which contain series impedance (i.e. resistance and inductance) and shunt admittance (i.e. conductance and capacitance).

I would like to know whether this range of frequency (i.e. 1kHz - 20kHz) will have any effects on these parameters? As I know it will definitely affect the resistance due to the "skin effect", but I do not know about the others.


texts: Calculation of a current in the Laplace domain

texts:
In the circuit below (working in the Laplace domain), I have to calculate \$I\$.

$$\begin{align}
&I=\frac{-V_L-V_C}{sL+\frac{1}{SC}}=\frac{-V_L - \frac{V_0}{s} - I \frac{1}{sC} }{sL+\frac{1}{SC}}\implies\\
&\implies\ I\Big(1+\frac{\frac{1}{sC}}{sL+\frac{1}{sC}}\Big)= \frac{-V_L-\frac{V_0}{s}}{sL+\frac{1}{sC}}\implies\\
&\implies I=\frac{sL+\frac{1}{sC}}{sL+\frac{2}{sC}} \frac{-V_L-\frac{V_0}{s}}{sL+\frac{1}{sC}}=\frac{-V_L-\frac{V_0}{s}}{sL+\frac{2}{sC}}
\end{align}$$

By seeing the solution on my book, it gives $$I=\frac{\frac{V_0}{s}}{sL+\frac{1}{sC}}$$ Why is that? Where am I wrong?

simulate this circuit – Schematic created using CircuitLab


texts: Circuit design with multiple voltage levels

texts:
I'm working on an art piece based around an Arduino Mega that essentially requires power for three types of devices:

Solenoids (4): 24 V, ~100 mA a piece (400 mA, 9.6 W total)
NeoPixel LEDs (1280): 5 V, ~60 mA a piece (77 A, 384 W total)
Base stepper motor (1): 5 V, not really an issue because it can be powered with an H-bridge driver from the output of the Arduino

Since the LEDs are the primary current consumer here, we're thinking we'll use this 600 W, 5 V DC power supply (SE-600-5): http://www.meanwellusa.com/webapp/product/search.aspx?prod=SE-600

This power supply has three pairs of output terminals, and is rated for enough current to power the LEDs.

The concern here is how to step up that voltage from 5 V to 24 V to power the solenoids (with enough current). We are considering voltage regulators, boost converters, as well as a high voltage amplifier like the PB64 from Apex Technology (shown in Figure 4 here: https://www.digikey.com/en/articles/techzone/2018/apr/how-to-combine-high-and-low-voltages-in-a-single-design)

Does anyone have any experience with issues like this? How would you recommend managing two voltage levels?

Thanks so much!


texts: LtSpice computation limitation: Which conditions do affect it?

texts:
I am trying to simulate a transistor level circuit in LtSpice. There are more than 200 transistors in the design and a few opamps. Mostly logic structures.

The problem is that LtSpice can not solve the equations after some time(Like 100 us). CPU usage hits to 100%. But here is the strange thing, if I put (a bit large) capacitors to each output of each structure, LtSpice can solve the circuit full time(still very slowly with 100% CPU usage but it comes to the end at least). So here is the thing: I can not put large capacitors on each output. Due to some efficiency consideration, I can't!

So, can you help me with this? I don't have a super computer and I need to do this simulation. Are there any solutions for LtSpice being in a deadlock. Thanks.


texts: Offset voltage comes to saturation in coupling amplifier circuit using OpAmp with Gain=100

texts:
I did get in troubles with my student project circuit below!

The purpose is to amplify difference between two inputs. Specifically, 20mV and 10mV are connected with input to get 1V at the last OpAmp's output.

The problem is when two input are grounded,the output offset voltage of OA1 and OA2 comes to saturation in reality. I attempted to find out what problem is but it doesn't make sense.

As I figured, I used a potentiometer to adjust the offset voltage because I thought the offset voltage is just 20-30 mV, but in fact, it wasn't.

What's the cause of this problem?

Here is my circuit on proteus.

that is exactly what you asked me to do..right?

EDIT

Let me explain how I calculated the component values in the circuit.
First, with \$U_1\$ we have that
$$
\begin{split}
V_- &=\frac{(V_1-V_{01})R_2}{R_1+R_2}+V_{01}\\
V_+ &=\frac{(V_{02}-V_{01})(R_3+R_4)}{R_3+R_4+R_5}+V_{01}\\
\\
\implies & \frac{(V_1-V_{01}) R_2}{R_1+R_2}=\frac{(V_{02}-V_{01}).(R_3+R_4)}{R_3+R_4+R_5}\quad (\text{because }V_+=V_-)
\end{split}
$$
$$
\implies
V_{01}\left[\frac{R_2}{R_1+R_2} - \frac{R_3+R_4}{R_3+R_4+R_5}\right]=V_1\frac{R_2}{R_1+R_2}-V_{02}\frac{R_3+R_4}{R_3+R_4+R_5}\label{1}\tag{1}
$$
As for U1, the same holds for U2: we have
$$
\begin{split}
V_- &=\frac{(V_2-V_{02})R_7}{R_7+R_6}+V_{01}\\
V_+ &=\frac{(V_{01}-V_{02})(R_4+R_5)}{R_3+R_4+R_5}+V_{02}\\
\end{split}
$$
And again, since \$V_+\$ is also equal to \$V_-\$,
$$
V_{02}\left[\frac{R_7}{R_7+R_6} - \frac{R_4+R_5}{R_3+R_4+R_5}\right]=V_2\frac{R_2}{R_1+R_2}-V_{01}\frac{R_4+R_5}{R_3+R_4+R_5}\label{2}\tag{2}
$$
Assuming that \$R_3=R_5, R_1=R_6, R_2=R_7\$, from \eqref{1} and \eqref{2} we have
$$
V_{02}-V_{01}=\frac{R_2(2R_3+R_4)}{R_4(R_2+2R_1)+2R_3R_1}(V_1-V_2)\label{g}\tag{G}
$$
(I tested this equation on Proteus and it seems to be right) So now... how can I chose resistor’s value suitably to make this circuit work well?


texts: How does the circuit close when I touch a live wire with grounded feet (touching the floor)?

texts:
When I touch the live wire from a power socket with my bare foot on the floor, how does the circuit close (how does the current return to the supply)?

First of all, how do tiles in the house floor conduct? Then why are any other insulating materials not usually used for flooring?


texts: Would it be possible to replace/wire the buttons on a keypad with buttons from this old phone?

texts:
Sorry I know the title's a little rough, but hopefully some pictures will help

I have this keypad

Here it is the front panel removed (note that each metal node is a button in itself, you can press them, and I think this is what will make this not possible or very difficult)

Here is the back of the keypad:

Now I want to try to replace the buttons on this keypad, with this old phone numberpad:

Here is the front off:

Here is the back:

So basically 2 concerns:
1) The phone keypad has 13 buttons, but only 8 wires, so no idea how to deal with that
2) The security keypad has buttons embedded into it

So what do you guys think?  Is this project possible with what I have?  What are some of the things I need to know, or need to try?

Thanks!


texts: A few questions regarding B/E-fields in practical circuitry

texts:
I have been trying a few learning resources to help unlearn some of the notions that electrons flow through as energy.

Chiefly this resource is what I have used:
Amasci - IN A SIMPLE CIRCUIT, WHERE DOES THE ENERGY FLOW?

My questions are:

Does energy transfer from the battery through the load through B-fields, i.e. "electromagnetic current" and not really through any other means? Is "Electricity" simply heavily concentrated electromagnetic fields when flowing through a conductor? For example, an arc between two high voltage electrodes is the electromagnetic energy jumping the gap, the heat and light of the arc are just by-products of this?

The resource shows an E-field existing between the circuit path:
efields

What if the path were something like a wire surrounded by a magnetic insulator, would the e-field be pointless, or not "care" that anything is blocking it just existing on either side to create a difference in potential?

Would there be less energy available? I am greatly interested in how energy is transferred through the wire, at least correctly.

(addition)

Does the insulation of wiring (i.e. plastic) also help in reflecting some of the energy so that it does not drop over a distance? This could sense, being that an exposed wire may pick up energy in the air, and an insulated keep it out.


texts: How to detect change (1 or 0) on PORTC of Atmega8?

texts:
I have made PORTC.0,PORTC.1,PORTC.2,PORTC.3 as input and set it at high. The remaining pins are set as output and high. Thus all pins of PORTC are high.

Now what I want to check that whenever any pin of PORTC gets low (0), then my function  "setDirection()"should be called. For that I have written

if(~PINC)setDirection();

but ~PINC condition comes out to be always true, irrespective of any pin of PORTC is low or not.
Then I tried this code

if(!PINC)setDirection();

this condition never turns out to be true, either PORTC PIN is high or low.


texts: Parallax LRF image viewer connection timed out

texts:
I am using USB to R232 Serial interface to communicate with the parallax LRF through LRF IMage Viewer software. I have installed the drivers for RS232 and have also performed the loop back test. But when i connect it to the LRF module and hit connect in the Image Viewer software, I get the error shown in the below image.

I am using Win10 OS. The LRF has a firmware v2.0


texts: Measuring Current with a Shunt Resistor and an In-Amp

texts:
I'm building a device to acquire current data through an appliance. The schematic can be seen below:

The problem is that I need this measurement to be step up tenfold, but I added a 2.5V reference just to make sure that the measurement stays within the 0V-5V range.

If I just use a gain op-amp, then the offset is also going to be step up tenfold, and the new offset would be 25V right?

How can I fix this?

in response to comment by @Neil_UK
Do you mean something like this?


texts: How to size a battery for a starter motor?

texts:
I am trying to size a battery for a starter motor for a 120cc 2-stroke engine. The starter is listed as 12V/250W (so 20A draw). The engine manufacturer offers a 3000mAh NIMH battery (so like ~30A max short-term current draw) with a 40A fuse.

How is it possible for that battery to start the motor? I thought that motors drew ~3x their rated power at start up?

Thanks!


texts:
I have a solar panel charging a lipo battery, that is the default/normal state.
When battery is charged, I want to cut the solar panel from the battery. Using my Arduino, I can send a high signal, and that should disconnect the panel.
What can I use for the switch? Will a transistor work? The way I understand transistors, they work in reverse, if input is 1, then output/load is active. But I do not want to waste power keeping the switch closed most of the time.
So I came up with this idea, is there any problem with this one:


texts:
As per our design requirement we need to drive PA (public addressing )  speakers whose power rating is only 6W but impedance is 1.3k/3.3k.

So what should be the amplifier rating ?

I want use an audio power amplifier rated for 6W but most of the datasheets for such ICs show this wattage with only 4 Ohm or 8 Ohm speakers.

No datasheet mentions high impedance speakers.

PA speakers are generally mentioned in connection with 100V systems.

Will an amplifier rated for 6W at 8 Ohm or 4 Ohm drive a high impedance speaker?

Length of cable might be 20meters .

Can i use a 70 v, 10w  line matching transformer and connect secondary to audio ampifier and primery to pa speakers (in reverse direction ) whose impendence is high. In line matching transformer seconary is named as 4ohm and 8ohm  .So if i choose a power audio amplifier for 4 ohm or 8 ohm and connect it to secondary then at primary itself will come at 70v rms and then it may drive our PA speakers whose impendence is high and made for 100v line ?

plz make me correct if i,m missing somthing.


texts: How to detect RS232 and USB connectivity?

texts:
My project involves a PIC communicating over USB and RS-232 channels, which are then multiplexed to 1 UART by means of a dual SPDT analog switch. As such, the PIC has to know which ports are physically connected, in order to select either the USB port or the RS232 port.

How would I go about doing this? For RS-232, I could set an externan interrupt for the DTR line, but in my industry field, only Tx, Rx and Gnd are used.

For USB, I could potentially use Vbus to detect the presence, but overcurrent is possible

Or would it be more feasible to monitor the impedance of the usb differential lines and the rs232 tx rx lines, like in the audio jack sensing circuits?


texts:
is there a reason for stm32F103C8xx to be big endian and is it possible to change to little endian?

I have a 16bit oriented addressing scheme that I need to send over wire and other side expects MSB first. Any other sugguestion?

To answer how I am doing it, here is the method (which doesn't answer the question of course).

typedef union ___address{
    uint16_t address;
    uint8_t addr_byte[2] ;

} my_addr;

Just use it as two times 8 bit in reverse order, my_addr.addr_byte[1] then my_addr.addr_byte[0].


texts: Can Altium Designer 17 Generate Missing Paste Mask Layers?

texts:
I recently ordered three proto PCBs from a small PCB company. This board house produces Gerber files in-house from their proprietary PCB layout files, and provides this Gerber set to the user on delivery of the PCBs... or so I thought. In the Gerber file set I received the paste mask layers (.GTP and .GBP) are missing from the set. I now suspect that they do that on purpose as they also sell paste stencils. But that is another matter.

Since I have access to Altium Designer 17 down the hall, I decided to rename the gerber file extensions to those used by Altium, and import these 8 files into CAMTASTIC. The import went fine with no problems, and viewing them looks as if these layers are just fine. Now my question...

Can CAMTASTIC generate the missing paste masks (.GTP and .GBP) from the information contained in just these imported files? It seems like there may be enough information to do this, however I'm not that familiar with CAMTASTIC to figure out how to do this. (I'm borrowing evening time on this Altium machine.) The file sets are listed in the attachment.


texts:
Honestly, this is a homework question.

Below you could see the description of the question

Here you have the relevant answer.

My argument

Here we can neglect answer number 1 and 4

Reason :

According to the given diagram we can say current travels form X to Y , which ultimately leads to have  a lesser potential at X than that of Y, because at X you can find more electrons( I am not quite sure about the direction of current , so I hope you would help me)

(potential at X=  Vx ), (potential at Y = Vy  )

$$V_X < V_Y$$

Therefore I can say potential at X must be negative relative to that of Y.

But after that I am stuck on finding relavent magnitudes. My argument may be wrong , I don't know exactly.

I am happy to hear your argument towards this question which  might be different.And I want to say,if you can explain this fully from A-Z that would be great. If you can't that okay.

So  what is your answer for this ?


texts: Effects of Filter Topology on transfer function

texts: Does the transfer function of a filter change if I change its topology keeping the cutoff frequency and the order same?


texts: Finding right potentiometer to control the speed of a 240v DC, .5amp, permanent magnet motor

texts:
I have a faceting machine with a 240v, .5amp, 3000 rpm, permanent magnet motor which is repeatedly burning out the JH-50KA potentiometer which controls it speed.

I am not sure this is the correct (original) pot as I purchased the machine secondhand, can anyone suggest how I might resolve this, I have very limited electronics knowledge and live in a rural area with few people with electronics knowledge about.


texts:
I can not find a solution for why STM32F427ZIT6 clock changes during operation. I am using external 8 Mhz crystal.

Should I rather look for a error in software or hardware?

I have a little code, which just toggles LEDs on the board with GPIO.
Sometimes they are toggled with correct speed, as defined in software. I have seen 3 different speeds, 2 of them are in the video below and the third speed is between them. It is really messed up.
And it will happen at random times. Sometimes it's fast when turned on, sometimes slow..

Parameters at the moment for sysclock:

#define HSE_VALUE    ((uint32_t)8000000)
#define PLL_M      8
#define PLL_N      360
#define PLL_P     2

I also tried to put PLL_P to 4, in order to reduce the clock. Still the same.

EDIT: I measured CAN with logical analyzer and at first it sends data with 1 Mbits as needed, but then drops to 113 kbits when LEDs start to flash slower. CAN is driven by APB1 clock.

EDIT2: I think I may have found the cause of the problem - the crystal. I did not do any changes in code. I desoldered the 8 Mhz crystal and measured CAN and SPI with logic analyzer using internal clock. All the measurings seemed to be OK for many tests so I soldered a new 8 Mhz crystal on the board. So far so good. Have not seen any strange behaviour since.

Full code:

pastebin.com/6jwYFVPB - main.c

/* Includes */
#include "stm32f4xx.h"
#include "gpio.h"
#include "uart.h"
#include "can.h"

UART debug;

/* Private macro */
/* Private variables */
/* Private function prototypes */
/* Private functions */

/**
**===========================================================================
**
**  Abstract: main program
**
**===========================================================================
*/
int main(void)
{
    gpio_initialize();
    //UART_init(&debug,  USART1_PA9_PA10, 9600, 64, 2048);      //UART variable is defined in debug.h to make it global.
    //uart_putline(&debug, "BMS has started.");
    CAN_init(CAN_PINS_GPIOA);
  int i = 0;
  //char msg2[512];
  /**
  *  IMPORTANT NOTE!
  *  The symbol VECT_TAB_SRAM needs to be defined when building the project
  *  if code has been located to RAM and interrupts are used.
  *  Otherwise the interrupt table located in flash will be used.
  *  See also the <system_*.c> file and how the SystemInit() function updates
  *  SCB->VTOR register.
  *  E.g.  SCB->VTOR = 0x20000000;
  */

  /* TODO - Add your application code here */

  /* Infinite loop */

  //uart_putline(&debug, "Entering loop:");
    CAN_message msg;
    msg.id = 0x303;
    msg.data_or_request = CAN_RTR_DATA_FRAME;
    msg.standard_or_extended = CAN_IDE_STANDARD;
    msg.length = 8;
    msg.data[0] = 0x00;
    msg.data[1] = 0x01;
    msg.data[2] = 0x02;
    msg.data[3] = 0x03;
    msg.data[4] = 0x04;
    msg.data[5] = 0x05;
    msg.data[6] = 0x06;
    msg.data[7] = 0x07;

  while (1)
  {
//    if (uart_inbox_count(&debug) > 0) {
//          uart_getstr(&debug, msg2);
//          //echo that message back
//          uart_putline(&debug, msg2);
//    }

      for (i=0;i<500000;i++);
        //gpio_toggle_output(GPIO_MCU_OK);
      CAN_transmit(msg);
      gpio_toggle_output(GPIO_BMS_ERR_LED);
      gpio_toggle_output(GPIO_CUR_OK);
      gpio_toggle_output(GPIO_UART_OK);
  }
}

pastebin.com/sf1FM9T7 - gpio.h

pastebin.com/rqiBTQ4c - gpio.c

pastebin.com/xE6zcPEg - can.h

pastebin.com/DSTHMRcz - can.c

Video of behaviour


texts: Amplifing guitar signal in order to connect it to ADC

texts:
I would like to connect an electric guitar to ADC (or MCU internal ADC input) in order to process signal digitally. I'm not sure right now which MCU or ADC I'm going to use, nevertheless I believe that connecting a guitar to such input without amplification isn't going to work well.

What is 'typical' voltage range on such input in MCU? I guess that my signal should oscillate between GND and Vcc, being centered at 0.5*Vcc (to achieve maximum resolution).

I found one circuit that looks promising (the one with 'line input'):

Please, let me know if I understand how it works correctly. There's an op amp in non-inverting configuration with gain equal to 10K/1K + 1. With the 47pF capactitor it's also a high pass filter. 100k resistors between GND and 5V provide 2,5V DC offset. I'm not sure about the role of both 10uF conds. What is their role if the circuit makes sense?

Is this circuit what I need in order to connect my guitar to MCU/ADC? What are other options?


texts: connecting avr microcontroller to the internet

texts:
I'd like to connect my AVR microcontroller to the Internet.

I tried the enc28j60 ethernet controller, but I faced some problems with it. Besides I've read a lot about it and found it easy to be used within a LAN, it has some problems when connected with the internet, also: it requires large flash-ROM for the TCP/IP and UDP stack and it even takes long time in execution.

So, I need to know:

What other methods are there to make the AVR connected to the internet? Or,
If someone has a good knowledge about the enc28j60 usage can he give me some help?


texts: ESP32-Cam GPIO remote control and video feed

texts:
Is it possible to control the ESP32-Cam GPIO from the web? Just like a "normal" ESP32 can create a website with buttons that turn on and off certain GPIOs
Was wondering because I can't find anything on the internet it only shows the normal ESP32
Note: I have ESP32M compatible with CAMERA_MODEL_AI_THINKER, and wanted to transmite video feed from the esp to a website and on the same website having buttons that control the GPIO pins for that esp32-cam


texts: Why should one add 180° to the arctan() result of a complex number?

texts:
I am now studying phasors and my teacher told us that when you find in an exercise, for example the current and that current is for example \$ -2 + 3j \$ , then, when you want to find the angle, which is \$ \theta = arctan(-1.5) \$, you have to add to the result angle 180 degrees to find the final angle.

My question is, how do I know when to add and when not to add 180 degrees to the angle?


texts: Question about Load voltage when triac is switch off

texts:
I've bought an off-the-shelf optotraic/triac board for a little one-off project. It needs to drive a 0.42W syncronous motor from mains, once a minute for a few hundred milliseconds.
I have traced out the schematic and it's as follows:

I'm in the UK, so mains is 230V. I have mains connected to one side of the motor and the other side is connected to the LOAD terminal on the circuit above. (As per the instructions with the triac board.)
When I switch the GPIO low it turns the motor on which drives what it needs to perfectly well.
However, once the opto triac is turned off, I sometimes, but not always, get the motor gently humming away. I always have about 7Vac across the motor when the triac is turned off.
The board was very odd on the input side and I've modded it to make it work and so the input is galvanically isolated form the HV side, so it's possible there something equally as odd with the HV side. It does look slightly different to other example circuits I've seen both here and on Google searches/opto traic datasheets.
So, I have the following questions:

Should I be getting 0V across the motor when the opto triac is off?
If yes, would a gate resistor be a good idea and if so, should I connect that to neutral?
Is it likely that the 7V on the motor is causing that hum? If not, is it possible to say what might be causing it?


texts: How do I choose an appropriately sized stepper motor?

texts:
My latest hare-brained project involves a stepper motor.  But how do I know which stepper to choose?

I'm adding a stepper to the lead screw of my lathe.  It will be used for feeds and threads.  For feeds, the behavior of the stepper isn't critical; it just needs to move at a constant speed.  For threads, however, missed steps are terrible; when making successive passes, the tool bit won't line up to the previously cut groove as well as it should.  This is an open-loop system so once it goes wrong it stays wrong.

Some attributes...

The carriage (the part being moved) is about 10 lbs. It rides on well-lubricated 'ways' but mass is mass.
I don't care too much about the speed of the carriage.  When threading, the spindle turns slowly, maybe 1 rev per second, and in many cases even slower.  Basically, there isn't a case where the carriage needs to move fast.  In the most extreme case, a 4 TPI thread, the carriage would travel 1" in 8 seconds.  That's .8 RPS for the stepper for my configuration.  Feeds would be much slower.
As stated before, the carriage must not get bogged down and lose a step even as the tool bit suddenly transitions from air to steel. Torque, baby, torque.
When threading, a few thousandths of material is removed per pass.

Advice on how to size a stepper would be appreciated.

EDIT -

I just performed a calculation I found on the Gecko site.  According to them, I need a stepper about the size of a thimble.  It feels like adding a stepper to a lathe lead screw is a corner case since the movement in inches per second is very low.  If I recall, this means the motor would be very torquey but would get hot; current and movement are inversely proportional.  So I may need to run the stepper faster and gear it down.


texts: 'Bug fixing' a circuit with HiLink HLK PM01 220V->5V converters

texts:
I soldered a DMX splitter together. However, it does not work.
I'm sure one of the solder connections broke, but I have to find which one. I want to do this with power connected because that is easier to pinpoint the problem (since it is soldered and a bit hard to reach the bottom side where the wires are).
So my plan is to use a multimeter and check the voltage difference between various points. However, I'm afraid I might touch the pins in such a way that a short circuit can exist.
I'm using 5 of these datasheet-HLK-PM01 power modules. One for the DMX input and 4 for the outputs. What would happen if I cause a short circuit?
The datasheet mentions

Output over-current protection: 150-200% of the output maximum load
Output short circuit protection: Direct short circuit at the normal output, automatically resume normal operation after a short circuit removal

Does this mean it will not matter if I (for a short time) cause a short circuit?
Or is there a better way to find out the problem? (except checking all possible connections by hand, which I did before soldering everything together)?
(I also have to take into account short circuits for the components I use within the circuit I guess).
Btw, I don't need to use the multimeter directly on the 220V connections, since I can check the 5V/GND of each power module


texts: Generation of Higher Freq from Lower Freq. Crystal

texts:
I have crystals whose frequencies are 8, and 25 MHz.

I want to create higher frequency sine waves using those crystals, say 60 MHz. The reason is that the sine wave oscillator, I have built one on breadboard, it has lot of harmonics as well as noise. I tried to put the same on PCB, but the PCB that I have (low cost) has lot of parasitic capacitance as well. So I am planning to use crystal oscillator.

After searching the net I have found the above diagram. But it does not mention at what frequency it is oscillating, because it is not mentioned I am assuming it is oscillating at crystal frequency. I am looking for a tweak to this so that I can generate higher sine wave frequency (quantifiable) using colpits topology or some other topology. Can someone please guide me. I have spent a week trying to create a stable and clean oscillator.

I have seen somewhere that it is possible, unfortunately I can't find that link anymore!


texts: Is it important to consider channel bandwidth of the signal to measure cable path loss for RF testing?

texts: I am performing some RF tests for 802.11 and measuring path loss of the RF test setup, it has a mix of PSK & OFDM signals. I see the norm is to use a Continuous Wave signal to perform RF path loss, from signal generator to power meter. But when testing an actual signal which can have channel bandwidth of 20 or 40 or 80 MHz, which is a collection of subcarriers or multiple bundled frequencies. Shouldn't the path loss signal be an actual modulated signal instead of just Continuous Wave signal to perform RF tests on high channel bandwidth modulated signals?


texts: Multipurpose momentary button - microcontroller/arduino/esp8266

texts:
as more of a hobbyist than a pro I apologise if I'm asking the wrong questions, however I have been researching for a while and hoped Stack exchange might help.

I've read a few articles on low power cut off circuits and soft latching power circuits but im hoping to achieve something a little smarter.

Essentially I'd like a single button interface whereby pressing the button would power the circuit when in the off state, act as an input when the circuit is active then power down the circuit if held for say 3 seconds or more.

On a software level it's important the power down the chip using the micro controller (potentially by dropping a pin to ground connected to a transistor/mosfet) as I'd like to send a "power down" message before shutting down the circuit.

Is this possible?

Thanks in advance,

Chris


texts: What do I need to start with AVR UC3 Microcontrollers?

texts: I am just beginning to learn how to use microcontrollers, and I have decided I am going to learn on the UC3B 32-bit avr. I will also be learning C programming in the process. What do I need in terms of programmers and other necessities, while staying pretty cheap, and where are some tutorials to help me get started?


texts: What's the shelf life of ceramic & tantalum capacitors?

texts:
What is the shelf life of unused surface-mount ceramic and tantalum (low-ESR or not) capacitors?

If they are kept at a reasonable temperature and humidity (at room temperature in plastic parts bins), will they keep indefinitely, or should they be replaced after so many years?  If they aren't suitable for production due to lower reliability, would they still be likely to function normally for prototyping purposes after 10 or 20 years?


texts: vhdl recursive instantiation with packages

texts:
I have a system where a design and a subdesign inside it are different architectures
of the same entity; so this is a case of recursive instantiation. First the setup :

-- common entity
entity MyEntity is port(A : in  integer; B : out integer);end;
-- first architecture
architecture MyArc1 of MyEntity is begin B<=A+1;end;
-- second architecture intneded to include the first
architecture MyArc2  of MyEntity is
 component MyEntity port(A : in  integer; B : out integer);end component;
 signal C : integer;
begin
 u1 : MyEntity port map (A,C);
 u2 : MyEntity port map (C,B);
end;

the above works fine with Modelsim. The problem comes up when I try to move the
component declaration into a package :

-- package that declares components
package MyPackage is
 component MyEntity port(A : in  integer; B : out integer);end component;
end;
-- second architecture as above but using the package
use work.MyPackage.all;
architecture MyArc2  of MyEntity is
 -- component declaration moved into package
 signal C : integer;
begin
 u1 : MyEntity port map (A,C);
 u2 : MyEntity port map (C,B);
end;

For some reason Modelsim doesn't like this :
Identifier "myentity" does not identify a component declaration

I don't see why it has trouble with this now. My experience with Modelsim is
that it is good at supporting the standard; so is there a subtlety here or does
Modelsim have a problem?

Thanks,


texts: How to use a GND transistor to turn off a voltage regulator?

texts:
Using an 5V out voltage regulator LM7805/NTE960 with a project that doesn't always need to use the regulator and may run on a battery.

The regulator will always draw some milliamps from the battery even when everything is powered off (I have an MCU on another regulator than can power off components connected to this regulator when not needed).

This will reduce the time the battery can be used. How many milliamps will be used though? (If it's less than 5ma, then it's probably not worth worrying about).

I'd like to have a transistor connecting the GND pin on the regulator to actual ground. Then I think I can turn off the regulator by using the transistor.

I'm using a BC516 transistor, with the emitter connected to actual ground, collector connected to the GND pin on the regulator. When I measure the voltage between the Vout on the regulator to actual ground, I get 10V. When I measure the voltage between Vout and the GND pin, I get 3.4V, when in both cases I need 5V.


texts: Explanation of this drawing (transistors)

texts:
I am very new to ECE and when i googled circuits for the beginner and this was one of them.

So far i have a basic knowledge of transistors and that they exist. please correct me if i am wrong.

Current flows to junction 1 and ignores it because transistor is currently off.
current flows to water sensor and if it is not sensing any water means that the circuit is not active.
in case there is water, at junction 2 current activates the DC 548 transistor.
i assume after that current from junction 3 goes in to the ground.
At the same time, at junction 1 current starts to flow towards junction 4 and 5 which activates the speaker.
Capacitor is connected between junction 4 and junction 2 is there to act as a some kind of short battery to make the sound to decay nicely instead of weird crackling.

Question: Also i have a thought that capacitor could be use as some kind of oscillator but i don't see how would it work in this circuit.

i started to learn electric circuits this morning so please be gentle.


texts: Can I use an LDO to control several diodes at a speed in the order of kHz?

texts:
I wish to control the switching on and off of several LEDs as indicated in the following figure:

simulate this circuit – Schematic created using CircuitLab

The bases of transistors and the ON/OFF pin of the LDO will be controlled from a microcontroller.

My question is:

Can a periodic signal be applied to the ON/OFF pin of the LDO and it works correctly? (Possibly from 1 kHz to 2 Khz)

Note that the schematic represents the first row of a matrix of several LEDs. That is to say that for each row there will be an LDO.

Thanks


texts: Electronic drum set powered with batteries

texts: I have a electronic drum set that I want to make portable . Is it safe to use couple of parallel joined 9v 500 mA batteries to replace the 9v, 500 mA  AC adapter and could the batteries last for couple of hours? The drum set is consisted of total 7 elemens plus a simple controlling device.the connecting cablels are relatively long, total of cca 4,5 meters..


texts: How can this 160MHz VHF locator tag work with such small antenna?

texts:
I recently came across a VHF locator tag used to find animals in the field. It operates on the 160MHz band. According to the user the locator range is some km line of sight (using Yagi antenna) and some hundred meters "in the jungle".
I disassembled the device and honestly was expecting a much larger antenna. Wavelength at 160MHz is about 1.8m, lambda/2 would be 90cm (dipole) and lambda/4 would be 45cm (monopole). But take a look at the antenna I found:

If pulled straight, the length of the handle is 55mm, the short wire 13mm and the long wire 34mm.
Can someone explain me how this antenna works with the length given? My understanding of an antenna so far is that only at a certain length proper RF transmission will happen.


texts: Static electricity discharge, what gets transfered?

texts:
Ive been studying Maxwell equations at school and I solved several excercises regarding electrostatic fields, however, I still have some very basic unanswered questions:

When a non conductive object is charged with negative charge and a second non conductive object with positive charge approaches, there will be a discharge or transference of charge from one object to another, Is that discharge actual electrons going from one object to the other? or is it only "charge" as in energy flowing from one to the other?

To further clarify my question: imagine a lightning striking the ground, is the electric arc ( the lightning itself) a bunch of electrons going from the clouds to the ground?


texts: Writing data on EEPROM or Flash memory of the PIC18F47J53

texts:
So I am using the 18F47J53 in Hitech PICC18-PRO compiler with MPLAB-X IDE, and for some reason there happens to be absolutely no support for the reading/writing function to either the flash or the EEPROM. All I need to do is write a received mobile telephone number that is read from a GSM module when receiving an SMS. Then later recall this number for comparison.

It seems as though it should be a really simple procedure using on of the predefined commands such as "eeprom_write(unsigned int address,unsigned char data);", though after checking why I get an error, I see that these commands are not supported, and even the basic standard command "EEPROM_WRITE(addr, data)" which does compile, does not do anything as it was "Added only for code portability", and the functions have been commented out.

Does this mean that this processor does not support any sort of internal read/write functionality, or has it just never been defined.

I have started manually (bit-wise) writing read/write/erase functions for this though without proper addressing could cause some major run time errors, especially due to the fact that the erase function can only work in blocks of 1024 bytes.

The write function looks something like this:

while(WR != 0){;}   // wait till EEPROM idle

    /* Load Table pointer Reg with Write to address (previously block erased) */
    TBLPTRU = Code_Addr_Upper;  // Load TBLPTR with Base Addresses?
    TBLPTRH = Code_Addr_High;   // Load TBLPTR with Base Addresses?
    TBLPTRL = Code_Addr_Low;    // Must be EVEN Addresses?

do{
       GIE = 0;                 /* disable interrupts */
    }while(GIE != 0);           /* make sure it worked */

WREN=1;                     /* enable writes */
EECON2=0x55;                // required sequence for EEPROM update
EECON2=0xAA;

do{
       WR = 1;                  /* disable interrupts */
    }while(WR != 1);            /* make sure it worked */

    WREN=0;                     /* Disable writes */
GIE=1;                      // re-enable interrupts

which receives 2 bytes at a time as the datasheet states that the smallest write size is 1 word at a time.

Has anyone found a way around this? Surely there is a simpler way.

Any help would be greatly appreciated.


texts: L293D and Arduino working only with common ground.

texts:
So I have an Arduino and an L293D. The L293D logic is powered by the +5V output of the Arduino, while the DC motor is powered by an external power supply.

Here's the part I don't get. If I connect the Arduino and the power supply grounds together the circuit works, otherwise it doesn't. Can you explain me why?


texts: Help me understand XOR gate with diode logic

texts:
I'm generally a pretty smart person, but for some reason I can't get my head wrapped around this one.

A little background -
I have performed this function before using two diodes and two SPDT relays. It works fine, but is bulky and wastes some money.
I did it with logic gates and one SPST relay. That was super fun and a learning experience. It worked, but didn't last long.

I have seen it written that the same thing can be done with either:
A - a rectifier bridge, or;
B - a rectifier and a some resistors

If I am using the correct specs for the components, either option would be smaller and cheaper and just as robust as the relay and diode method.
And, if I am reading the specs on the components right the relay isn't even needed.

I have no problem spending a few bucks to build something and letting the magic smoke out of some components and finding out it won't work.
What I do have a problem with is the fact that I just do not see how this works?

Which of these is correct?
Can you please help me understand how this would work?
Am I right that the components can be spec'd heavy enough to leave the relay out?
Are the resistors necessary, and if so how do you calculate the required values?

If this can really be done with a $1.28 rectifier rated at 100V, 20A that would save a lot of hassle and space. But, I really just want to understand why and how?!

It's easy to see how you would get power to the LED when either input high, but how does the output circuit get back to ground?
What causes it to not get power when both inputs are high?

simulate this circuit – Schematic created using CircuitLab

I have spent quite a bit of time researching this and just can't manage to explain it to myself...

(BTW - please ignore the fact that the LED doesn't have a protective resistor, this is just for the purpose of me understanding how this works, not an actual design.

Thank you!

EDITS made as suggested...


texts: Can this stm32f0 interrupt routine that activates on every byte received be fast enough for 6Mbps?

texts:
I am using the STM32F0 discovery board. I am looking at this tutorial on UART with the STM32F0. http://letanphuc.net/2015/09/stm32f0-uart-tutorial-5/

//variables need to be declared at the beginning
char Rx_indx, Rx_data[2], Rx_Buffer[100], Transfer_cplt;

//Interrupt callback routine
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
    uint8_t i;
    if (huart->Instance == USART1)  //current UART
        {
        if (Rx_indx==0) {for (i=0;i<100;i++) Rx_Buffer[i]=0;}   //clear Rx_Buffer before receiving new data

        if (Rx_data[0]!=13) //if received data different from ascii 13 (enter)
            {
            Rx_Buffer[Rx_indx++]=Rx_data[0];    //add data to Rx_Buffer
            }
        else            //if received data = 13
            {
            Rx_indx=0;
            Transfer_cplt=1;//transfer complete, data is ready to read
            }

        HAL_UART_Receive_IT(&huart1, Rx_data, 1);   //activate UART receive interrupt every time
        }

}

The interrupt routine activates on receiving a single byte on UART. I am not sure if it can support 6Mbps as mentioned in the datasheet. If not, can it support up to at least 115kbps? How can one make the code support up to 6Mbps?


texts:
I am learning about differential amplifiers I found the circuit for AC analysis in a book as shown:

They transformed it to a transistor model circuit as shown:

Though I am not excellent at circuit analysis but I suspect as why the direction of current source in right transistor is in the direction from emitter to collector. It is a NPN transistor, so shouldn't the current go from collector to the emitter?
Where am I wrong?


texts: How to compare two operands that are more than 4 bits using a 74181 ALU?

texts:
I have this 74181 ALU in Proteus.
I want to compare two operands that are 8 bits.
How should I change my circuit?


texts: Conductivity of water, and risk of shock? (fact checking)

texts:
Through simple researching I have discovered the unit of siemens (being a reciprocal of ohms).

Now I wish to apply this to a (silly) scenario where the conductivity of tap water is 800µS/cm (from this)

If I were to throw an extension line (assuming no circuit breaker, 120 volt) in to a theoretical pool, I have calculated something like this:

1/(800 µS) = 1250 Ω

Now using the formula I = E / R, I find out that:

I = 120 V / 1250 Ω = 96mA

Essentially, at 1 cm, 96 mA of current could flow through it and theoretically kill you?

And at 100 cm:

I = 120 V / (1250 Ω/cm 100 cm) = 0.96 mA

Theoretically allowing you to survive?

Now from my basic knowledge I assume the current would not even try to go through you unless you had a path to ground (a pipe, metal surface, ladder...) so would that not matter? If I were connected to the floor if that were a ground I would not die at 1 metre according to my calculations?

I promise I keep it theory!


texts: NPN is physically symmetrical yet the model isn't?

texts:
It just strikes me as very odd that all representations of the actual physics of NPN transistors in textbooks is perfectly symmetrical, yet neither the diagram used to represent them nor the mathematical model used to simulate them seem to reflect that.

Could someone explain where and how the symmetry disappears when going from the physical model to the mathematical one ? Is that asymmetry not important enough that it's just not worth depicting it ?

Here's an example of what I mean :

(source: ustudy.in)


texts: Custom FPGA PCB with external programming circuit

texts:
My team has verified our logic design on a development board and we are ready to move to a final prototype. Due to the nature of the device, the FPGA board must contain minimal components and be configured via an external programming circuit. The specific technology we have targeted is the Altera Cyclone V but I imagine the same principles could apply to other technology as well. I am looking for advice on the best way to achieve this in terms of time, cost and complexity.

I will focus on the simplest method of programming, which is Active Serial configuration. After scouring the Altera website for a few days this is what I have come up with as design requirements:

-The FPGA cannot hold a design configuration (bitstream) through power off, and thus requires some type of programmable non-volatile memory, such as flash memory.

-There is a simple power-on sequence where the FPGA provides a couple external signals to indicate it is ready to receive a bitstream and also provides a clock via internal oscillator to synchronize itself with the bitstream source.

-The board containing the FPGA must be programmed while attached to an external circuit, removed from the circuit, and placed in a PCB stack containing several other devices that are all operating independently from the FPGA. The FPGA is not controlling any of these other devices, although it does receive control signals in order to synchronize its activity with the overall system.

A few questions I am having difficulty with:

Are there OTS solutions for FPGA configuration (storage and bitstreaming) or is this something that absolutely requires a custom designed microcontroller solution, such as MSP430/PIC?
I've looked at the USB blaster chip for a programming circuit solution, but it uses JTAG and interfaces with the FPGA directly. I'm not sure if it is capable of interfacing with a storage device. It provides far more functionality than is needed for this system, and is quite costly (~$300 just for the chip). We don't need to be able to access internal signals using Signal Tap, because our test setup can verify operation using co-simulation. Are there existing devices that I can use, possibly as a paired system (on-board chip plus external programmer chip)? Or, can anyone recommend an alternative approach?

I've submitted a support request to Altera, but I doubt they will be interested in helping out a startup like us. Plus, I'm sure there's more expertise available here. Thanks in advance for any helpful advice. You guys are great!


texts: Booth multiplication algorithm, why it works?

texts:
Just learned about Booth's multiplication algorithm, and from what I understand if the multiplier least significant bit (MLB) is equal to the previous significant bit in that multiplier (MPLB) then we perform right shift. If MLB>MPLB then the 'accumulator' gets new value by subtracting the multiplicand from the accumulator and perform right shift. Otherwise we add the multiplicand and accumulator and perform right shift.

What's bothering me is why does this method work? Can anyone care to explain it to me?
Also how does the algorithm handle signed multipication? is it the same step except it got interpreted differently at the end?

Please enlighten me.


texts: Is the simulated clock cycle latency through an entity accurate?

texts:
If I write an entity that takes 10 clock cycles to produce output from input, is it safe to assume that this is the case when implemented in hw, or are there other factors to consider?

Does the simulation type (pre/post synthesis) or the similator software choice (modelsim, etc.) make a difference?


texts: Is it the quantum tunneling that causes the charges to go from emitter to collector rather than to base in BJT?

texts: I was trying to figure out the working of a transistor and I find few things in the transistor action analogous to quantum tunneling like the width of base (barrier in case of tunneling) need to be smaller and the potential of the collector need to be lower etc. Also the two diode model won't work as transistor when connected back to back because of the presence of metal wire in it. Is there something that prevents tunneling from happening in the wire? The main question is that if the quantum tunneling play an 'essential' role in transistor action?


texts: PCB target voltage reading too low on Atmel ICE Programmer

texts:
I've just had my first batch of PCB prototypes delivered from the manufacturer, and when I went to program them, the target voltage is reading too low. The device is based around an Atmel SAM L21 MCU, and I've attached a schematic for reference. The power supply is 3 AA batteries in series, connected to a Microchip MCP1711 3.3 LDO voltage regulator. In Atmel Studio, when I try to read the target voltage, it reads either 0.2v or 0.3v. I assume that because there is a voltage being read, that power is reaching the board, but I'm not sure why it's reading so low.

Does anyone have any suggestions as to what might be the problem? I've tested the batteries and the reading between them is reading around 4.5v, as it should be. Could this be a problem with the Atmel ICE programmer?

Any suggestions would be great. Thanks guys!


texts:
I've got a home-built watercooler that I've been using for more than a decade on my personal PC.  The unit has a single switch for the AC mains (120V 60hz) that splits to power both the AC waterpump, and the computer's ATX Power Supply.  Over the years, I has worked well, but I have seen a large amount of power supplies die while attached to this computer.  Average PSU lifespan connected to that system has been 1-2 years.  For a while I just thought I was unlucky, but it finally occurred to me that this setup might actually be causing the PSU failures by sending the AC transients caused by the AC motor start-up straight to these PSUs.

I realize that due to the sporadic nature of the problem, I can't prove that is the problem, but I thought it might be worth looking into a surge suppression circuit to shield transients from the pump from hitting the PSU.  (They need to stay on the same switch to be a failsafe from the computer running without the pump turned on.)  I figured it'd be more fun to build a circuit than to buy something off-the-shelf.

I'm seeing three types of surge suppression circuits:

An inline NTC resistor with a MOV between line and neutral.  (The NTC prevents inrush current until is warms up enough to pass full current through)
Inline inductors on line and neutral with MOVs between line and neutral on both sides of the inductors.  (Example)
Similar to #3 but with inline resistors instead of inline inductors.  (Example of both this and #1)

What pros/cons do each of the circuits have with regards to motor transients and ATX PSUs?
Also, I'm not finding component values for these circuits.  What are reasonable component values (the MOVs, the NTC, the inductors) for them to work?


texts:
I have an ECS-2520MV-500 on an unpopulated board that outputs this ~600mV pk-pk signal when I attach 3.3V and GND:

According to the oscillator datasheet, the output should have this voltage level:

Output voltage Level    VOL: 10%Vdd max/VOH: 90%Vdd min

This causing problems for the LAN8720A that relies on this signal since it doesn't meet the IL and IH requirements.
What could be causing the low amplitude of the signal?

Here is a picture of the board layout, currently it is all unpopulated so this is the entirety of the signal lines but the same behavior occurs when the whole board is populated.

There is also a ESP32 on the board that could potentially source the 50MHz signal but it shows the exact same behavior on all the IO pins that I checked (IO0 and IO17).


texts: Active Voltage to Current Converter Formula

texts:
I try to understand miscellaneous applications using op-amp and on this website https://wiki.analog.com/university/courses/electronics/text/chapter-4 I am confused by the circuit below.

The given formula is for calculting the load current is

 when

There is no explanation that how it is obtained on the website.
It looks complicated and is different from the feedback configuration I have seen before which only normally 1 loop.

I have no idea how to start tackling the problem. What I know is V+ = V- because of high gain of the op-amp.


texts: Calcualting the number of magnet wire turns and layers in a coil bobbin

texts:
I'm trying to find a formula to calculate the number of turns needed in a thermoplastic bobbin to use in a electric motor.  Instead of using magnet wire in the slots of a lamination stack, the bobbin can be wound on a inexpensive single flyer winder before being inserted into the lamination stack slot.  Here's what I've done so far.

Determined what total resistance the motor needs to have.
Using the AWG table pick the diameter of a representative wire (until I know how much wire I need it will be a guess).
Using the AWG determine the resistance of a certain length of this wire.
I calculated using a CAD program the surface area of the bobbin that will constrain the wire.
Then find the elusive formula for pulling this data together.


texts: Difference between \$\epsilon\$ and \$\epsilon_0\$?

texts:
I have been given the following equation for the speed of light:
\$V = \Large {1 \over {\sqrt {\mathstrut \epsilon \cdot \mu}}} = {1 \over \sqrt{\mathstrut \epsilon_0 \cdot \epsilon_r \cdot \mu_0 \cdot \mu_r}}\$
(https://chart.googleapis.com/chart?cht=tx&chl=foo%2bbar)
What is the difference between simply \$\epsilon\$ and \$\epsilon_0\$? Likewise with \$\mu\$ and \$\mu_0\$?


texts:
I'm testing out the comparator LM393 but when I try and the comparator conditions meet
it only outputs low and won't switch high.

That or I don't understand how it works properly so if you can help me out it would be great.

I have 2 power supplies (each independent.)

One output a voltage of 12V, the second can output 10V or 13V.

Output 1 would resemble Vref (12v)

Output 2 would resemble Vin  (10-13V)

In the picture below

Vin is connected to the non-inverting input
Vref is connected to the inverting input
GND is connected for both supplies
resistors are for current limiting

The first diagram I've connected the led so when the comparator output switches low.

When only Vin > Vref   it would light up.

In the second diagram I've connected the led so when the comparator switches high the LED will turn on

BUT no matter what the output won't switch high and the LED won't turn on.
What am I missing here?


texts: Connecting a 12v relay to microcontroller circuit

texts:
I am trying to build an automatic plant watering system using ATmega16. We are using moisture sensor for our project.
The circuit diagram is as follows:

We are using the following 12V relay:

I have no experience of using relay. How I will connect the relay across D1 as shown in the circuit. I mean which pin of relay (there are 5 in total)  will be connected to the two terminals of the diode as shown in the above figure and which two pins will be connected to a dc motor so that I can drive a dc motor. And how will I test the relay is working properly using multimeter (before connecting the motor)  when I am getting 5v or 0v from PC0 as output?


texts: Reduce and clip voltage of a 5Mhz ultrasonic signal from +-50V to 0-3.3 V

texts:
I know there are a lot of posts similar to this one but some differences make it worth posting it.

I’m working on a project where I have a 5MHz AC signal with the largest amplitude of +-50V.  It’s an ultrasonic signal where the transmitted signal has higher amplitude than the received. I want to sample both the transmitted and the received signals so that I can later calculate the distance between them. The DSP I'm using for this is TMS320F28335 from texas instruments, which only takes in 0-3.3V.

At first I thought a simple resistor divider would do the work but I encountered some problems, almost as those described in “How to Convert 0 to 10V analog signal to 0 to 2.5V for ADC input?”. However, the answers described there show how a signal can be linearly converted to a smaller voltage range. But since I’m not interested in the height of the transmitted signal (only interested in where it is relative the received signal) I want to clip parts of it and at the same time reduce the amplitude of the received signal. I want the received signal to have a good SNR as possible given the 3.3V limitation.  Any ideas of methods I can use? I’m also wondering what the DSP will do with all the negative values I have?


texts: I don't understand a couple of symbols on this diagram

texts:
I'm trying to connect a XS3868 Bluetooth module to an Arduino. This is what the module looks like, the picture includes the pin names.

I also found the following diagram online that explains how to wire it:

There a couple of symbols in that diagram that I don't understand though:

What does the symbol indicated in red and the 47u or 220u next to it mean?
What is the part of the circuit indicated in blue trying to do? Why is there a capacitor?

Thanks for your help!


texts:
I got a cheap powerbank, which didn't work at all, so  decided to look inside it. There is a control IC AP5900, what I found about it is a chinese website:
http://www.chipown.com.cn/en/case.asp?id=24
They included a reference design there with schematic:

Now I measured the battery voltage in turned off state, which was 1.7V...pretty unusual for a Li-ion battery, expected at least 3V. So I tried to charge it and measured the voltages during charging. The control IC gets 4,9V measured on pin 6 (referenced to GND pin 8), but the voltage on the pin 5 (so the charge voltage) was only 0,9V (referenced to pin 8). The battery voltage was still 1.7V, so I measured the voltage between pin 5 and battery positive and there was the 0,8V differnce, so its not connected on the PCB as on the schematic.

Can you give me any tips what could be wrong with it or how to try to find it out?


texts: Host device data transfer to 10 slave devices

texts:
I have a project I'd like to prototype that requires a host device that can communicate with up to 10 small hand-held slaves at one time. I looked at the latest Raspberry Pi 3 and it may possibly serve as a host since I may require HDMI output on the host. The host is doing most of the work here in this project.

My questions revolve mostly around the slave units. They must fulfill these requirements:

less than $50 USD each total hardware cost to build the slave device
a small color screen (TFT or other) capable of at least 320x160 and fitting in your palm.
preferably low power usage or capable of feeding power off host device
Wired (initially) with a thin cable feeding each slave power and/or data.

The data transfer is from host to slave and is not high bandwidth. (100 bytes every 1-3 seconds to each device)
The slave will simply read any incoming data and displays a variable picture based on the data received. Preferably, data would only be sent once and must be received at each slave.

I saw this post describing some common transfer protocols:
USART, UART, RS232, USB, SPI, I2C, TTL, etc. what are all of these and how do they relate to each other?

I think UART, SPI, and IC2 would all work.

I would like to keep the cabling simple.

What would be a method\bus for driving up to 10 slave micro controllers from a master micro controller?
Do I have to worry about power from bus communication?


texts: Question about the metal-semiconductor junction

texts:
I'm studying the metal-semiconductor junction on Muller-Kamins book. I have two questions.

This is the band diagram of the metal-semiconductor junction in thermal equilibrium:

In order to get this plot, the book gives some rules. One of these rulese says that the vacuum level E0 must be continuous because if it were not then "one could conceive of means to extract work from an equilibrium situation by emitting electrons and then reabsorbing them an infinitesimal distance away where E0 had changed value". What does this mean?

This is a picture taken from the book representing the situation that occurs when a voltage is applied to the system:

Now, when you apply a voltage, you go out of thermal equilibrium and you enter a quasi-equilibrium condition. In the first chapter of the book, the Authors say that in this case, in order to represent n and p (electron and hole concentration in the silicon, respectively), you need to define two quasi-Fermi levels: one for the electrons (Efn) and one for the holes (Efp).
Why is only one generic Fermi level for silicon (called Efs) represented in the picture?


texts:
At work I've inherited a multilayer PCB design that I need to send out for quote and eventual fabrication. It contains two inner layers that are labeled "AIRGAP". What is the purpose of these air gap layers?

The board stackup is as follows:
 1. Top Silkscreen
 2. Top Soldermask
 3. Top Copper
 4. Ground Layer
 5. Ground Layer Airgap
 6. VCC Layer
 7. VCC Layer Airgap
 8. Bottom Copper
 9. Bottom Solder mask

The highest voltage on the board is about 40 volts, so I wouldn't think it's a high-voltage design.

Would this be considered a four-layer board, or more? Some of the board houses we've sent it to are confused as well.


texts:
Say I want to reduce noise on the data line for WS2812B led strips.
Is it a viable option to use CM chokes to reduce this noise?
According to the docs, WS2812B data speed is 800Kbs. Which I guess translates to 800Khz on the data lines.
I read cm chokes can reduce noise. But I am not sure which ones I should use.
Should I get one which has a resonant frequency of 800Khz? Or will that then have the exact opposite effect of what I am trying to achieve?


texts: How are those connectors called? (see images)


texts:
I'm currently reading through the datasheet for the 74HC165 8-bit asynchronous parallel-to-serial shift register, and I've a handful of questions about the static and dynamic characteristics described therein:

The recommended operating condition for supply voltage (Vcc) states a typical value of 5V (with a minimum and maximum of 2V and 7V, respectively). Why then, when listing the static/dynamic characteristics such as logic voltages and timings, does the datasheet use Vcc = 2, 4.5, and 7 volts as its conditions for min/typ/max and not 5V?
A few of the timing characteristics have those three, but then they have a Vcc = 5V case which also specifies an output load capacitance (C_L). Why is this, and why for only some of them?

The timings only have minimum and typical periods, but they don't seem to make sense. For example, pulse width (t_W) which as I understand represents the amount of time the pulse needs to be active to allow time for detection, has a minimum of 16 ns and a typical period of 5 ns. The minimum is obviously larger than typical, so what am I supposed to make of this?

Thank you!


texts: USB keeps disconnecting and reconnecting on microcontroller

texts:
I'm using an ATSAM4E16C microcontroller as a serial usb com port but it doesn't stay connected. After i plug it in i head the usb plugged in sound, and then it enters a loop where every 5 seconds or so it disconnects and reconnects immediatly.

I used this microcontroller on my own board and i was thinking if it could be because of a bad crystal oscillator.
In the datasheed of the uC it said to use a crystal with a Load Capacitance between 12 and 18 but i used one with 10pF, and 15pF capacitors on each end.
Could this be the issue, or should i look somewhere else?

Thanks


texts:
I want to install a secondary car battery for a system/project that I am working on. However, somehow I need to be able to charge it while car is running, but not let the car modules use secondary battery?

Is this possible?


texts: Why fake harmonics appear when using weighting windows?

texts:
As far as my understanding goes, windows in the FFT can be used to reduce the leakage error.

Suppose that I need to sample a continuous time sinusoidal signal s(t) with frequency \$F = 10 Hz\$. Suppose the sampling frequency \$Fs = 100 Hz\$.

Suppose that the synchronous sampling condition is met, ie \$MF = F_s\$ where \$M\$ is the number of samples with \$M=10\$. Then the signal spectrum looks like this

This is completely correct since the frequency resolution is

$$\frac{F_s}{M}=10 Hz/bin$$.

Now suppose of using a Hamming Window, (there is no need for the window here but let's use it for the sake of my argument). Hamming window has order L=2 which means that the width of the main lobe of the window's spectrum is:

$$\frac{2 \pi}{M T_s} L = \frac{2 \pi}{M T_s} 2$$

in radians or $$\frac{2L}{M T_s}$$
in Hz.

Now, due to the width of the main lobe, when applying the window I expect to see 2 fake harmonics of equal amplitude in the DFT, which is exactly what I see down here:

However, by doubling the number of samples to M' = 2M = 20 (now we are sampling 2 periods) and the width of the main lobe of the window should be

$$\frac{2 \pi}{M' T_s} L = \frac{2 \pi}{2M T_s} 2 = \frac{2 \pi}{M T_s}$$

which is exactly the width of the main lobe of a rectangular window. This time, in the DFT there should be no fake component and only the real component, however this is clearly not the case as you can see down in this last picture:

Why is this the case? Shouldn't this last picture look like the first one (ie contain only one component instead of three?).


texts: I have recently made an internet controlled switch with an arduino mkr1000 and the software part worked just fine. I'm new to electronics and i have a few questions for the wiring part. I have a opto-isolated relay module (datasheet) which have 2 power pins operating at 5V and 2 logic pins. I power both the relay and arduino separately with a 5V power supply and i've connected directly the logic wirings (mkr1000 work at 3.3V). I've tried putting a led for protection just because i had no other diodes but it seems it drains too much current and the relay does not work. I've searched on the internet but the aswers related on using a transistor and a diode consider using the same power supply, does a separate one change something? I got all the stuff working but is it safe to drive a relay like this? Do i have to add a diode or a transistor?


texts: A simple VHDL circuit won't display initial value

texts:
Here is my code and it's pretty simple. I'm to cycle through the first 8 letters of the alphabet on a Altera Cyclone II board.

entity lettercycle is
    port(
        SW  : in  std_logic; -- toggle switch
        HEX0 : out std_logic_vector(6 downto 0) -- 7-segment display
        );
end lettercycle;

architecture behavioural of lettercycle is
    signal counter : integer range 0 to 7 := 0;
begin
    process
        type SEGMENT_ARRAY is array (0 to 7) of std_logic_vector(6 downto 0);
        variable SEVENSEG : SEGMENT_ARRAY := ("0001000","0000011","1000110","0100001","0000110","0001110","0010000","0001001");
        begin
        HEX0 <= SEVENSEG(counter);
        wait until SW = '0';
        counter <= counter + 1;
        end process;
end behavioural;

This works great, it cycles but initially it doesn't display "A" on my seven segment display. It displays "8" (so nothing essentially). Once I push SW which is a logic 0 switch it changes to 'A' and cycles to 'B', 'C', etc properly. It also loops correctly. What it isn't doing is initially setting to 'A'. If I force

    HEX0 <= SEVENSEG(0);

Then it will display 'A' initially so I'm out ideas. Could this be related to bouncing?


texts: Safety when charging two LiPo cells in series

texts:
NOTE: I am asking this question because I am new to this subject, and I want to be sure about what I'm doing before I go out and buy parts.

I am making a really fancy watch with an OLED screen, sensors, and all those goodies, along with an arduino nano requiring 7-12V in its input in order to function. My plan is to put two 3.7V LiPo cells in series.

I'll need to charge them every so often, and of course, when I do, I don't want to interrupt power to the watch. So, I am currently following this online guide:

http://blog.zakkemble.co.uk/a-lithium-battery-charger-with-load-sharing/

(This is a tutorial to build a "... circuit [that] disconnects the battery when USB power is connected, the load will instead use power from USB. This allows the battery to charge normally without any outside disturbances.")

My question is this: is it safe to make two of these circuits, wire them up in parallel, and charge both batteries at the same time? And if that's no good, is it at least safe to charge each one individually in this series setup?

Thanks


texts:
In my student years we studied the microwave quantum device, equivalent to laser, named maser. It worked on ammonia molecules, so it was not a solid state. It has phenomenal specs, as quantum device is supposed to. The noise, amplification and the selectivity.

With decades of development in solid state lasers, and solid state acoustics/mechanics, did similar development ever happened to masers ? Or is there fundamental low frequency limit for quantum SSD ?

Thank you


texts: What's this thing which looks like a water sensor inside a PC mouse?

texts:
I found an old optical PC mouse, and decided to check what's inside. Everything seemed as usual, but there is a component I've never seen in other mice, and I don't understand its purpose (see photo below).

It looks a lot like a water sensor. However, I don't see the point of having a water sensor inside the mouse: it's not like it is an object which frequently gets some water inside.

The resistance at the edges of each “Ш” is 350 Ω. The first connector goes to left, right and middle buttons of the mouse. The second connector goes to an integrated circuit.

So what is this thing?


texts:
Having some trouble with transistor logic.

I have an existing circuit with a 3.3V rail and signal rail that is pulled to 0V when asserted, i.e. active low. I ultimately need to control four 12V LED clusters, which draw 125mA each. From hereon I shall refer to 'four 12V LED clusters' as a single LED for simplicity. I can use PNP transistor to power a 12V LED, However I would like a second LED that is the inverse of the first.

I tried to add NPN, with the base on the signal and a pullup resistor on the base to the 3.3v rail but this causes the PNP to be always on as current can flow from the PNP base through the NPN base to the 0V rail. A diode would stop the flow for the NPN.

After reading CharlieHanson comment got further on but I need the LEDs to be ON or OFF not reduced.

see simulation here

EDIT: To reiterate, Switch 1 does not exist. It's an output of another board that is either high impedence (actually disconnected) or 0V.


texts: Do I need additional power for an IR LED diode 50 feet away from a Raspberry Pi?

texts:
I'm creating a central remote to control my mini-split HVAC units. Those units are controlled with an IR remote. Each unit is in a different room of my house.

I have everything working on my breadboard and the IR LEDs are able to control the HVAC when it's in the same room.

However, the Pi will be in my server room and each of the IR LEDs will be wired to a different room in my house. The rooms are anywhere from 30 to 50 feet (10-15m) away from server room.

The unit will have multiple LEDs but only one LED will be sending a signal at a given time.

I'm using these IR LEDs from Amazon.

RX IR LED
Working Voltage : 2.7 - 5.5V
Working Current : 0.6 - 0.8mA
Carrier Freq.   : 38KHz
BMP width       : 8KHz
Receiving Angle : 70°
Receiving Dist. : 15m

TX IR LED
Working Voltage : 0.9 - 1.3V
Reverse Voltage : 5V
Forward DC      : 30mA
Launch Angle    : 30°
Emission Dist.  : 12 - 13m

What gauge wire should I use to connect the LEDs over that distance?

Will the 3v power from the Pi be enough to power the LEDs that far away?

If I need to use an additional power source to power the LEDs, what would that schematic look like?

Note: I'm hard wiring this for reliability and simplicity. I don't want to create multiple wireless WiFi modules that communicate with the Pi. I just want the diode in the other rooms.

Here's my schematic

Thanks!


texts: How can CAN transceivers ouput CANH=3.5V and CANL=1.5V?

texts:
When sending a dominant bit (0bit) on the CAN bus, I understand that CAN transceivers output CANH=3.5V and CANL=1.5V.

But when looking at the schematics of a CAN transceiver, I do not understand how the CANH=3.5V is achieved (figure as follows borrowed fro TI blog post).

Does the Schottky diode (in the picture) along with the transistor make the 1.5V drop? Based on the fact that Schottky diodes drop very low voltage (~0.5V), I can't imagine the MOSFET dropping 1.0V. Especially when the drain-to-source resistance is a few mOhms for CAN transceivers.

Anyone can explain how the 1.5V drop from Vcc=5V to CANH=3.5V is achieved?


texts:
I am trying to challenge myself to learn how to calculate cycles per second and integrate what I have learned through component behavior and data sheet test specs. Not an easy task with google as your only teacher. However, I have attempted to try to calculate the approx. Pwm hertz from my latest project in order to trouble shoot it. Please correct my math and understanding if I am wrong.

Pwm generator is 40106 inverter with estimated specs for 12v use:

High trigger=7V
Low trigger=4.5v

Astable components
100k pot set to 50k
.1uf cap

Math:
Time constant : \$rc =.0000001*50,000 =.005s\$

Cap charge formula : \$V_c=V_s(1-e^{-t/rc})=12(1-e^{(-.0023/.005)})=4.5V\$

\$V_c=7V\$ with \$t=.0045\$
Difference of .0022 seconds from 4.5v to 7v
This is the high output time on inverter

Cap discharge formula : \$V_c=V_s(e^{-t/tc}) = 12(e^{-.0023/.005})=7.5V\$

\$V_c = 4.5V\$ with \$t=.0023\$
Same difference of .0022s.

Total on/off cycle .0044 seconds
\$\frac{1}{.0044}=227Hz\$

I realize discharge was to 7.5v not 7v just for consistent value sake. Go easy on me if I am way off. Just a hobbyist. Thanks for any help.


texts: How to identify and wire leads on a one phase 6 lead, capacitor start, capacitor run electric motor

texts:
The leads are labeled U1, U2, U5, U6, Z1, and Z2.  My research has found wiring diagrams on 4 lead motors where U1 & U2 are main winding and Z1 & Z2 are auxilary winding. Start capacitor wired to auxilary winding. Run to both.
Not sure what U5 and U6 are. Does this motor have three windings ? Not sure how to wire in the capacitors either . Anyone familar with this arrangement . The motor is of Swiss (German) origin


texts: What are the situations where Kirchoff laws cease to be valid? How we can create circuits based on lumped element discipline, and that can work in real life? We take ideal conditions, but they just are not like that in real life.


texts: Desoldering a TO-220 MOSFET from a plated through-hole board with SMD complications

texts:
I'm planning on replacing a TO-220F package MOSFET on a through-hole circuit board that also has SMD components on it. In this case, an SMD capacitor is connected to the source gate of the MOSFET by what looks to me like a small solder bridge or "trace" on the underside of the board, as pictured below.

I'll need to desolder the MOSFET and solder-in the new one. My question is, will or can the solder "trace" be preserved during the desoldering process, or will I have to somehow recreate it with the new component in place, if that is even possible?

The board is TCO'99 if that is relevant (solder already present may or may not be lead-free? higher melting point and working temperature?).

I will have copper solder wick, rosin flux paste, silver-bearing solder and a twenty-dollar soldering iron with an ESD ground-clip and a fine/chisel tips to work with.

Any other tips within the scope of this question are appreciated. Primarily, I am focused on making sure that existing components are not damaged during the process and that the new one is installed so that proper functioning is restored.

The problem with the MOSFET itself is that it is overheating very rapidly, though the circuit seems unaffected. A thermal sensor is placed directly between it and another which shuts the circuit down over a certain temperature.

I located this particular component by touching it, and it does get very hot in addition to exuding an acrid burning smell after a few minutes.

My working assumption is that the component suffered critical overheating which separated some layers within it, and its thermal performance is now shot.

Below is the schematic for the circuit in question:

I actually took a picture of the wrong portion of the board (Q517 instead of Q507), but the components are the same.

EDIT AFTER THE FACT: Well, I ended up desoldering everything instead of snipping and soldering the new part onto the legs on the top side of the board as answered, mostly because it was too tight to work between the components. Good thing the part was already dead, because I had to really work the pads and even ripped up a trace getting all the pins out using my cheap iron. I connected the leg with the missing pad to a solder bridge built on a snippet of the copper-wire wick I was using, and, luckily, it all worked out. Lesson is to get a soldering station if you can afford it.


texts: Load/Shunt resistor value calculation for DC-DC Converters

texts:
I have DC-DC converter with rating -4KV and 1W. The unit supports current monitoring of output voltage. I would like to test the current monitoring using shunt resistor.
What should be the rating of the shunt resistor. How to calculate the desired resistor value and power rating.
Thanks


texts: I'm having trouble finding an affordable low bandwidth analyzer solution for measuring audio spectrum performance (20KHz and below).  Does anyone have a suggestion for buying (new / used) or building a s/n ratio meter or distortion analyzer for comparing components at a line level output of 5V pk-pk 1Mohm or less?


texts: How does avr-gcc linker know to put the `.data`section at `0x800100` rather than `0x800060`?

texts:
Looking at the linker script for my part (ATMEGA168PD), the data region has an origin defined as starting at 0x800060...

MEMORY
{
  text   (rx)   : ORIGIN = 0, LENGTH = __TEXT_REGION_LENGTH__
  data   (rw!x) : ORIGIN = 0x800060, LENGTH = __DATA_REGION_LENGTH__
  eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = __EEPROM_REGION_LENGTH__
  fuse      (rw!x) : ORIGIN = 0x820000, LENGTH = __FUSE_REGION_LENGTH__
  lock      (rw!x) : ORIGIN = 0x830000, LENGTH = __LOCK_REGION_LENGTH__
  signature (rw!x) : ORIGIN = 0x840000, LENGTH = __SIGNATURE_REGION_LENGTH__
  user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = __USER_SIGNATURE_REGION_LENGTH__
}

The .data output section does not explicitly define an address, but instead only refers to the data region ...

  .data          :
  {
     PROVIDE (__data_start = .) ;
    *(.data)
     *(.data*)
    *(.gnu.linkonce.d*)
    *(.rodata)  /* We need to include .rodata here if gcc is used */
     *(.rodata*) /* with -fdata-sections.  */
    *(.gnu.linkonce.r*)
    . = ALIGN(2);
     _edata = . ;
     PROVIDE (__data_end = .) ;
  }  > data AT> text

...yet the .data output section ends up at the address 0x800100 rather than 0x800060...

00800100 l    d  .data  00000000 .data

This turns out to be the correct address for the start of the .data segment on this part because 0x800060-0x8000ff is reserved for some registers and is not general purpose RAM.

There is no origin in the linker script that would specify the 0x800100 address and there are no command line parameters to the linker that would tell it this magic, part specific number. There are no other output sections in the data region that could be pushing the .data output section higher in memory to the 0x800100 location (.bss and .noinit both follow .data and are relative to it).

I've also noticed that if I rename the .data out section to anything else, its origin lands at the beginning of the data region at 0x800060 as expected. Somehow the linker knows that an output section specifically named .data must start specifically origin 0x800100 rather than the start of the region specified in the linker script.

It is as if somewhere there is a .data = 0x800100; or -Tdata=0x80010, but I can not find it anywhere!

My question is: How does the linker know to start the .data addresses at 0x800100 for this part?


texts: why SAR ADC private case matches general formula

texts:
There is a gerenal formula for SAR ADC shown bellow.
And there is a private case for 101.
i tried to match this private case with the gerenal formula
and used N=2^3=8 and X=3
But i dont understand why in this case?
X is Bits that set in a givern corevention.
Thanks.


texts: Find equivalent resistance at terminals a-b and c-d in the given circuit

texts: I tried delta-wye transformation, which hasn't worked for me. Plus, I don't understand how to solve for two different pair of terminals, all problems before this had only one pair of terminals.


texts: I2C over long distance with RJ11 CAT3 cable: how EMI noise will effect differential (but not twisted) pair wires

texts: I have several nodes with Cat3 RJ11 cable in my office. I need to do an I2C communication between several nodes over + 20m and read about the PCA9615 driver. Unfortunately, the Cat3 RJ11 cable has only 4 wires and there is no twisted pair. So do you think I'm going to have a big problem with that? Will EMI noise affect more or less the same the differential (but not twisted) signals?


texts:
I've an old lead acid battery with the following specs:

12V, 7.2Ah
Valve regulated
Sealed lead-acid type

I've no idea about batteries prior. This battery has been in the attic so far and I would like to use it now. But, it is almost dead. I tried to recharge by applying 12V to it for one hour. But that doesn't seem to work. So, how can I recharge the battery or how to find out whether the battery is dead?


texts: 5V Songle relay, pcb slightly hotter than room temperature

texts:
On a self made pcb, I use a SONGLE 5V Relay, powered with 5V (datasheet: http://old.ghielectronics.com/downloads/man/20084141716341001RelayX1.pdf ).

After some hour that relay is active, I can "sense" with the finger that PCB and relay itself is a couple of degree more hot than room temperature.

Attention: it is not hot, it works, doesn't burn, but with finger you can "sense" more heat.

'Cause on same PCB i have also a temperature sensor, is there a mode to eliminate that heat? I could adequate the sensor adjustemnt to -0.2°, but I'm looking for a more professional solution.

In production PCBs I see every time some cuts under the relay itself. I can imagine they are made to separate "high" voltage from "low" voltage. But maybe they serve for heat dissipation also?

This is the BRD, relevant on PCB part for relay:

Relay is soldered on bottom layer. If I need some cuts on the PCB, how you would do them?

Thank you very much


texts: I have some security cameras who's only interface is a BNC connector and I want to use them to do video processing. I want to find a simple way to interface a BNC camera with my computer so that I can get the data. I figured that the only way is to create a simple circuit that can forward data from the pin through USB, then write drivers for it so that I can register it as a directshow video camera (on windows). Is there a better way to do it?


texts: Calculating Transfer Function of passive circuit

texts:
I have the following passive circuit:

I want to calculate it's transfer function \$V_{out}(s)/V_{in}(s)\$.

My thoughts are: Part I: The voltage on the capacitor in the center (call it \$V_c(s)\$) is taken by the voltage divider created by the resistor and inductor in series to it's left and that capacitor i.e. \$V_c(s)=V_{in}(s)(1/sC)/((1/sC)(R//sL))\$ (these lines\$\\\$ mean that R and L are in parallel). Part II: Then since we have \$V_c(s)\$ which is of course a function of \$V_{in}(s)\$, we can calculate \$V_{out}(s)\$ from the voltage divider created by the rightmost resistor and the inductor on the left as\$V_{out}(s)= V_c(s)(R)/(R+sL)\$. Part III: Afterwards i substitude the expression of \$V_c(s)\$ that i calculated in part I and this way i find the expression for the transfer function \$V_{out}(s)/V_{in}(s)\$.

Are my ideas correct? If not what should i do? All ideas that can help me are welcome. Thanks in advance.


texts:
I use STM32F103C8T6 to drive WS2812 RGB LED strip.
So I try to setup TIM1 to generate PWM using DMA.
Everything works fine except the fact that I get more waves then I requested.
Almost all the code I get from STM32CubeMX ready, here is a code that I use:
Time initialization:
static void MX_TIM1_Init(void)
{

  TIM_ClockConfigTypeDef sClockSourceConfig;
  TIM_MasterConfigTypeDef sMasterConfig;
  TIM_OC_InitTypeDef sConfigOC;
  TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig;

  htim1.Instance = TIM1;
  htim1.Init.Prescaler = 3-1;
  htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim1.Init.Period = 30-1;
  htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  htim1.Init.RepetitionCounter = 0;
  htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
  if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
  if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  if (HAL_TIM_PWM_Init(&htim1) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  sConfigOC.OCMode = TIM_OCMODE_PWM1;
  sConfigOC.Pulse = 0;
  sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
  sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
  sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
  sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET;
  sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET;
  if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
  sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE;
  sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF;
  sBreakDeadTimeConfig.DeadTime = 0;
  sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE;
  sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH;
  sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE;
  if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

  HAL_TIM_MspPostInit(&htim1);
}

DMA Initialization:
static void MX_DMA_Init(void)
{
  /* DMA controller clock enable */
  __HAL_RCC_DMA1_CLK_ENABLE();

  /* DMA interrupt init */
  /* DMA1_Channel2_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);

}

I use DMA interrupt to stop the timer:
void DMA1_Channel2_IRQHandler(void)
{
    HAL_DMA_IRQHandler(&hdma_tim1_ch1);
    HAL_TIM_PWM_Stop_DMA(&htim1,TIM_CHANNEL_1);
}

And main():
TIM_HandleTypeDef htim1;
DMA_HandleTypeDef hdma_tim1_ch1;

int main(void)
{
  HAL_Init();
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_TIM1_Init();

  uint8_t pData[] = {5,10,15,20,25};
  HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_1, (uint32_t *)pData,5);

  while (1)
  {
  }
}

The CPU works on 72MHz, in clock configuration APB1 Timer clock set to work on 72MHz too.
I configured Timer prescaler to 3 and Counter to 30 steps to generate 800 kHz waves.
I send to DMA 5 bytes and expect to get 5 waves with pulse increasing.
Here is what I get in fact:

Instead of 5 I get 7 waves for some reason. The last 2 just repeated the 5-th wave.
What I missed and how do I fix the situation?