texts:
I have some software running on an STM32F103 (I'd also like to be able to use the F4) where I'd like to be able to 'timestamp' events (such as interrupts on external pins) to the nearest microsecond (if not better).

As the software will be running for some time I want to use a 64 bit timer, and to me it made sense to use the built in SysTick timer. I have created SysTickMajor (a 64 bit counter) which increments every time SysTick overflows, and a function getSystemTime which combines this counter and the current value of SysTick to get me an accurate 64 bit time:

#define SYSTICK_RANGE 0x1000000 // 24 bit
volatile long long SysTickMajor = SYSTICK_RANGE;

voif onInit(void) {
  SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);
  SysTick_Config(SYSTICK_RANGE-1);
  /* Super priority for SysTick - is done over absolutely everything. */
  NVIC_InitStructure.NVIC_IRQChannel = SysTick_IRQn;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  NVIC_Init(&NVIC_InitStructure);
}

void SysTick_Handler(void) {
  SysTickMajor+=SYSTICK_RANGE;
}

long long getSystemTime() {
  long long t1 = SysTickMajor;
  long long time = (long long)SysTick->VAL;
  long long t2 = SysTickMajor;
  // times are different and systick has rolled over while reading
  if (t1!=t2 && time > (SYSTICK_RANGE>>1))
    return t2 - time;
  return t1-time;
}

The only problem is this doesn't appear to be 100% accurate - for instance, if I do the following:

bool toggle = false;
while (true) {
  toggle = !toggle;
  LED1.write(toggle);
  long long t = getSystemTime()() + 1000000;
  while (getSystemTime() < t);
}

I won't get a good square wave - occasionally there will be glitches (even though the SysTick interrupt is finished very quickly), because at points the time returned by getSystemTime is completely wrong.

UPDATE: When this happens (I am recording the time value on an interrupt triggered by an external event) I dump the last 3 values to serial. Repeatably I get things like:

>0x278-E2281A
 0x278-E9999A
 0x278-0001E5

>0x5BE-F11F51
 0x5BE-F89038
 0x5BE-0000FB

I've stuck dashes in to depict which bits come from SysTick.

Now just to avoid doubt, I've used the code from starblue below. I've also changed it to use a 32 bit value for SysTickMajor, and I've ANDed out SysTick->VAL, just in case.

It appears that the SysTick_Handler is not preempting the other interrupt!

Now I've checked over this and I did have the Preemption priorities wrong previously, but now I set NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); then set up the interrupts - SysTick preemption priority 0, and the other interrupt is 7.

Is there something else I have to do to get preemption to work?

UPDATE2: I created a tiny test case for this exact issue (SysTick not preempting other interrupts), and have put it here:

STM32 Interrupt Priority (preemption) Problems

So what's wrong with the code above? Is there a better way to get a good high resolution timer? It seems like something obvious that people would want to do but I'm struggling to find examples.


texts:
I want to measure the Sediment of water. So I chose a 1MHz Ultrasonic Transducer sensor with the ability to work underwater and also can recognize the sediment under water.

The output of the sensor is analog, but I need a driver to convert to digital.
I need your help to suggest to me what should I do. How can I prepare an electrical circuit? Does anyone know what's the best way?

This is the link of the specification of the sensor:
http://chinaultrasound.com/product/1mhz-ultrasonic-transducer-depth-measurement-td1000ka/

Thanks so much.


texts: How to supply 2 different voltages to a circuit every 2 minutes

texts:
For executing a (stress) test scenario, I need to simulate the following behavior on my circuit:

for 2 minutes, deliver 11V to the circuit
for 2 minutes, deliver 14V to the circuit
for 2 minutes, deliver 11V to the circuit
for 2 minutes, deliver 14V to the circuit
...

I have available :

a lab bench capable of supplying the 14V
a micro-controller + relay setup that I can program to switch something on/off every 2 minutes.
a stepdown converter that I can use to bring 14V to 11V.

What would be the easiest / most convenient circuitry be to handle this ?

I was thinking about using the microcontroller to switch a relay on / off very 2 minutes. When the relay is on it would just supply 14V to the circuit. When the relay is off it would somehow "divert" the flow into a stepdown converter that brought down the 14V to 11V.

But I'm not 100% sure if this is correct and if it is how I should draw the circuit.

I was thinking about something like this. When the relay is on it just passes the 14V to the circuit. When the relay is off current goes through the stepdown and brings it down to 11V. Does this make sense ?


texts: Can a LED lights output more light than they are designed to, due to mishandling?

texts:
It happens with incandescent lightbulbs sometimes, that they shine brighter due to a mishap by mishandling, and then end up dying earlier.

Is the same possible with LEDs? Mishandling can cause parts to become loose or otherwise out of place which would cause the LED to shine brighter than intended.


texts:
At first, I must say that my question may be judged as out of topic. If so, I would obliged if advised to which site may I consult.

I have an old VGA monitor which I connected with my laptop. It works fine, but I realized that a current leakage occurs. The cover of the laptop is made by some kind of aluminum, so I touched it and felt some small amount of current passing through my fingers.

I was told that the monitor has a faulty ground, but otherwise it should work fine.

I would like to ask if the laptop or any other device connected to it, is at risk, due to the faulty monitor.

Any thought would be appreciated.


texts:
I am making a medical device that requires to sense very very low intensity blue light. I have attached my circuit design which is a 2-stage amplifier(transimpedance and differential amplifier),  but I still need to increase the total gain of the circuit. Can someone please tell me how should I make modifications to my design to have a much higher gain. Should I add another 2-stage voltage amplifier?

Currently in my circuit (from the diagram), Rf=1Mohm, R2=1Mohm. If I increase these values, my dark voltage increases, which I do not want. It should give zero in dark which I am getting with these values. Photodiode being used is hamamtsu S1133 and opamp being used is TI OPA2381

Thanks.


texts: I am beginner in electronics, I have LED driver (12V 5A) can I use it as power source for DC motors,Small DIY projects,or as SMPS?


texts: Apples to Apples comparison of Lead-Acid to Lithium Ion

texts:
I must admit, I'm an electronics noob. I work in software, and I'm starting to realize that the world of electronics is more complicated than I had anticipated.

In a previous project, my brother built an electric truck using 24 deep-cycle lead-acid batteries. The batteries were similar to this battery, which has the following specs:

6V high capacity Deep Cycle power
230AH at 20 hour rate
Weight of 24 batteries: 696kg

As some of you may have heard, Tesla just announced the Powerwall 2, which has the following specs:

14kWh
Cost per kWh: $393
Comes with an inverter (I have no idea what this is or if it's necessary)
Weight: 110kg

The electric motor for this car conversion has a controller that maxes out at 3000 amps. Normal cruising amps is around 1000.

Including a Powerwall unit might not be practical for use in an automobile, but I'd like to get a better apples-to-apples comparison of one over the other, as it's possible that a similar type of battery might become available for use in cars.

Obviously the Powerwall unit weighs a lot less, but does it provide the same amount of power? And how does it compare in terms of energy storage capacity?


texts:
I'm implementing a PCIe driver, and I'd like to understand at what level the interrupts can be or should be enabled/disabled. I intentionally do not specify OS, as I'm assuming it should be relevant for any platform. By levels I mean the following:

OS specific interrupts handling framework
Interrupts can be disabled or enabled in the PCI/PCIe configuration space registers, e.g. COMMAND register
Interrupts also can be masked at device level, for instance we can configure device not trigger certain interrupts to the host

I understand that whatever interrupt type is being used on PCIe (INTx emulation, MSI or MSI-X), it has to be delivered to the host OS.

So my question is -- do we actually have to enable or disable interrupts on every layer, or it's sufficient only at the closest to hardware, e.g. in relevant PCI registers?


texts: Is there any device for measuring phase and gain of a device in frequency range as low as 0.1 Hz?

texts:
I need to measure phase and gain of a circuit starting from 0.1 Hz to 10 MHz. Most of VNAs are for frequencies of several MHz to GHz. I've just found one VNA for 1 Hz.
Is there a device or method to measure even lower frequencies?


texts:
I built a scaled down model of my idea.  Since current flow was always under 1A, I used a 1N4007 diode to keep the current unidirectional in the circuit.
Now I am planning to build a full size model and I wish to keep the current unidirectional in this model also.  The current flow will be around 50A in the circuit and voltage being 36V.

What diode should I use for this purpose?
Is there some other suitable device for this purpose of mine?


texts: Overlapping clock and data edges in multiple state machine designs

texts:
I have a general question about multiple state machine logic designs.
Think of a system having multiple finite state machines with a single clock and rising edged flip flops. These machines share some of their input and output data. So the outputs of some machines can be the inputs of other machines.

My question is, since all the machines use the same clock and rising edge, wouldn't there be a confusion at the rising edges where also the input data changes?

To explain in figures: This figure below shows a convenient data and clock time diagram.(bottom signal is clock, top signal is input data) There is no change in the input signal at the rising edge of the clock.

But here the input data has a falling edge at the rising edge of the clock. This seems problematic to me:

And the thing is, in a multiple state machine system with single clock every transition of a bit happens at the same time all over the design. So for me, unless I come up with a method the edges of data and clock always overlaps. I want to know if there are methods to avoid this(like shifting the phase of clock for every machine etc.). Or maybe this isn't a problem at all, and I am missing something here? If so I would also want to learn why I'm thinking wrongly.


texts: Why are DIMMs not equipped with a heat sink like a CPU?

texts: I know that a DIMM is composed of a set of chips that contain control logic managing the decode and prefetching memory operations. According to a product specification, I found that newer RAM works at a high clock rate (> 1Ghz) that is comparable to some CPUs. And that's what made me wonder why only the CPU is equipped with a heat sink, and not also the DIMM, besides a certain high clock rate (and thus the amount of heat needing to be cooled).


texts: Is the flatness of DC output of a typical ATX power supply unit worse than a power adapter?

texts: I converted an ATX power supply unit (Seasonic, 330W) into a standalone power adopter (by adding load, etc.), to which I connect multiple things. When I plugin a computer and a monitor each to a 12VDC line, they work fine, but when I also plugin an audio speaker to another 12VDC line, it gives a noise that is at an unusually bad level. If I, instead, just plugin the speaker to an ordinary AC-DC switching power adopter, then, the noise dissapears. I was wondering if the flat level of the DC output of an ATX PSU is that bad. I had though that switching adaptors should be worse than a power transformer (which is used in ATX PSU) with respect to flatness, but the reality seems to be the opposite. Am I wrong?


texts:
Suppose we have a classic RLC circuit, in series and with constant voltage.
Let's suppose that the resistance, the inductance and the capacitance can be affected by a fault.

For which components can I discover the fault using a static (steady) model (analysis) of the circuit?
And for which components do I have to use a dynamic model (analysis) of the circuit to discover the fault?

EDIT:

My deduction are:

If the resistance doesn't work ( short ) it sufficient to check the voltage
 across the capacitor after the transient is ended. If is 0 then the
 resistance is short. The same apply to check if the inductance either
 capacitance are shorted.
In order to know if a fault altered the values of R,L or C i have to check the transient response.

Is it correct ?


texts:
I'm working on my first nixie clock which will be running with Arduino, using a 74141 nixie driver for the cathodes (common for 6 tubes) and multiplexing the anodes.

I am using a MPSA42 NPN transistor with the collector connected to +170VDC, the base driven by the Arduino output, and the emitter connects to the tube's anode. The problem is that the switching with the MPSA42 doesn't seem to work (doesn't turn ON):

I also saw some other design which used both MPSA42 and MPSA92 each of the six anodes like this:

.

What might be the reason why the single MPSA42 configuration would not switch ON?
Why would the other design add the MPSA92 and whats the logic behind using the  MPSA42 + MPSA92 combination?


texts: Activate two devices with a DPDT switch and two relays

texts: I'm working on an automotive project. I have an electric water pump and fan, both of which will be powered through relays. I also have an on-off-on dpdt switch. What I'd like to achieve is activating the pump at both poles and just the fan at the other. This seems doable, but in all my attempts I've only been able to have both on or both off. How do I wire the switch to achieve my goal?


texts:
Wikipedia explains that an electret microphone is composed of an electret material and a FET for pre-amplifying the audio signal:

What I don't understand is how it is working, as the FET must certainly have a high threshold gate voltage compared to the (supposedly) low-voltage emitted by the electret material? Also the FET acting like a switch (?) how is it possible to obtain analog output signal?

Thanks!


texts: What is the purpose of R1, R2 in this ESD protection circuit

texts: What is the purpose of R1 and R2 in this circuit? Is it required? I have seen in documents like https://www.onsemi.com/pub/Collateral/AND8169-D.PDF where no resistors are shown in the example protection circuits.


texts: Is it good practice to parallel relay contacts for increased current capacity?

texts:
Say I have a DPDT relay, like T92S7D12-24. The contacts of this relay are rated for 30A, but there are two sets of contacts. Can I parallel the contacts to get an effective 60A relay? Further, could I parallel two (or more) relays and get even more current capacity?

I see two possible problems.

Current may not be shared equally between sets of contacts and between relays. One set of contacts could take more than their share of the current and overheat.
Switching times may vary between contacts and between relays. When breaking with current through the contacts, the last set of contacts to open may be carrying far more than their recommended current at time of break. This could cause damage.

Are these problems? Are there other problems? If so, can they be quantified and worked around? Or is paralleling contacts and relays always bad design practice?

In my specific application, I'm using these relays as part of precharge for a capacitor bank. They are not expected to switch current. They make once the caps are charged, then hold. They should never open under current flow. Under these specific circumstances, should I still expect problems?


texts: How to provide version numbers to hardware schematics / PCBs?

texts:
I have one hardware design developed for a customer. We are also selling the same for some more customers with small modifications

I would like to know how to provide version numbers for these different customers; is there any standard defined for hardware design versioning?

e.g. In software people do the versions as V 1.0.1; V 1.2.2; V 3.0.0

I would like to is it useful for hardware also? How?

I would like to maintain hardware revision documents in company system database as a reference for others. Idea is, just by looking at version number other engineer can quickly identify differences with respect to revision document.


texts: Bidirectional driving solenoid using H bridge and raspberry pi

texts:
I want to drive a old phone ringer solenoid bidirectionally (20 Hz) using raspberry Pi GPIO pins. I am new to electronics, but I thought a H-bridge design would work to do this:

The solenoid is 500 \$\Omega\$, dont know the inductance. For the transistors I plan to use BC548C's. I will use the GPIO pins to provide the 20Hz signal. My questions are the following:

In equivalent unidirectional circuits I've seen flyback diodes across the solenoid. Do I need to use this? In my case, where I want to drive the solenoid in both directions, a TVS like http://www.fairchildsemi.com/ds/P6/P6KE150A.pdf?
Do I need to use optoisolators or equivalent to protect the RPi?
Did I correctly assume that I need to connect RPi ground to solenoid power ground?
Are pull-down resistors needed, if so what would be a good resistance value? 50k?

And, in general, will this design work or are there better alternatives?

Update:

I've redesigned as suggested with P-channel and N-channel MOSFETs. Also I added 2 NPN transistors type 2N2222 (level translators?), which can switch with 3.3v and work with the RPi.

As I understand it now, when the GPIO's are 0, the pull-up resistors keep the P-channel MOSFETs (Q1,Q2) off and N-channel MOSFETs (Q3,Q4) on. When GPIO 1 is switched to high, the gates of Q1 and Q3 are pulled to ground and therefore Q1 switches on and Q3 off, allowing current to flow from left to right through the solenoid. GPIO1 low and GPIO2 high to invert.

Now, I'm not sure on which MOSFETs to pick. I've spend hours looking through online cataloges and can barely see the forest through the trees anymore. In any case, I found BSS84AKW for P-channel and NX7002AKW for N-channel.

(Please google for data sheet I can't post more than 1 link yet)

Are these the right parts for the job? I've selected them mainly because of the low Vgs threshold voltage, since I work with logic level voltages. Is it then also possible, with these or other MOSFETs, to operate this without the Q5,Q6 transistors, or does that only work if GPIO voltage is equal to drive voltage? (here 3.3V vs 5V)


texts: Trailing edge dimmer to activate relay/contactor

texts:
I would like to take the 240V feed from a trailing edge dimmer that is driving LED lamps and use it also to activate a contactor or relay. This would in turn run a 230V fan.

(Reason: want to have a single dimmer switch controlling bathroom lights, but also have the switch turn the extractor fan on. But don't want to send a dimmed signal to the fan!)

I'm worried that the chopped signal from a trailing edge dimmer may not be what the coil of a relay or contactor needs.

Can anyone shed some light on this, please?

Either, will a relay work just fine on this circuit?
Or are some relays more tolerant of what activates them?

Many thanks!


texts: Why the resistors needs higher Ampers if the Total current is 4 Ampers?

texts:
I have a question about the circuit as shown up. My question is if the total current is 4 Amperes, why do the resistors need a higher current?

Am I missing something? If that so, what it is?


texts: I don't know if the power plug should have + at the inner contact or the outer.


texts:
I'm searching for some kinda of formula that can be used to calculate the Cold Cranking Amps (which seems to be an industry term for a 30 sec discharge pulse current at a specific temperature, 0 degrees F) of a battery. I work in design, what I'm trying to do figure out the required CCA to start an engine and compare it to the CCA of the battery installed. The idea being to make sure the batteries speced aren't oversized.

I came across the equation:

E = V* I* t = V* A-hr

Which makes sense to me intuitively, but doesn't account for the effect of low temperature battery. Any help would be greatly appreciated.

Thanks


texts: Load sharing between 3.3V regulator and LiFePo4 battery

texts:
I am trying to design a supply for a relatively low power (<100mA) device with a LifePo4 (14500 format) battery and a USB input.

Everything is running at 3.3V, and therefore I would like to avoid regulating the battery output.

My idea is to use a CN3058E to charge the battery and a AP2114 to regulate the USB 5V to 3.3V.

I realise from various app. notes and this question that it isn't a good plan to connect the load (VCC for now) directly to the battery because the charge cycle will never end.

The most common solution that I've found is to 'disconnect' the battery output during powered operation using a MOSFET and I have implemented this in the following circuit.

Normally, a Rpull resistor holds the gate close to GND when VUSB is removed and the MOSFET conducts. When VUSB is present, the gate voltage rises and the MOSFET switches off. I am hoping that I can select suitable values for R3 and R4 both for the temperature input and to act as Rpull.

The trouble with these common solutions is that they are for LiPo or Li Ion cells, both of which can be regulated down to 3.3V along with VUSB. However, I can't do this because the LiFePo4 only outputs 3.2V. Therefore, I need to regulate only VUSB, but that means I cannot block the reverse voltage into the regulator when VUSB is not present.

Is it okay to put the diode on the input of the regulator to achieve the same end?

The functional diagram for the regulator looks like it should be okay and I couldn't see anything in the datasheet that would suggest otherwise - however this is all very new to me, and I might be making some catastrophic assumptions!

Note added following the answer from EE_social:

Ricoh have a clear app. note regarding reverse current protection here. In case the link is no longer valid, the essence is summarised in the following diagram:

Advantages of this approach include:

Lower reverse leakage current compared to a schottky diode
More accurate regulation (diode forward volt drop variability)
Lower component count


texts: Understanding to isolating sensor input capacitance

texts:
The circuit given above is pH sensor buffer circuit, picture taken from here. This circuit have pH sensor input and gives an output that can be read by multimeter which is U2's OUT_ pin . U1 is here to add some offset voltage to ground provided by LM4140 IC. This circuit's basic design was discussed in here.

Q1: What R3 (200 ohm) do here? They say its needed to isolate sensor input capacitance (i think capacitance is occurred due to cable's impedance).

Q2: Why only P$GND is connected with serial resistor? Isn't it also necessary do same thing on P$SIG?

Q3: What will be done to out signal if there is no R3 when needed and there is R3 even no needed?


texts: How can I measure low power energy usage of bluetooth device?

texts:
I need to measure the energy usage of a small bluetooth device which is normally operated by a coin cell 3v battery.

Background:
Using an oscilloscope I was able to get fairly good pictures of the energy used during standard connection and advertising events (measuring current through and external 10ohm resistor and integrating), but that is in a steady state condition when not much is going on and the event is easily captured with oscilloscope. More complex interactions happen between the device and the other bluetooth device it is connected to (typically a smart phone) during re-connection events and when characteristics are being read or written.

Questions:
Is it possible to use a simple capacitor to measure energy usage by charging the capacitor initially, then running the device off the capacitor power for a few minutes during the test and then measuring the remaining charge? How accurate would that be?

What other techniques would you recommend?

(edit: note I'm actually interested in mAH usage not energy since ultimately the goal is to estimate battery life and battery is rated for 220mAH)


texts: How do I connect components when using a circuit board with pads but no traces?

texts:
Given a matrix board with soldering pads but no traces, how would you connect adjacent components (including the ends of the jumpers for longer stretches)?

Some possibilities I've come up with:

Solder the individual leads as usual, then bridge the pads with solder.
For each connection wrap one of the leads around the adjacent component's lead before soldering the two pads (ensuring there's more than just solder joining the two components).

I started with the former before I came up with the latter (which seems like at least an improvement), but I'm wondering if there's some even better solution I haven't come up with yet.


texts: Connecting K-Type Thermocouple wires to a data logger with a male and female plug

texts:
I'm trying to setup a temperature data logger using Graphtec GL240. I will be using K-type thermocouples for the logger. I want to run short length of k type cables from the logger to a female K type plug and then create another set of wires with a male plug (I am doing this because it will allow me to swap wires easily).

Will this affect the accuracy of the logger?

Will be using this setup to calibrate an oven.


texts:
For those who like their questions to be 100% practical and serious, please look away now.

I've just watched "Raiders of the Lost Ark", which got me speculating about how to bring the booby-trapped temple into the 20th century. I reckon the first upgrade has to be to provide electricity, but how long can a battery sit on the shelf for and still work?

The longest shelf life battery I can find is a hertz horn these have been used to provide short bursts of power to detonate sea mines. Basically they have a glass phial of acid/electrolyte which when broken open, will cover a set of dis-similar metal plates and produce a small electrical charge. There are occasional stories of these mines being detonated decades after being laid.

Can anyone give me any idea of the likely lifespan of a hertz horn? Are there any batteries with a longer shelf life?

Update - I'm aware that any such battery is a one-time only thing, I was thinking that the battery would be initiated by the heroic explorer/villainous tomb-robber by mechanical means (i.e. treading on the glass phial), the electricity generated would be reserved for powering an entertaining death machine for said hero/villain. To actually detect an intruder electronically would require a power source to continuously work (i.e. remain powered and draw current) for hundreds of years - a different question all together.


texts: What happens if a voltage regulator is driven with input voltage a lot higher than nominal output?

texts:
I am reading the data sheet of the 78xx regulators and they say the maximum input voltage is like 40 V. Seems like it didn't have different maximum values depending on the output voltage, '05, or '12, or '15. But usually the designs show input voltage some amount over the desired output voltage, but not excessively much.
What if, for example, I have 12 DC input supply voltage and I just slam a 7805 regulator in to get 5 V output? Will it then just short 7 V to ground in order to maintain the 5 V under load? E.g., if I want to use the full 1.5 A that they are rated at, does that mean that it "shorts" 1.5 A at 7 V = 10.5 W of power straight to the ground, getting all hot?
Or is that safe and it uses some other way to reduce the voltage without wasting so much energy and not going up in smoke?


texts: How does the ZX80 keyboard avoid ghosting and masking?

texts:
I believe that a keyboard matrix needs a diode on each key to avoid ghosting and masking.

http://pcbheaven.com/wikipages/How_Key_Matrices_Works/

The ZX80 (and probably ZX81) has only a diode for each half-row.

http://searle.hostei.com/grant/zx80/zx80circuitAnnotated.pdf

How does this work?


texts: Truth Table for the Following Multiplexer Circuit


texts: Patient Connection Radiated Emissions problem

texts:
The company I am working for is developing a patient-connected device intended to deliver Functional Electrical Stimulation to a connected user. We are currently struggling to pass the radiated emissions standard.

We have located the source of our problem to our isolated DC/DC power supply by shutting off the isolated power

Enclosure

DCDC enabled

DCDC disabled

We also notice that when we disconnect the external patient leads, our radiated emissions are reduced significantly. The signals that we are sending down the cable are biphasic pulses with the following characteristics

Pulse Width = 500us
Pulse Amplitude = 150V
InterPhase Interval = 100us
Frequency = 60hz

We are in the process of designing a new board with the following features
Get rid of internal patient lead cable in favor of a right angle connector
Y capacitors across the isolation barrier of the DCDC converter
Pi filter and Common mode choke on the input of the DCDC converter
Pi filter at the output of the DCDC converter
LC filters at the patient connector

However I am still concerned that the external patient cables will radiate excess EMI. Since they are patient cables we are limited on the filtering that we can do and we are not able to shield the cables to the enclosure because it is made of plastic. Does anyone have any suggestions for what we can do to make our device more compliant, specifically as it relates to the patient cables?


texts: Difference amplifier with current output error budget

texts:
I stumpled over the following article comparing the following difference amplifier circuits in terms of errors due to input offset voltage and resistor tolerances.

To my understanding the right-most circuits gets away with fewer and possibly also less accurate, hence cheaper resistors. This made me think wether I could adapt the circuit to measure much larger differential voltages such as the the cell voltage in a stack of batteries.

I played around in LtSpice and it seems that it might work, however, I really don't understand the rightmost circuit. Where is the feedback path? What influence does the transistor have? Spice indicates that a PMOS also works, but how and why? Are there device that alreay include the transistor and what are they called?

I found some shunt current devices which seem to implement the rightmost circuit, but those are only specified for small differential voltages. Why is that?


texts:
I am using gprMax to simulate my design. The design is shown in the picture. It consists of an RFID system inside a steel structure. The transmitting antenna is placed in the middle of the container and the receiving antenna (RFID tag) is sandwiched in between a block of plastic and wood (purple box and pink box in the corner respectively). The second picture shows the E and H field at the receiving antenna.

I know that an RFID tag requires about 30 to 100uW of power to turn on. Is there a way that I can use the E and H field at the receiver to somehow convert it to power so I can see if the RFID tag is been turned on?


texts: What are the disadvantages of using a 555 timer as a resistance to frequency converter?

texts: Since we know that a 555 timer configured as an astable multivibrator depends on the resistance the timing capacitor sees, what stops people from using a 555 as an ohmmeter? How does the accuracy compare to using a traditional ADC to sense resistance via a resistive divider and looking at the voltage drop?


texts: Maximizing signal to noise ratio for very small radiation detector

texts:
I have a very small radiation detector that outputs signal of small amplitude. Requires preamplification before going to an actual amplifier. When constructing the system prior to the preamp, would I like to have higher resistance or lower resistance? I know ohms law, and smaller wires have higher resistance thus greater induced voltage from the sensor. The key factor for me is signal to noise ratio.
So in summary small vs. large wires and any other recommendations to keep in mind?


texts: Calculating voltage, current, and impedance values on an old transformer

texts:
I'm working on an old valve amplifier, with the intention of reusing the transformers in a new project. I've used what I know of transformers to calculate the ratio of each winding the corresponding voltages however what I calculate does not agree with what is specified in the schematic so I must be making an error somewhere. The output transformer has one primary and three secondary windings; the measured resistances are as follows:

P = 7.9
S#1 = 28.4
S#2 = 3.60
S#3 = 0.1

Given that the ratio of a transformer can be calculated as:

Vp/Vs = Ip/Is = a

The impedance of either winding can be deducted as:

Zp = (a*Vs)/(Is/A) = (a^2)Zs
Zs = (aVp)/(Ip/A) = (a^2)*Zp

So far, I know the impedance of each winding, but not the turns ratio or voltages however by rearranging the above formulas I can use the impedances to deduct the ratio:

a =  Square Root (Zp/Zs)

Therefore

a(S#1) = 0.53
a(S#2) = 1.48
a(S#3) = 3.36

Using these values of a, we can predict the voltages on the secondary:

V(S#1) = 250/0.53 = 474.01
V(S#2) = 250/1.48 = 168.76
V(S#3) = 250/3.36 = 74.42

However these values are not what is specified by the schematic, which is available here. The schematic specifies 470V, -37V, and 6.3V for the first, second, and third windings respectively and even allowing for a considerable voltage drop during rectification the calculated figures do not match the specified figures for the second and third windings.

Where am I going wrong in this process?

Thanks.


texts: Simple notification raised over power lines between 2 devices

texts:
What is the simplest way in which a device A can notify another device B, both hooked up to AC power lines in a home, a few feet apart but separated by a wall, in a circuit having other low-power consumers that must not be disturbed (granted though that no consumer stands between A and B).

Detailed scenario:
Before devices [A] and [B] came into the equation, the manual switch [SW] used to directly control (On/Off) device [D] (max 200W). [B] is actually a WiFi based relay (a SSR commanded by an ESP8266 module, to be precise) that I introduced for certain needs and I can also extend (both code and additional components if required).

What I need is to further use [SW] to toggle [D]'s on/off state. How this will exactly happen in [B]'s logic is not part of the question, I am rather looking for a way to get [B] notified whenever [SW] is used. I assumed a new device [A] might be necessary (but I might be wrong as well) in order to send some sort of sign over the mains.

Please consider that I don't need to send meaningful data, just a notification sign. If possible, avoid frequency modulation or other heavy processing and don't require [A] to use a microcontroller. Size should be enough to fit in a wall box, design cost should also be kept at a minimum.

Thank you!


texts: SPI clock signal (SCLK) usage in FPGA SPI slave

texts:
I need to design an SPI slave peripheral inside an FPGA that shall be used to communicate with a Microcontroller and configure the behaviour of the FPGA design. I have a few questions.

If the FPGA clock frequency is significantly higher than the input SCLK frequency, it is possible to sample the SCLK and detect the rising and falling edges. The design can use this information to shift or latch data. But,
(a) What if the SCLK input clock is almost of same order as the FPGA system clock? Does the clock signal connect directly into the FPGA registers? (b) If not then what is the alternative?

If (a) above is true then how do we write the timing constraints?

The SCLK does not need to use global clock routing. Does this mean that any FPGA pin can be used for it?


texts: Are Dual Bus Transceiver or Analog Switch best practice to manually switch between SPI devices?

texts:
I have two different use cases for 4 lines (this could be an SPI bus or other digital signals). The goal is to manually switch all four lines between the two different use cases with just a single switch or jumper. That can be done when the device is off.
Initially I had a DIP switch for each line, but I was wondering if one or both of the following solutions would work as well? If they do, which one should be preferred for which use case? Is there an alternative I am not seeing?
Note: Since the four lines are not necessarily SPI, I can't use CS, but I am using SPI for the schematics below. Also, should it be relevant: The signal at J1 arrives through a twisted pair cable…
Variant 1 (Analog Switch eg MAX4784):

Variant 2 (Dual Bus transceiver, eg SN74AVC4T774)


texts: Transistor for 38kHz IR pulse amplification

texts:
I am trying to build a timer circuit in which I will send a modulated 38kHz (almost) signal to an IR Receiver (TSOP38238 in Arduino Nano) and I want to amplify the square wave to the IR Led to maximize the range of my circuit.

I use 2 555 NE555P timers in order to achieve this. The first timer produces a 1kHz, 50.25% duty pulse, and its output is connected to the reset pin of the 2nd 555 timer which generates a 38kHz (almost) square wave (50.25% duty with R1 = 1K and R2 = 100K and C = 0.2nF). The point of the first 555 timers with the modulation pulse is because in the future I want to use more of these "transmitters" with different modulations in order to measure the length of the pulse and understand which transmitter sent the pulse.

My question is that if I want to use a BJT in the output pin of the 2nd timer to drive my IR LED what should I be careful about in order to amplify my pulse without any disturbances? Does all BJTs do for this job or there are some characteristics that I should watch out?


texts: I am confused with problem 12.3. I have attached the solution and my attempt. I am confused why we are getting factor of 2, can anyone please help me ?


texts: Discrepancy on the ADC input impedance in the ATtiny datasheet 1..100k or 100M?

texts:
I found a discrepancy in the ATtiny datasheet. While the section explaining the ADC shows a simplified schematic with a 1...100 kOhm series resistor, the characteristics table shows 100 MOhm.

  Figure 17-8. Analog Input Circuitry

  The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less. [...]

With that max. 100 kOhm series resistance in the sample/hold path it makes sense to me, that they say that the source impedance should be about 10 kOhm. But with the 100 MOhm impedance from the characteristics table I'd say requiring 10 kOhm source impedance is unnecessarily high.

  Table 21-8. ADC Characteristics, Single Ended Channels. T A = -40°C to +85°C
  ...
  Table 21-9. ADC Characteristics, Differential Channels (Unipolar Mode). T A = -40°C to +85°C
  ...
  Table 21-10. ADC Characteristics, Differential Channels (Bipolar Mode). T A = -40°C to +85°C
  ...

What is the reason for that discrepancy? Or can I assume the 100 MOhm is a wrong value and should actually be 100 kOhm typical?


texts: Can any one explain the working of the certain part of the given circuit?

texts:
its a circuit describing f to v converter

what happens when the switch is closed by the monostable multivibrator ie( one-shot) ,drawing out 1mA current from the summing junction.

Text in book

on each negative spike of V1 ,CMp triggers the one shot ,closing SW and pulling 1mA out of C1 for a duration Th.In response to this train of current pulses ,Vo builds up until the current pulled out of the summing junction of OA in 1-mA packets is exactly counterbalanced by that injected by vo via R continuously .
can somebody help me to understand this bold text


texts: PCI USB controller cards. Same but different(cheap electronics)?

texts:
I recently needed to order few more PCI USB controller cards and I had a few laying around already(I need to connect many USB cameras).
What surprised me is the difference in design and more importantly missing capacitors on the cards that I recently purchased(Asonic). They are from different manufacturers so different design is to be expected. But what I see is clearly a much poorer product, those recent cards. The price was the same.

Here are some pictures:

Delock:

Asonic:

So my questions are, what can I expect performance wise?

What's the purpose of those capacitors?


texts:
I'm using a drv8838 to run a small dc motor (<1A). For current sensing I set up a INA199 (see layout). I'm also using a RC lowpass with a cut off frequency of around 70Hz to filter the shunt voltage .

In generel the measurement look alright, but when you stall the motor and let it run again, there are some strange spikes in the measurement.

What I already tried:

different capacitor types for the lowpass
different capcitor values (3.3 to 330uF) for the lowpass
different shunt
small cap between out1 and out2
big cap between gnd and V+
PWM frequency changed in the range of 10kHz to 200kHz
checked pwm singal from uC

The adc samples with 125kHz.

With a different dc motor the spikes are smaller, but still there and with a higher C for the lowpass the spikes become smaller, so they are defently there.

Has anyone a idea what is causing these spikes?

thanks for your help!

Update:

I've soldered 10Ohm in the Motor line (gnd line for the chosen rotation direction) and was able to catch the spikes with my scope. I would like too add more pictures, but I'm not allowed to. For me that means the frequency is defently too high to be caused by commutation and the INA199 amplifier works just fine.
But I have still no idea what is causing this.


texts: Big capacitor near input power connector

texts: I observed that every brushless motor controller has a big capacitor in the design. (1000uF to 3300uF). How is this value choosen and what happens if I eliminate the capacitor in my design ?


texts: How does this YouTube video's author identify pins with multimeter?

texts:
I was watching this video on JTAG. It is mostly too difficult for me to follow, and I will likely learn more about UART first before returning to this.
At around 13:00 he uses a multi-meter to discover VCC, GND, and which pin does what. I was wondering if someone could explain to me what exactly he is doing?
My intention is to repair an old television with a broken panel (on/off, channel up, channel down, volume up, volume down) where I want to discover which pin does what. I think it will be a fun project to wire up some buttons to an Arduino, and send the correct signal to the correct pin.


texts:
I have a data logger with a USB output (FTDI FT232RL) and I'm trying to get the information remotely using a XBee modem, but my problem is that I need to "convert" the USB signal back to serial to communicate with the XBee. I know that sounds a little strange, but I can't bypass the FTDI due to warranty.

I've found this two solutions but it's not an option because the data logger is configured to run at 921600bps and these run at 115k and 400k max.

USB Host Board - FTDI Serial Driver
Driver-free USB to asynchronous serial UART interface

Do you guys have any suggestion on what can I do to get this working?


texts: How do I connect my mbed NXP LPC1768 to my computer. I have a USB cable and a breadboard. What else do I need? What connections do I need to make?


texts:
I have an ATMega32u4.

My question is about the bootloader section. How does this device pretend to be a com port while connected to USB? What makes the computer think it is a com port and how can I implement this myself?

When I connect my device to a PC, it shows up as a keyboard on a Windows machine that is connected to COM5 while the physical layer of it happens via USB.
I have a simple blink program flashed on to it, so where does this "keyboard" device come from?
I went to Arduino IDE and compiled a simple uart sketch that loops and sends a string via UART which is again not a real UART but physicaly it happens over USB.

Could someone explain this to me? I can't get my head around it.


texts:
I ran into a problem with one of my hobby projects and at this point I need some help. I'm attempting to sniff the signals going into a 7 segment display and use them for a purpose.

The display is a 4 digit (plus a few extra signs) 7 segment display. There are 13 pins connecting it to an IC but it's (the IC's) model cannot be determined. I've hooked up a logic analyser to it and this is what I've got:

sorry about the quality I needed to do some image editing to fit all channels on one picture

The part between the first two vertical lines is when the display has all digits illuminated during "boot". The part between the second and third lines is where it is displaying 0.0 plus kgs. When the scale (yep, it's a digital scale) is off all pins are set to high.
This is all the sense I've managed to make of it:

The first 4 lines are control, and their pattern appears to be unchanging regardless of what the display output is.
The other 9 pins appear to control the digits somehow.
Each "bit" is 4.2ms long and one period lasts 37ms
There is some visible noise in the measurement, those flickers are 20-40us long (LA resolution) and I believe the pins are supposed to be low when they occour.

I'm at a loss as how to interpret this logic at the moment and any help is appreciated. For all it's worth, here is the order the first 4 pins turn on and off:

1101
1110
1000
0100
0010
0001
0111
1011


texts:
I'm going to solder a small pcb with reflow process and I'd like to use a stencil for that because the components are too tiny for hand soldering iron.
The pcb has a QFN32 (0.5mm pitch and exposed pad), and some passive components, most of them 0402 and few 0603.
I haven't done this before and I wonder if there's some specific solder paste intended for stencil use.

This is the board.
https://github.com/jgabcgr/cc1310

Thanks in advance!


texts: Problem at audio output pin with electret microphone

texts:
So currently I am attempting to pick up audio signals in an arduino via the analog input pins and an electret microphone circuit.

The device I am using for audio capturing is the sparkfun sound detector [It wouldnt allow me to post more than 2 links and the pictures I've uploaded after the edits are more important so I apologize for taking the link for this item out]

I have ordered pins to solder onto this board, but at the moment, I have it wired up as shown in the attached picture (which may be the issue?)

The problem is, the audio output from the sound-detector board gives me a constant value on the arduino, whether there is sound coming into the microphone or not. The only time the value changes is when I unplug the sound-detector board from the power source, at which point I get values of 0.

The envelope detector output, however, works correctly. In a quiet environment, I get very low voltage values, and when speaking into the microphone, I get varying voltage values depending on how loudly I am speaking into the microphone.

However, for my application, I need raw audio-data and not the audio signal envelope.

Does anyone know what the issue could be, the code is very simply and shown below.

float i;
void setup()
{
  Serial.begin(9600);
}

void loop() {
  // send the value of analog input 0:
  Serial.println(analogRead(A0));
  // wait a bit for the analog-to-digital converter
  // to stabilize after the last reading:
}

3/16 EDIT: Sampling Rate Code

So some people were mentioning how I am only achieving a sampling rate of around 150 hz or 500 hz using the analogread function (Unless I misunderstood)

Below is some code I am using to measure the amount of time that passes between an analogread sample;

// Arrays to save our results in
unsigned long start_times[100];
unsigned long stop_times[100];
unsigned long values[100];

// Setup the serial port and pin 2
void setup() {
  Serial.begin(9600);
}

void loop() {
  unsigned int i;

  // capture the values to memory
  for(i=0;i<100;i++) {
    start_times[i] = micros();
    values[i] = analogRead(A0);
    stop_times[i] = micros();
  }

  // print out the results
  Serial.println("\n\n--- Results ---");
  for(i=0;i<100;i++) {
    Serial.print(values[i]);
    Serial.print(" elapse = ");
    Serial.print(stop_times[i] - start_times[i]);
    Serial.print(" us\n");
  }
  delay(6000);

the print-out results of the above code shows an average time of about 116 micro-seconds;

1/116-uS is around 8.6kHz, am I misunderstanding something here? I understand that the Serial.print command in the first block of code is slowing the sampling down significantly, if that is what users here were initially trying to convey; However, if I sample and store the analog-input values in an array and plot them at some later point, without using any serial command, the audio output should be relatively well via the sound-detector and that plotted signal should resemble a fairly decent audio-signal, correct?

8.6kHz is what I was aiming to achieve as far as sampling rate goes, will the audio output really be this distorted?

3/17 EDIT: Audio-Output MATLAB Plot

Well, here is a quick Matlab plot I made of the audio signal (I simply took 1000 sampled values and plotted them against a time vector)

This is actually looking pretty decent, maybe the non-soldered wires are a big issue

If i'm missing anything else that might be effecting this i'm sure someone here will catch it.


texts: Circuit with a single buzzer but multiple L.E.D and switches

texts:
I need to design a circuit that has three LEDs, each LED has its own push button switch, but there is only one common buzzer.

Goal: when a push button is pressed its corresponding LED should glow along with the buzzer sound.

Design the circuit with single battery source.
Design the circuit with two battery sources such that when a push button is pressed LED should glow from one battery source and buzzer should sound from other battery source.

Please help me with either of the above two circuit diagrams.


texts:
I can't find a tolerance measurement for the 62 mils thickness specified in the PCIe electromechanical spec. How much leeway do I have for board thickness in an add-in card.

Additional details: I'm trying to build a composite video (75 ohm single ended) PCIe add in card. For a 4 layer board, my fab house doesn't have a standard size core that would bring the stack up to exactly 62 mils.


texts: Microcontroller with more than one serial port

texts:
I have a microcontoller from ATMEL AT89S52, that has only one serial port. However, in my application the microcontroller is to be interfaced with a RFID reader and also with a WiFi board through serial port. Since I have only one serial port and the RFID reader and WIFI need to be there simultaneously, I am not able to proceed. Is there any possibility to emulate serial ports using software? If yes , how?

Or can anyone suggest me a better way to achieve this goal(except buying another controller with multiple serial port)?


texts: DIY 2.4 ghz antenna for Bluetooth Speaker too cut or not to cut

texts:
I just built a Bluetooth speaker using a Sure Electronics AA-AB41136 Bluetooth 4.0 Audio Receiver Board. The reception was not great since it is a PCB antenna contained in my speaker box which is made out of 1/2" thick plywood. It seems a lot of people are extending these antennas using RG-58 wire and I just happened to have some laying around. From what I read the length of the antenna can be from 28.8mm to 32mm for a 1/4 wavelength on the 2.4 GHz spectrum. The length of the antenna would start after the shielded portion of the RG-58 ends.

I cut the trace on the PCB antenna leaving about 5mm and attaching about a 4mm length of the bare wire to it. I then fed the shielded portion up to the inside top of the speaker and cut back the shielded portion and fed 43.7mm (31mm plus the 1/2" going through the wood) out the top.

After that long winded explanation my question is actually quite simple. Using 31mm as the antenna length does the 1/2" and/or 5mm on the trace end need to be factored in to the equation? Should I cut my existing 43.7mm down or not so the total unshielded portion going through the wood and out the top would be 31mm? Or if I must included the 5mm on the PCB end would it be 26mm through the wood and out the top? Or some other variation of something I am missing?


texts: Simple circuit to light a LED only if I have a square wave

texts:
I have a simple circuit with a transistor that accepts an input 3.3V square wave (50Hz) and amplifies it to a 20V output inverted square wave.
I'd like to have a LED that lights up if the square wave is active and goes off if no input signal.
If I just put a LED on the output it doesn't work, it lights up when no signal and it lights slightly dimmed when the square wave is active.
Is it possible to achieve this in a simple way?
EDIT:
The circuit power supply is 24V, the input square wave is 3.3V


texts: Determine small gauge wire (I think) from mm measurement

texts:
Below is a question I thought would be helpful to figure out a certain gauge of wire.

Physically determine unknown wire's gauge

My wire is .27 mm per strand in diameter, and has 10 strands.  I measured a strand with a digital caliper.  The insulation is black, but I doubt that'll help.  I couldn't find the exact measurement in the chart from the question/answer above.


texts: Measure signals without connecting the grounds.

texts:
I have a board(BoardA) with a MCU which are powered from a battery.
the board also has a buffer circuit for the ADC.

I would like to measure a signal from an other board(BoardB) which is powered from an plug. One possible solution is to connect the two grounds and measure the signal.

Let say because of some reason I am not able to connect the two grounds. How can I achieve accurate measurement?
If first I measure the ground on the BoardB, so In this case I can have the potential difference between the grounds on the BoardB and BoardA, the I can measure the signal on the BoardB.

Can I achieve accurate measurement with this solution? What can be the disadvantages?


texts: Voltage drop regulator 12 V to 5 V, voltage reference with zener diodes

texts: I try to build a low voltage drop regulator to bring the voltage down from 12 V to 5 V (ignore everything right of the capacitor C3). I have a 12 V voltage supply and I want to feed my OpAmp with a voltage below 5 V. To do this I put 3 bzx84c3v3 zener diodes in series (U3, U4, U5), everyone of them has a breakdown voltage of 3.3 V. So theoretically, the voltage should drop from 12 V to 2.1 V, but it drops to only 5.56 V. Putting more zener diodes doesn't really help. Does any one have an idea why the voltage doesn't drop accordingly to the breakdown voltage?


texts: What happen if a wire is connected in parallel to a capacitor?

texts:
simulate this circuit – Schematic created using CircuitLab

Does this have the same effect as shorting out a resistor. With a resistor, it makes sense, because in parallel, current wants to flow through the branch that has the less resistance. But I am not too sure about how much resistance a capacitor has? Or if it has one at all.


texts: Peak Period Forecasting in electric grid

texts:
I am currently working on the day ahead load forecasting using a regression model over a microgrid level.

I wanted to know is there a way I can detect peak period i.e period where demand is high from our forecasted demand.

I am thinking of taking the mean of consumption if at any time demand is greater than mean mark it as peak otherwise it is off-peak.


texts: connecting the negative positive terminals of two dc to dc converter

texts: I require two voltages for my device  22 and -20 is it possible to use two dc to dc converter to generate the two voltage and connect the negative and positive output terminals, and that will be my reference ground. is it ok or is it bad idea


texts: How to make battery balance charger for two 18650 batteries?

texts: I am on a collage project, it requiring two 18650 li ion batteries. boost converter and solenoid lock mechanism requires can't operated through a single battery, and there is no balance charging module I found online, so how is it possible to charge them with tp4056 charging module? Or is there any other circuit/module or circuit diagram available to do that?, Thank you in advance with honours


texts:
I would like to make RS232c cross cable for used Nikon DP-303.
I try to make two cable ( see in my picture ).

Cable A --> try to get data from RS232c --> data show  ????????? g ?????? m ?????

Cable B --> try to get data from RS232c --> nothing show

I very confused my cable is correct or not? (pin 20)

please advice to me

Thank you all


texts: Which test lead for HP 53131a frequency counter?

texts:
I want to analyze the frequency (and drift) for simple LC resonant, hartley and colpitts oscillator, and VFO circuits under 30MHz in general, built from discrete components. I’ve just acquired a HP 53131a frequency counter but it has no test probe and I’m wondering which probe would be appropriate to measure these tuned circuits without disturbing them. My counter’s manual describes the following frequency range:

dc coupled -----> dc to 225 MHz
ac coupled -----> 1 MHz to 225 MHz (50\$\Omega\$) or 30 Hz to 225 MHz (1 M\$\Omega\$)

Would a 10:1 probe with 10 M\$\Omega\$ input resistance be best?

Confused about this... thanks.


texts:
Short Version:
I've wired up an ATMEGA328 chip standalone, after programming with arduino. By itself, the chip is not functioning properly, but when the arduino (with exact same chip) is wired in, it functions fine. So, there must be something incorrect in my wiring. Schematic is below.

Long Version:
I am working on a rather ambitious project, and animatronic tail for a costume. The physical construction of it is 3d printed parts, hardware, paperclips, and brake cables. The tail's controls are from a 5-button board, and the brains are an ATMEGA328P from an Arduino UNO.

Here's a video of it's basic motion when using arduino and breadboard.
https://www.youtube.com/watch?v=39v8euC7XNs

Now, since that video, I have made a separate board for my buttons which can be held in the hand. When connecting my servos to their own power and wiring in the button board to the arduino, the tail still functions perfectly.

The next step was to use the ATMEGA on its own. The schematic below is for a circuit board containing the ATMEGA. The servos, buttons, and battery will plug into it. The servos tie directly to the 6v battery, and I'm using a pair of resistors as a voltage regulator[EDIT: voltage DIVIDER. mis-type] to provide 5v to the ATMEGA. (Thats a 0.1uF capacitor between AREF and GND to help it run better) Since the chip is out of the arduino, I've wired in a 16MHz crystal with 22pF capacitors, and a 10k pull-up resistor from pin1 to +5v (this is the only thing not in the schematic).

.
.

After this standalone failed to work, I went back and connected to arduino, worked fine. moved back to standalone, and it did not function. I've quadruple checked over the button board, it is connecting as it should, and no shorts anywhere.
Power is flowing where it should be... so everything SHOULD function. However, only one button will sporadically do what it should, the rest make their servo motor twitch, but that's it.

Im going crazy trying to discern whats happening, and want to make sure I'm not missing a stupid mistake here.


texts:
I have been trying to make a tricopter on a budget.The first line of thought is to use a brushless motor from a HDD. I got one. I also have a 12A ESC, from a airplane, whcih has been lying around, a lipoly battery, and a TX-RX.

I wired up the motor after measuring the resistances if the leads, and found out the three phases and the center tap. I ignored the center tap, and then, wired up the three phases to my ESC, my ESC to the reciever and powered it up. Here are the observations.

1) It takes about 20% throttle to get the slightest of movement on the motor.
2)Once it starts to move, the movement is jerky. Increasing the throttle to 50% makes the motor oscillations faster, but never has the motor run a full turn, lest spin.
3) After some more throttle, the motor wont move.
4)ESC got a little warm, so i shut down the entire thing.

Most of the forums online suggest that the wires could be a problem, and i have checked and rechecked all connections.

Any tips?


texts: measuring the BER for various input data rate over a custom made channel

texts:
I have a wireless channel, for which I need to pass binary bits and input and measure the BER at the output.

The problem for me here is varying the data rate at the input.

How can I represent the signal data rate at the input ?
I would like to measure the data rate for say 1bps, 10bps,100bps. But I am not sure how to do that.

All I need is help in representing or making or pushing the data bits into the channel interms of bit rate.

Here is the code that I am trying:

N=10000; % Number of bits , size of transmitted signal x_inp=[x_1 x_2 ... x_N]
x_inp= rand(1,N)<0.5;  % binary signal 0 or 1 % message to be transmitted
Tb=0.0001; % bit period (second)

% ********************* Represent input signal as digital signal ****
x_bit=[];
nb=N; % bbit/bit
for n=1:1:N   %
    if x_inp(n)==1;  %
       x_bitt=ones(1,nb);
    else x_inp(n)==0;
        x_bitt=zeros(1,nb);
    end
     x_bit=[x_bit x_bitt];
end

t1=Tb/nb:Tb/nb:nb*N*(Tb/nb); % time of the signal
f1 = figure(1);
set(f1,'color',[1 1 1]);
subplot(3,1,1);
plot(t1,x_bit,'lineWidth',2);grid on;
axis([ 0 Tb*N -0.5 1.5]);
ylabel('Tmplitude(volt)');
xlabel(' Time(sec)');
title('Input signal as digital signal');

% ********************* Define BFSK Modulation ****************************
Ac=5;  % Amplitude of carrier signal
fc1= 1.5*10^6; % carrier frequency for bit 1
fc2= 2.5*10^6; % carrier frequency for bit 0
t2=Tb/nb:Tb/nb:Tb;
t2L=length(t2);
x_mod=[];
for (i=1:1:N)
    if (x_inp(i)==1)
        x_mod0=Ac*cos(2*pi*fc1*t2);%modulation signal with carrier signal 1
    else
        x_mod0=Ac*cos(2*pi*fc2*t2);%modulation signal with carrier signal 2
    end
    x_mod=[x_mod x_mod0];
end
t3=Tb/nb:Tb/nb:Tb*N;
subplot(3,1,2);
plot(t3,x_mod);
xlabel('Time(sec)');
ylabel('Amplitude(volt)');
title('Signal of  BASK modulation ');

% ********************* Transmitted signal x ******************************
x=x_mod;

Next this signal will be fed into the channel but I want to pass have a control over the data rate or the bit rate. Any suggestions ?


texts: LPC43xx External Static Memory - Multiplexing of Address/Data lines

texts:
We would like to tightly-couple a FPGA with a µC by means of the external static memory memory controller, thereby effectively mapping the FPGA registers into main memory of the µC with maximum bandwidth. Possible candidates (amongst others?!) are the STM32F4xx and LPC43xx series, both with a 8/16/32-bit parallel External Static Memory Controller.

Of course these parallel interfaces require a lot of IOs (mostly address and data lines) and we are grateful for every pin we can spare.

The STM32 FSMC peripheral provides the ability to multiplex between address and data lines, which saves a lot of pins at the cost of only a single cycle. As far as I can tell, this ability is not mentioned in the LPC43xx datasheet/manual.

Am I missing something in the LPC43xx datasheet, or is this feature really only available in the STM32F4xx family?


texts: Voltage oscillates continously in USB Li-ion charger. Anomaly or CC/CV behavior?

texts:
I have purchased two USB boards for charging Li-ion batteries and it should have a CC/CV charging regime. So I connected the board to a 5V USB source (computer first then solar panel) and the voltage at the output of the board reads values that oscillate around 3.5V. It is the same for both boards. The problem is that I am afraid to connect the battery when I have such an oscillation.

I was wondering if I am overreacting or is this a normal behavior for the voltage to vary in order to give a first CC regime? I only tested it with the multimeter and not on the battery itself. Maybe the Voltage would stabilize with a load, but I won't take the risk yet.

Can anyone help me to understand this and do the right safe thing?

Here is the USB charger with the voltage reading behind.


texts: enable step up converter based on low voltage

texts:
I recently built step up converter which work quite good.
Now I would like to build a circuit which would enable this step up converter when battery voltage drops below 1.8V (Arduino BOD).

I need to keep in mind power consumption because of battery power

Now, I do not know what is the best method to do that.

I guess that couple of transistors would do the job but I do not know where to start.
Also I dont know if it is optimal solution bacouse of battery power.

  The EN pin is a logic-level input used to enable or disable device switching and lower quiescent current while disabled. A logic high (>70%of VIN) will enable the regulator output. A logic low (<20% of VIN) will ensure that the regulator is disabled.

So if I understand it correctly, I need "circuit" that will "bring" VIN on EN pin when VIN < 1.8 V.

Please give me some direction to start with this.
Thank you.

EDIT 2017-03-07 I went search in direction mentioned in comments and found this video. Which I guess is good start.

p.s. Iam using MCP1625 which has enable pin.


texts: Slowly ramp up the PWM duty cycle with a 555

texts:
I have a PWM signal being generated by a 555 timer and that is fed into a ESC for an electric skateboard.

My problem is that the PWM signal duty cycle can go from 5% to 95% in a fraction of a second.

I need a way to slowly increase the duty cycle but I don't want to used any sort of microcontrolers (arduino, pic,  fpga). I want to be able to turn the throttle to max and have the the speed slow increase.


texts: Choosing a Tantalum based on Min. ESR - LDO Stability

texts:
How does one go about choosing a capacitor for a LDO regulator which specifies a min. ESR? Capacitor datasheets that I've seen only contain the Max. ESR parameter. One could just choose a cap with a sufficiently high ESR and hope it never goes below the stability margin but that feels like cheating - besides, a unnecessarily high ESR would add ripple.

I know that nowadays LDOs exist that are stable with ceramic caps as they add their own 'zero' for stability but it would like to know how to work LDO's that don't do this.


texts: Cheapest / easiest way to get started with AVR programming

texts:
What's the cheapest / easiest way to get started with AVR programming? I have downloaded a copy of AVR Studio 5, and like the IDE as it is based on Visual Studio, which I'm familiar with.

How do I get from here, to having a working project on something like an AVR Tiny chip?

I don't want to do anything fancy - first project is to do a kind of timer chip that lights some LEDs and then uses a solenoid to ring a bell. As such I don't think I need all the "fancy stuff" like touchscreens / LCD displays etc. Also, i don't know how I'm going to get on, so don't want to invest too much in case I don't get on with it.


texts: Do these circuits work the same way? (capacitors)

texts:
I have a question about are this two circuits the same? I mean, will the capacitors act in the same way on both?
I'm asking this because I'm looking to the first picture and I think that the things that I connect will ignore the capacitor, is that right?


texts:
We are organizing a game for students where we are transmitting the daily objectives and hints over from an FM transmitter. Is there a way to limit basic radios to only be able to pick up a certain signal? For instance, 88.3 is not taken in our city, so would have the least amount of interference. We would like to limit it so that the student will dial through the stations (that will all be blocked) until they find the station that actually is broadcasting from a short distance away.

I hope that makes sense :)


texts: Increasing the range of an IR based detector

texts:
I am working on a IR based object detector. I understand the basics of how it functions, i.e., 38kHz pulse through an IR LED and read the output pin of the IR sensor.

The problem is that the range upto which I can detect objects is only around 5-10 cms depending of the surface of the object.

I am using a CC2538SF53 micro controller to generate the pulses for the LED. The LED is a Vishay TSAL6100 10 deg 40mW LED. The reciever is a TSOP38238.

Initially I was using the LED directly from the micro controller pins. But the range was even less for that. Now I have connected the LED via a transistor to boost the output and am getting the 5-10 cm range I mentioned above.

Any ideas or help as to how I can boost the range.


texts: Many of the textbooks I have read analyze noise signals. We have a circuit and find the output noise RMS voltage. But there is always the "extra" step of finding the input-referred noise. Why do we need to find the input-referred noise? How does it help us any more than the output noise RMS voltage?


texts:
I am trying to communicate with PIC32 UART. I am able to transmit any data but getting problem in reading the data. In PIC32 there's a function putsUART2("") which can transmit any data and there's function getsUART1(5, myBuffer, 123);. Parameter's for this function are:

1)length: This is the length of the string to be received
2)buffer: This is the pointer to the location where the data
          received have to be stored.
3)uart_data_wait: This is the time-out count for which the module
                  has to wait before return.  If the time-out count is ‘N’,
                  the actual time out would be about (19 * N – 1) instruction cycles.

Now what I am doing in my code is

if((U2STAbits.URXDA)!=0)  //if data received,then
{
    getsUART2(5,RxBuffer , 123); //storing the data in RxBuffer
    putsUART2(">>Data Received\r\n");
    U2STAbits.URXDA = 0;
    U2STAbits.OERR = 0;
    putsUART2(RxBuffer); //transmitting the data back to the terminal
}

Now when I type 'A', >>Data Received is printed on the terminal and I am getting back data in terminal. but as the size of the RxBuffer is 5, it only stores one character. Can anyone help me with this, I really want to type a string and get back it on terminal.

Please help, thanks.


texts: Is there a way to find the transfer function from only your input and the steady state response?

texts:
I know that a transfer function has the general form of $$ G(S) = Y(S)/U(S) $$ where \$Y(S)\$ is the output and \$U(S)\$ is the input.

However, if given the output \$u(t)\$ and the steady state response \$y_{ss}(t)\$, is is still possible to obtain your transfer function?


texts: How to simulate constant current - constant voltage source in LTspice

texts:
I am trying to build the CCCV (voltage limited current source in LTspice, having following characteristics:

Sources defined current until voltage at the terminals reaches defined voltage, then keep that voltage at the terminals
Disconnect the source after keeping it at constant voltage for predefined amount of time (e.g. "charge with 100 mA to 3.6 V, then continue holding 3.6 V for 30 minutes")

I managed to resolve (1). Circuit bellow combines ideal current source, defined to source 200 mA for 110 s, with ideal diode having forward voltage set to the desired voltage limit (in this case 2.7 V):

When the source reach the voltage limit, excessive current will flow through the diode, passing just the current needed to maintain the voltage to the rest of the circuit, as shown in circuit response:

I don't know how to resolve requirement (2), i.e. how to modify current source to after reaching the voltage limit continue to supply current for e.g. 30 seconds and then switch off.
I was thinking of using comparator that triggers a timer, which after the time elapses turns off the switch in series with the source, but it seems too complicated. I would prefer a solution that use SPICE command to record time when the voltage is reached and use it to turn the source off after additional interval passes.


texts:
I am trying to send my name (Ziga) through my micro-controller UART periphery to my PC. GND, Tx, Rx lines from micro-controller are directly connected to the UART-USB converter CP2102 which is pluged into my PC.

My PC is running Linux OS and I am using application minicom to check for transferred information. During Transmission my minicom terminal prints some weird symbols (click to zoom in):

and if I enable "HEX display" option I get these values (click to zoom in):

The values are 0x5C = 92 which is \ in ASCII then 0xFC = 252 which hasn't got any sign in old ASCII so it becomes ?, then there is 0x40 = 64 equal to @ in ASCII and finally 0x81 = 129 which again isn't defined in old ASCII so it becomes ?.

while I am getting correct image on my osciloscope (click to zoom in):

Why don't I get ZigaZigaZigaZiga... in minicom console? Values for single letters are correct acording to ASCII table.

ADD 1:

I took an oscilloscope image of letter a from Ziga. I hope this can help to determine if micro-controller baudrate is correct.

ADD 2:

I tried using 2 stop bits on minicom as well as on micro-controller and I get a different result which is even worse - it only transfers 3 characters instead of four (Ziga has four). Take a look:

ADD 3:

I found this info about external oscilators. Does this mean PCLK clock mentioned in micro-controller user manual is 12Mhz?

ADD 4:

So we figured out that it must be a baudrate problem, so I started reading user manual and found out on page 21 that my PCLK = 3MHz by default. Then I chose an algorithm on page 509 to calculate values:

DLL = 0
DLM = 13

DIVADDVAL = 1
MULVAL = 2

These values should give me 9600 baudrate according to the equation (4) on page 508. Well it gives 9615.384615 which should be 0.16% accurate. So then I started programming and I set the values above like this:

DLL &= ~(0xFF);                //setting first byte to 0  (divisor latch least signifficant byte)
DLL |= 13;                     //setting first byte to 13 (divisor latch least signifficant byte)
DLM &= ~(0xFF);                //setting first byte to 0 (divisor latch most signifficant byte) -- not really needed
DLM |= 0;                      //setting first byte to 0 (divisor latch least signifficant byte) -- not really needed
FDR |= (1<<5); FDR &= ~(1<<4); //setting value MULVAL
FDR |= 0x1;                    //setting value DIVADDVAL

But still I don't get right baudrate...


texts: LED lamps keep glowing when dimmer is turned off

texts:
For starters, I am not electrically capable, so bear with me.  But, I did read similar questions that did not address, as far as I could tell, what I see happening (they may have, but I was too illiterate to understand).

I hired an electrician to replace an existing chandelier (19 years old, including dimmer switch is 19 years old).  I bought 6 expensive ($10 each) Energetic LED soft white 3000K bulbs.  These are marked 'Dimmable'.  The chandelier is on a dimmer switch where off has meant off, in the past.

I installed 6 bulbs into the chandelier, turned them on bright.  All is well.  Turned them off, they remained 'on' (rather dim, but still not all that dim).

I also bought $9 bulbs (not dimmable) for another fixture.
I also have a lamp nearby with the old fashioned light bulb.
I unscrewed 1 of the 6 on the chandelier.  It, of course, went out.  The other 5 stayed lit.  I then screwed in the old fashioned light bulb.  All 5 LED lights went out!!!  I turned on the light switch, and all 6 turned on.  I turned it off and then unscrewed the old fashioned bulb - all 5 LED came back on!!!!
I then replaced it with a $9 LED bulb, non dimmable.  $9 bulb did not light.  But the 5 LEDs that were still glowing continued to glow.

So, I have a problem. I want the lights to go off when turned off.
Might the problem be the bulbs?
The wiring of the new chandelier?
The age/wiring of the dimmer switch?
Something else?

Hopefully, you can tell from the content of this, that I know very very little.  If you start talking to me about MOSFET, capacitors, snubbers and the like, it will likely go over my head.  I will ask my electrician to come back out, but thought I would see what enlightenment I could obtain here.


texts: Example code to read device ID of MachXo2 with FTDI -JTAG

texts:
In my project I am working on MachX02 programming with FTDI master using JTAG functionality. I am trying to read device ID of MachX02, but not working, here is my sample code to read device ID of MachX02:

cmd_buffer[0] = 0xE0;
cmd_buffer[1] = (byte)((operand & 0xFF0000) >> 16);
cmd_buffer[2] = (byte)((operand & 0x00FF00) >> 8);
cmd_buffer[3] = (byte)(operand & 0x0000FF);

JTAG_WriteRead(fthandle, false, 32, cmd_buffer, 4, m_readbuffer, ref operand, RUN_TEST_IDLE_STATE);

Where I went wrong could not able to identify, for MachX02 before sending device ID opcode, do I need to send any another opcode?
Please help to overcome this problem, thanks in advance.


texts:
If you connect an access point to (PCIe/USB) Wifi card over coax (i.e. no antennas) will it work?

If it would work, what would the maximum cable length be?

(This is just a thought experiment.  I know fiber optic cable is better for long distance networking.)


texts:
The diagram shows part of the schematic for the late-model Minimoog VCO. In the circuit, Q7 and Q8 form a current sink, drawing a current through the collector of Q7 that is exponentially related to the voltage present at the base of Q7.  This current is integrated by C7 until the voltage at the drain of Q4 (which is at present switched off) reaches 0V as detected via the voltage follower IC7 by the comparator IC8b, whose + input is held close to ground by a resistor not shown. At this point, the capacitor is discharged by Q4, and the drain of Q4 rises to 5V again.  Thus the oscillator generates a falling sawtooth waveform with a frequency proportional to the current.  Compensating resistor R31 can be neglected at low frequencies, and the purpose of Q5 is just to lift the sawtooth at the base of Q6 (which converts the sawtooth to a triangle wave) by 1 V_BE drop.  IC8b has a bit of positive feedback to ensure a clean reset.

Further analysis is given in the Minimoog Service Manual, Section 2.3, which can be found online: http://www.cyborgstudio.com/synthmp3s/moog/minimoog/manual/minimoogservicemanual.pdf

Note that

(a) The collector of Q8 is held at ground by the negative feedback around op-amp IC6.

(b) So 5 microamps flow in R30 as claimed on the schematic [though in the opposite direction to that marked].

(c) The emitters of Q7 and Q8 are held at a V_BE drop (appropriate to I_C = 5 μA) below ground by action of the op-amp.

(d) When the base of Q7 is at ground potential, 5 μA will flow in Q7 also.

(e) This will charge C7 to 5V in 1ms, and give the oscillator a frequency of 1kHz, assuming reset time is negligible.  Indeed the legend 200Hz/μA appears above R30.

(f) But the legend 0.00mV = 2' lo F = 350Hz appears at the base of Q7, implying that setting the oscillator's range switch to the highest (2 foot) setting and pressing the bottom note on the keyboard will produce a voltage of 0.00 mV here and a frequency of 350Hz.  And indeed, taking A4 = 440Hz gives F4 = 349.23Hz according to [an online source].

These things can't all be true at once!  Is it just (f) that's wrong, or is there some reason why the current sink doesn't give 5 μA but something more like 5/3 μA when Q7's base is at ground?

Bonus question: what is the purpose of CR2 in this circuit?


texts: Is DS28EC20 (20Kb 1-Wire EEPROM) a secondary address of I2C?

texts:
I have a MCU (nucleo64 L476RG), connected with I2C, and I2C is connected with DS2482-100 (Single-Channel 1-Wire Master), then to a DS28EC20 (20Kb 1-Wire EEPROM). I create project from stm32cubeMX and try to receive data from DS28EC20, there are two functions:

Receive in master mode an amount of data in blocking mode using @ref HAL_I2C_Master_Receive()
Read an amount of data in blocking mode from a specific memory address using @ref HAL_I2C_Mem_Read()

which one I should use? somebody mentions: "HAL_I2C_Master_Receive() used to communicate with those devices that do not have secondary address" so in my situation, does my I2C have a secondary address for DS28EC20?


texts: Is my PCB layout ok? (ATMEGA32U4, WizNet W5500, Ethernet)

texts:
I want to design a device that listens to certain network communication and calculates a MIDI clock signal out of this information. The MIDI output is via classical MIDI port or via USB MIDI.

I am using an ATMega32U4 as an MCU. It supports USB MIDI and is easy to program via Arduino IDE, and to use an WizNet W5500 as Ethernet MAC and PHY, as it offers everything I need and is compatible to the Arduino IDE.

For optical output I chose four dual color LEDs and for the input I chose a push encoder, which is debounced via hardware.

I decided to use 0603 as minimum part size, as those are still solderable by hand.

But now for the PCB:
Of course, there is a ground layer on every side of the PCB, I just deleted it for visibility reasons for the images. The outline of the ground layer is the white outline on the images.

The large blue layer is chassis ground, which is connected to the normal ground layer by 1uF/2kV (C25) and 1M ohm (R36) in parallel. I read somewhere, that is good for EMI reduction. Is this true?

On the left side of the PCB there is the W5500 as it is recommended in the reference schematic. Magnetics are included into the RJ45-jack.

I tried to match the trace lengths of the differential pairs to the connector, and they are matched to +- 5 mils, hence the strange layout at the RJ45 connector. When traces of the top and bottom layer are crossing, they are crossing in an 90 degree angle.

Is this part of the layout ok?

In the middle, there is a 3.3V regulator (LD1117) in a SOT-223 package. The thermal layer is on both sides of the PCB and connected via thermal vias.

Below that is a 2x3 pin header for in-system programming (ISP). I'm not sure wether I need this, as the ATMega32U4 offers a direct USB connection. Users should be able to update the firmware on the MCU later on via USB.

On the right side, there is the MCU, also according to the reference schematic, with self resetting fuse und ESD protection.

MCU and W5500 communicate with each other via SPI, but I am not sure, how this works out if you use ISP, as the W5500 then gets powered, too, and receives the ISP data, too. Should I add a jumper in the large power line, so you can power off the W5500 when you use ISP, or is this not a problem, or do I not need ISP at all?

Right now, the reset pins on the MCU and the W5500 both are permanently pulled up via resistors. The reset pin of the MCU is also directly connected to the ISP header. Does it work like this?

The last thing I'm not sure about are the values of the capacitors next to the crystals. I want to use the following crystals for 16 MHz and 25 MHz. What are the correct capacitors for those?

Did I miss anything? Or can I order these PCBs like that?

PS: high resolution images are available when you click on the images.


texts: How can I solve for impedances if given RMS currents?

texts:
Given a very simple circuit such as this.

If I where given the RMS values for the three currents, how could I go about solving R and Xl? (the resistor and inductor in paralell)

I know I can not apply KCL using the RMS values, even if I tried the sum of the three currents is not zero (as in total current is not equal to the sum of the currents of the two branches).

I tried getting the peak value from the RMS values and then apply KCL but I'm stuck because the total current and the current that goes thru the inductor will have some unknown angles.

What would be a good strategy to solve this?.


texts: Determining Faulty Lithium Batteries in Battery Pack

texts:
I am having some difficulties with a 72V 200aH LiFePo4 battery pack that I am using in conjunction with an EMUS BMS. The BMS indicated some of the batteries were not charging properly, I corresponded with the BMS manufacturer and he was able to ascertain from the CAN messages that some batteries were indicating higher than normal resistance values, but couldn't tell which ones.

I have disconnected the battery pack and want to go through each of the 24 cells and make sure there are no other faulty batteries in the pack (besides the 4 very swollen ones).

Am I correct in understanding that I would need to charge each individual cells (separately with a PSU, not the BMS), attach a resistor to the fully charged battery and then measure the voltage drop over time?

Should I attempt this on the swollen batteries or is it too dangerous to bother trying to charge?  Would I be better off just swapping the physically altered cells with replacement, reconnecting the pack and using the BMS to determine if there are any further issues?


texts: I'm a little confused about the whole kilowatt hour thing. I get its 1000 watts in 1 hour but I don't get how you figure out how much voltage and current is running through the house. I did a little research an found that houses are wired for 200 amps. This solves how much current can go through your house but not how much really is. Plus I don't think anyone will ever get close to 200 amps. Could anyone tell me how to figure out how much current and voltage is going through a house every second (or hour if it's easier). If it helps my house has an average of 600 kwh going through it. Thanks :)


texts: How to generate 4-channels phase-shifted PWM with 150kHz frequency

texts:
I'm designing a PCB on which I need to generate 4 'independent' PWM signals:

All powered with the same clock
Fixed frequency, any between 97kHz and 150kHz (ideally)
At least 256 duty cycle steps (more - better)
All with independent on and off times
It is not going to drive leds, so it can't be constant-current solution

At first I was looking at PCA9685. It suits all my needs, except maximum frequency = ~2kHz which is 50 times to low.

Then, I came up with PCA9635, which is fast enough (97kHz max), however it does not allow to set independent on and off times.

My next idea was to use two PCA9635s signals for each channel and put logic gates and flip-flops to Enable output by first signals slope and Disable by seconds. However this is going to be very complex, since edge-triggered S-R latch consists of at least 8 gates.

Right now I also have atmega88pa onboard, so:

I'm looking for something with digital interface (spi / i2c / ...)
I can't use built-in timer because their resolution and frequency is too low
I can't use bit-bang because the uC has other tasks


texts: STM32 dynamically change PWM compare value

texts:
I have set up stm32 timer to work as PWM to control the servo drive.
The control code looks like this:

static void setServo(uint8_t value) {
    const uint16_t timerValue = servoToTimerValue(value);
    TIM21->CCR1 = timerValue;
}

static const uint16_t s_minServoTimerValue = 258;

static uint16_t servoToTimerValue(uint8_t value) {
    return s_minServoTimerValue + value;
}

The concern I have is when I change the CCR1 value there might be a situation when the PWM won't detect the match because it is already skipped the new value but have not reached the old value.

Consider following scenario:

compare register CCR1 = 500
counter register is at CNT = 400
the new compare register would be CCR1 = 300

The timer won't find a match in this cycle and will result in 100% duty cycle this iteration.
How to I avoid it? Is it a legit concern at all?

I have come up with the following logic to mitigate this case:

static void setServo(uint8_t value) {
    const uint16_t timerValue = servoToTimerValue(value);
    if ((timerValue <= TIM21->CNT) && (TIM21->CNT > TIM21->CCR1)) {
        GPIOA->BRR = GPIO_PIN_2;
    }
    TIM21->CCR1 = timerValue;
}

What would be the proper way to reset PWM's channel pin?

My setup is following:

Fcpu = 16 MHz
Timer prescaler = 62 => Timer frequency 258 kHz
Timer period = 5160 ticks ~> 20 ms
Timer match is within range 258-516 ticks ~> 1-2 ms

MCU: stm32l011f4


texts: Meaning of phase in Fourier Transform of audio signal

texts:
I'm looking at the Fourier Transform (really, at a sliding DFT) to analyze (visually and intuitively) the frequency components of a sound over time. But the DFT produces complex numbers, and I'm not sure how or whether to visualize them.

Should I just graph the magnitude of the result?

I've tried letting the argument/phase of the resulting number affect the hue of the graph, but it just looks more or less like a rainbow oil spill. It doesn't seem to help me understand anything about the sound.

Or would just dropping the imaginary part convey just as much?


texts: What is the frequency shown on scope screen for this measurement?

texts:
I'm observing the noise of a voltage regulator output in AC coupling on a scope.
Shown is a photo from the measurement:

The FFT for the Vrms shows explicitly on the screen that there is around a 6.25kHz noise on pink plot.

But on the bottom right of the screen there is another frequency shown in yellow color as f = 96.2818kHz.

What is the meaning of that frequency?


texts: How to amplify and offset the voltage in an opamp?

texts:
I need to amplify a voltage, which comes from a DAC and is 0-2.5V and scale it 0-25V in an operational amplifier. After amplified, I need to offset it -1.25V, so the final voltage is -1.25 to 23.75V. In other words, being an operational amplifier, I want to do the y=ax+b operation. with a=10, and b=-1.25V

I thought of 2 different ways of doing this.

The first idea I had is to use a second amplifier as a summing amplifier, with a fixed -1.25V voltage.
The second idea is to use a 1.2V zener in series with the output, along with a biasing resistor to -V.

Why do I want this? I want to set the ADJ pin in an LM338 voltage regulator from an MCU. LM338 out is ADJ+1.25V. If ADJ is -1.25V then the output is 0V.


texts: Arduino Atmega8noxtal on breadborad uploading sketch not in sync error

texts:
I have built Arduino with Atmega8A PU on Vero board. My problem is first when I Upload the firmware with my parallel port programmer into ATmega8 chip and then I try to upload sketch of arduino blink example. I successfully upload the sketch into hardware.

The problem is when I try to re-upload the sketch It got error of
        avrdude: stk500_getsync(): not in sync: resp=0xc0

Why is it able to upload at first? and why it is not uploading second time?
I am really confused. I have tried lot of times and tested.

I haved followed this tutorial to make my arduino

Led is attached with pin13 of arduino

    // Pin 13 has an LED connected on most Arduino boards.
      // give it a name:
    int led = 13;

    // the setup routine runs once when you press reset:
      void setup() {
   // initialize the digital pin as an output.
    pinMode(led, OUTPUT);
      }

       // the loop routine runs over and over again forever:
     void loop() {
      digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage          level)
       delay(1000);               // wait for a second
       digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);               // wait for a second
            }

and on text file of Boards I have made following modifications

         atmega8noxtal.build.variant=standard

when I program my Arduino with external hardware I uses following fuse bit configurations


texts: Decrease of internal resistance of a solar cell while increasing the load resistor?

texts:
Imagine to model a solar cell as a power supply \$V_p\$ in series with an internal resistance \$R_p\$. This solar cell is connected to a variable load resistance \$R_{load}\$.

Suppose that I keep the solar cell at fixed distance from a fixed light source (say, a light bulb).
The power incident on the solar cell should be a constant, as the distance or the source do not change.

Now I change the value of \$R_{load}\$ many times and everytime I measure the current \$I\$ flowing in \$R_{load}\$ and the voltage across load, \$V_{load}\$.

Before taking all the measurements I measure, one time only (as it should be a constant), the voltage across the cell once i disconnected the load \$V_{open \, circuit}\$: that should be  \$V_p\$ and it should not change, as said.

I tried all this procedure experimentally but I noticed one strange thing:
Everytime I calculated \$R_p\$ as $$R_p=\frac{V_{open \, circuit}-V_{load}}{I}$$
and I noticed that \$R_p\$ changed while \$R_{load}\$ was being varied! \$R_p\$ decreased as \$R_{load}\$ increased!

Is there an explanation for that?

The most strange thing is that, since we are at constant distance and source \$P_{incident}\$ is constant and we have \$P_{produced}=\frac{V^2_p}{R_p}=\eta P_{incident}\$, where \$\eta\$ is the efficiency: if both \$\eta\$ and \$V_p\$ are constant, \$R_p\$ should be a constant too!!

Therefore, is it wrong to assume that \$V_p\$ is a constant? Or maybe is just \$\eta\$ changing?


texts: Eagle; Renumber Parts deletes everything in my schematic

texts:
I tried to use the renumber parts tool on my schematic (with default settings) and it deleted everything, leaving an empty schematic behind.  There are some user defined parts in my schematic, but mostly basic stuff like resistors and capacitors.  I can't find anything about this on the internet.
Here's my schematic


texts:
How do you maintain creepage distance between diff pairs and the LED terminals on an Ethernet connector?

My understanding is that based on EN60950, for 250V IT equipment, the air clearance is 2mm and the creepage distance is 2.5mm. Yet, the placement of LED pins on PCB mount Ethernet connectors almost force you to violate this clearance rule.

Should I be driving my LED’s through a 2kV optical isolator?

Should I be moving my diff pairs to an internal layer? I’ve done this for the unused PoE pairs, but I don’t really want to do this for the active signal pairs because the via’s will act like stubs and introduce an impedance change.

The application notes I’ve found for Ethernet layout seem to only focus on the EMI side of things, and don’t even mention creepage/clearance distances.

Am I trying to solve a problem that doesn’t actually exist? Am I miss-understanding the standard?

Below is a picture of my existing layout.

EDIT: Picture below is slightly zoomed out and shows the isolation around my ethernet connector.


texts:
I found a circuit to do what I thought I wanted it to do. I want an LED to turn on for a few seconds when an LDR detects darkness. The circuit works perfectly but now, of course, if the light source stays off the light stays on.
I would like the LED to turn off after the desired time and stay off until darkness is detected again after light.


texts: Searching USB cable with 4-pin connector

texts:
I am trying to find this USB-A-to-4-pin-connector-cable, which is used quite widely for those USB 2.0 camera modules, e.g. this one. I need that cable to be longer than the one they ship, something around 1.5 m.

How do I proceed finding it? I am searching Mouser for USB cables, using Google image search etc. But as USB is such a wide term, there is no luck.
If I could identify the connector, I could think about crimping it to the cable myself, to start with.

The measures of the connector are:

Pitch: 2.0 mm
Female connector dimension (on the cable): 8.6 x 4.2 mm
Male connector dimension (on the PCB): 10.0 x 4.8 mm

Following some pictures. I would be really happy about any type of clue! And also, which methods I could apply, searching a component like this. Thanks!


texts:
I have schematic for decoupling capacitors (3 set of 0.1uF,1nF,10pF):

And I've implemented that in this way:

And there is ADI reference for easy evaluation:

And the ground pins of decoupling caps will all connected to ground by polygone containing all pins in top and bottom. Also we have two stranger, 12GHz differential pair + clock trace.
Is it acceptable? Do not tell anything and listen to the notes please.

Note:

The board have 4 layer 1.RF 2.GND(unbroken) 3.AVDD(unbroken) 4.signal

And as you can (have to!) see I have connected 3 AVDD pins of IC, together (by polygon), but the 3 AGND's are exactly in left side of the differential 12GHz pair. Unfortunately I will connect the top capacitors to two pin in left-side of C1's GND, because they are GND but are Digital GND (datasheet called them DGND and SDGND).I have idea it will be nice if I can place a bigger size (like 1204) of one of capacitors to bridge the right and left of differential pair, is it good idea (I prefer 1nF)?

Finally

The questions are:

|.Is it acceptable decoupling, rate it and if is poor give alternate idea

||.Is it good idea to bridge two side of differential pair? (because I think the bypasses must be between same GND & VDD but in this case they are not in good placement)


texts:
I am designing a on/off switch for the grid of a VFD tube, and I would like to use a NPN transistor. The requirements are:

The Grid is on when 12V are applied. At this voltage, 0.85mA flow.
I want to use a LCU with 3.3V logic.

I already have a solution that uses a high side switch (see my other question here), but now I'd like to see if I can spare a transistor.

I ended up with this design:

simulate this circuit – Schematic created using CircuitLab

And here is my reasoning:

If 0.85mA flow in the grid when 12V are applied, I can think it as a 14.1 kOhm resistor.
When Q1 is cut-off, R1 and R GRID form a voltage partitor. If I assume that 12V is the voltage applied to R GRID, then 0.85mA flow through it (as per datasheet). This mean 0.85 flow through R1 too. So R1 = (15-12)/0.00085 Ohm, and the next standard 5% resistor value is 3.6k
So, when Q1 is cut-off, the grid should be on with 12V on it.
When the LCU pin is logic HIGH the Q1 enters its saturation region, current flows through it cutting R GRID out (actually is not completely grounded, the grid will see the collector-emitter saturation voltage, that for the 2N3904 should be 0.2V in this situation, but it's anyway too weak to have any effect.).

Now my question: is there any weak point in this design?