texts: How to identify faulty or Fake (Duplicate) ICs?

texts:
I am developing an application on LPC2138.
I prepared prototype using a standard development board. After completion, I shifted to final board.
But I am not able to download any program my LPC2138.

Connections are correct. I compared with my development board and checked every single pin. Voltage difference at VCC and VSS is 3.3V. Reset pin is high. Crystal is supplying fine square wave.

My final doubt is on Chip. I might have purchased a faulty or Fake LPC2138.
Is there any way to identify that Chip is good and I am missing something in programming.

P.S.: I grounded BSL pin, RESET the circuit. Ideally it should go in Bootloader and if I send "U" it should return "?". This happens on my development board but no response from final board.


texts: How do I correct the offset voltage of op-amps which have no explicit offset-null pins?

texts:
Not all op-amps have explicit offset-null support, but all op-amps have an offset voltage.

This is exactly my practical circuit:

How do I correct the offset voltage of TL084 in this circuit?

(Datasheet: TL084)


texts: Motor powered on and brakes disengaged for three days, should I be worried?

texts:
I have a brushless DC motor which runs at 24v which I left on for three days without noticing. The motor just has a ssi motor feedback. The motor was not running as the software which commanded it was off. However, the brakes were wired to another power supply, which I also left on.

During my motor tuning process I noticed that the motor gets pretty hot near the end close to the brakes. I was able to spin the motor after the tuning.

When I came back to the setup 3 days later, the brakes felt just as hot. I could still see that the brake was pulling current, around .2A, which was nominal. When I tried to spin the motor, it gave me a following error. I tried to re-phase and then retune the motor, but its behavior has been rather erratic. Now, I've left it to cool down completely before I do anything. But, I'm concerned that I might have damaged something.

Has anyone left a motor on for way too long?

EDIT: update, after waiting for the motor to cool, it seems to have worked again. Strange, I'm still a bit uneasy about this.


texts: Powering a mechanical (el. magnet) doorbell with an AC LED driver

texts:
I have an old fashion ding-dong doorbell that is powered by a 12VAC 1A  transformer. The old transformer died and I decided to replace with a cheap AC LED driver which is rated 12VAC 50W. That didn't work. Then I bought a classic bulky 12VAC 1A transformer (similar to what I had before) and that worked.

Why did not the LED driver work? It's AC (not DC, verified with a multimeter) and it works well when I test it with a 12V MR16 LED down-light bulb.


texts: How can I determine whether circuit is Moore or Mealy machine

texts:
I've designed a modulo 5 counter (0,1,2,3,4,0,1....) with additional features like BCD to 7-segment-display decoder, the reset switch and the special switch to omit number "3" in the counter.

But the question is, how can I determine whether the circuit is Moore or Mealy machine? Are there any important things I should keep in mind? Any help would be appreciated.


texts: analog signal generator output in Volts vs dBm

texts:
I am connecting a mixer to a microwave source and need to be careful of how much power I am giving to the LO and RF of the mixer.

If I just stay in the unit of dBm, it would be ok but I became curious as to how to convert the source output in Volts to dBm.

If the signal source outputs 10mV, is there a way I can convert that to dBm, so that I know how much power the source is outputting?

One way I thought of is the diagram below.  The MW source is basically outputting some voltage value and the power transmitted from the MW source is going to depend on the load impedance. (most measuring devices are 50 Ohm impedance so I guess if I set the MW source output to 10mV, given the load impedance of 50 Ohm, it's power output is 500mW?

I am not sure if the resistor value I need to put in is the 50 ohm resistor in the measuring device (oscilloscope) or the 50 ohm resistor in the MW source.

This is the mixer I am using.  The datasheet says RF power should not exceed 50mW.  I


texts: Delete or ignore I/O from a schematic block in Lattice?

texts:
I am programming with a Lattice ispMACH 4000ZE Pico DevKit and with the software ispLEVER Classic Project Navigator. I want to use in my schematic file the OSCTIMER block from the Lattice library, but the problem is, that I MUST use all inputs and output, even though I only need one output and one input. How can I ignore the other pins? If I cannot ignore them, how can I delete them? I tried by editing the symbol (I deleted the input and output pins I did not need) but it did not work.

I compile it without problems but when I open the Contraint Editor, this error appears:

Fatal Error 3501: Instance name I26/N_8 cannot be resolvedDone: failed with exit code: 0002.

Thanks again.

EDIT: Oct. 10
So I programmed the clock with VHDL like the documentation showed me:
Advance Features

--Libraries
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

library lattice;
use lattice.components.all;

library MACH;
use MACH.components.all;

entity Int_Clock is

port(
    CLOCK_OUT : out std_logic);
end;

architecture structural of Int_Clock is

component osctimer
generic(TIMER_DIV : string);

port(   DYNOSCDIS : in std_logic; -- Disable internal oscillator
        TIMERRES : in std_logic;  -- Reset timer
        OSCOUT : out std_logic;   -- Oscillator output
        TIMEROUT : out std_logic); -- Timer output
end component;

signal tmr_out, osc_dis, tmr_rst, osc_out : std_logic;

begin

I1: OSCTIMER
generic map (TIMER_DIV => "128")

port map (  DYNOSCDIS => osc_dis,
        TIMERRES => tmr_rst,
        OSCOUT => osc_out,
        TIMEROUT => tmr_out);

CLOCK_OUT <= tmr_out;

end structural;

Again, it compiled without any problems BUT when I wanted to make my JEDEC-File an error appeared:

  lpffll.exe stopped working

What does this even mean?! ispLever did not stop working, it actually made my JEDEC-File (I think) but my clock still does not work (I am monitoring it with a oscilloscope).


texts: constant memory on the Spartan 3 Starter Kit

texts:
I'm in dire need of compile-time generated constant memory of ~512K x 16Bit on the Spartan 3 Starter Kit Board.
I'm configuring the board over the JTAG port, and wondered if

a) there is a way to pre-configure data into the on-board SRAM, to read it on runtime

b) there is a good way to implement ROM (the way I tried exceeds the Boards capabilities at 8k x 16Bit)

c) there is some other good advice on the matter / things I have not considered?

I'm using the Xilinx ISE, VHDL.

thanks in advance.


texts:
I've been using a 28BYJ-48 5V stepper motor in a little project for a pan-tilt camera system, where the stepper is the pan motor. I'm powering it with 6 AAA NiMH batteries in series so it's about ~7.5-8V supplied. I'm using an Arduino Pro Micro (ATMega32u4).

I've noticed that upon startup (where I am turning on the pins on the microcontroller and buffered via a ULN2003 IC), the stepper motor refuses to turn. After about a minute, the stepper will start move in small jerks in the direction I am telling it to move and then by the 2 minute mark, it will be turning smoothly as it should be.

Are there any interesting points about steppers that I do not know about regarding startup issues? Have any of you seen this before? (Sorry in advance, I understand this is extremely vague and too many variables, but I'm not sure if it's a common issue because I don't work with motors usually)

I've been wondering if it has to do with the extremely poor ventilation around the stepper because I pack a bunch of other wires around it and the bottom of the stepper is hot-glued to a base (instead of using the mounting flanges). Or perhaps the wires around it are adding to some overall magnetic flux imbalance (seems unlikely as they are mostly low-current signal wires, not power wires, and nothing is more than 1A draw in the system).


texts: How does the grid handle small deviations of power consumption when most of load is regulated?

texts:
This is a continuation of this question. Suppose we have a grid which distributes say one gigawatt total power and all this power is perfectly fully consumed by electrical devices.
However all consumer devices are regulated - each either has a switch-mode power supply or it's powered through a switch-mode voltage stabilizer. So it can be a good old perfectly resistive tea kettle but it would be powered via a high-power switch-mode voltage stabilizer which tries its best to output exactly 230 volts (I'm using European mains voltage here).
Suppose at some point of time a small fraction of consumers disconnect their devices from the grid. So now generation exceeds consumption and grid voltage rises a bit. However consumer devices are regulated and they refuse to drain more power. Those fully resistive tea kettles are connected via switch-mode voltage stabilizers which will not pass the higher voltage through.
Where will excess power go?


texts: Fusion algorthm: how many DoF for the gyroscope?

texts: The gyro data output will be fed to an Extended Kalman Filter and fused with data output from an accelerometer. my goal is to measure tilt angle over one axis. Do I need a 3 DoF gyro or will a 1 DoF suffice ?


texts:
I would like to design a MIPI CSI2 bridge with a MachXO3L.

I leverage the LVDS25 input/output of this FPGA family with the adequate resistors for HS traffic. (I think) I don't care about LP as the camera is free-running clock and doesn't handle LP.

This Lattice document explains what I have been following:
http://www.latticesemi.com/~/media/LatticeSemi/Documents/ReferenceDesigns/JM/MIPIDPHYInterfaceIP.pdf?document_id=50110

I don't want to deserialize/re-serialize data as the CSI2 traffic speed might be faster than what the MachXO3L can handle digitally. I want to achieve an "analog" bridge. Analog is perhaps not the right term, this is more by opposition to digital with deserialization/re-serialization.

My code looks like the following:

BLOCK RESETPATHS ;
BLOCK ASYNCPATHS ;

LOCATE COMP "clk_x1" SITE "C8" ;
FREQUENCY PORT "clk_x1" 12.000000 MHz ;
IOBUF PORT "clk_x1" PULLMODE=NONE IO_TYPE=LVCMOS25 ;

LOCATE COMP "I_CLK" SITE "R11" ;    # PB35A
#LOCATE COMP "I_CLK_N" SITE "T12" ; # PB35B

LOCATE COMP "I_DAT0" SITE "R13" ;   # PB34A
#LOCATE COMP "I_DAT0_N" SITE "T14" ;    # PB34B

IOBUF PORT "I_CLK"  PULLMODE=NONE IO_TYPE=LVDS25 DIFFRESISTOR=100 ;
IOBUF PORT "I_DAT0" PULLMODE=NONE IO_TYPE=LVDS25 DIFFRESISTOR=100 ;

LOCATE COMP "O_CLK" SITE "D10" ;    # PT27A
#LOCATE COMP "O_CLK_N" SITE "E10" ; # PT27B

LOCATE COMP "O_DAT0" SITE "F9" ;    # PT26A
#LOCATE COMP "O_DAT0_N" SITE "E11" ;    # PT26B

IOBUF PORT "O_CLK"  PULLMODE=NONE IO_TYPE=LVDS25 ;
IOBUF PORT "O_DAT0" PULLMODE=NONE IO_TYPE=LVDS25 ;

and also:

module csi_bridge(
    input clk_x1,

    input I_CLK,
    input I_DAT0,

    output O_CLK,
    output O_DAT0,
);

assign O_CLK =  I_CLK;
assign O_DAT0 = I_DAT0;

endmodule

I have tried various things but the processor can't manage to decode the traffic. Obviously, without the FPGA in-between, the processor can decode data.

On the scope, I see things moving on the output side, trying to mimic the input. My scope is not super high bandwidth so I must admit that I have some trouble to say what's really wrong.

Any idea what I should do and what I could be missing? Are they specific Lattice Diamond settings that I should look into?

** EDIT 1 **

To give further details, my objective in the end is to replicate a similar logic to Fairchild FSA642: https://www.fairchildsemi.com/datasheets/FS/FSA642.pdf. I have deeply tested this chip and I'm 100% sure that they don't deserialize/reserialize data because I have swapped clock and data, and it's still working. I'm wondering if I should not remove all resistors and consider all pins independently with an assign logic. Without any pull-up, voltage out won't go higher than voltage in.


texts: Find Voltage of inductor in LC series circuit with resistor in parallel

texts:
I have a LC resonance circuit with a resistor between the capacitor and inductor:

simulate this circuit – Schematic created using CircuitLab

I want to find the Voltage at L1, more specifically how it depends on R2.
I cannot figure out how I to set up an equation or such to find the voltage at L1. If anyone knows, can you please help? :)

NOTE: This is a hobby project, not related to education.


texts: Using a current transformer with an Arduino Uno

texts:
I have a current transformer CR3110 - 3000

It will be used to detect the state of different loads (100w, 1000w, ...). The intention is to use Arduino Uno, to detect voltage in the range 0-5V, like it is explained in this tutorial

One coil of the current transformer, which is used in the linked tutorial, has 2000 turns. I was wondering where could I get the number of turns for the current transformer, which I have.

The manual states defines a parameter Te (Effective turns ratio including losses), which is the only number resembling the number of coil turns.

Does the mentioned parameter represent the number of turns or is that information provided elsewhere?


texts:
I am using TP4056 module to charge 4 Li-ion cells in series using 4 of the modules.
Red wires in the diagram represent wires for positive terminals and black wires from the negative terminal while blue wires and green wire used for connections.
Now when I tried charging with this circuit the circuit burned out and TP4056 and other components in the module started emitting flames and obviously, the circuit failed to do what it was supposed to do.
If anyone could tell me the right circuit or changes I can make in the present circuit.
I have already considered problems like circuit getting short or too much input and taken care of that already yet the circuit failed and when tested for 2 cells in series it worked fine but failed of 4 cells.
Thank you


texts: Some confusion about noise margins in digital abstraction!

texts:
I am learning MIT open course 6.002 and 6.004 by myself, but met something unclear about noise margins in their materials.

In 6.002 (Electronics and circuits), the teacher gave a relation of the 4 parameters characterizing the relations of voltages and logical levels:
$$V_{RL} > V_{SL}, V_{RH} < V_{SH}$$
see the slide below. (Here I used a different notation of the parameter subscripts, "R" stands for reciever side, "S" stands for "Sender" side):

While in 6.004 (computation structures), different relations of these four parameters are given, namely:
$$V_{RL} < V_{SL}, V_{RH} > V _{SH}$$
see the slide below:

While I don't think either one of them is wrong because they have been published for a long time, sth must be wrong with my own understanding. To me, I think the first (6.002) is more easy to understand, because the a valid input might be corrupted by noise so that a larger range in the reciever side can ensure valid input is recieved.

But according to explanation of 6.004, the second relation also seems to be right, which states that "a valid signal at the output of a device will appear as a valid at a connected device input, despite a modest amount of noise introduced by the connection", so "a combinational device must accept sloppy input representations but produce squeaky-clean representations at its output".

I am totally confused about this difference. Could anyone please give some clarifications? Thanks in advance.


texts:
I have the following problem to solve and Im a bit confused:

I have a ceramic factory that is based on a circuit with 4 outputs:

timer that outputs "1" when the oven is on (timer)
sensor that outputs "0" when temperature of the oven is too low
sensor that outputs "0" when temperature of the oven is too high
sensor that outputs "1" when ceramic is humid

Now I should find a function that outputs "on" on the following conditions:

If the oven is on AND:

temperature is between the correct interval
temperature is above the limit BUT ceramic is humid

If the oven is not on  BUT ceramic is humid.

From my understanding I have 3 different logic doors, them being:

a) oven on(time = 1) and temperature is fine (sensor = 1)
b) oven on(time = 1) , temperature above limit (sensor = 0) and ceramic is humid (Hum = 1)
c) oven NOT on(time = 0) and ceramic is humid (Hum = 1)

I have tried to build the logic circuit to get the function but Im kinda stuck. On my c) variable, Time is 0 and Humidity must be 1 but there is no logic gate that supports this. Am I wrong?

Sorry but Im still learning!


texts:
I use this fan to cool my room, but sometimes it is too fast and I have to frequenctly turn it on and off to keep normal temperature. Maybe it is possible to reduce the speed by connecting a resistor in series or using a variac. The fan uses some form of shaded pole motor (the manufacturer calls it "Alveolate" and compares it to the standard shaded pole motor (pointing out that its motor is better). The "Alveolate" motor needs a starting capacitor.

I have searched the internet and this site but found contradicting answers. Some say that the speed can even be reduced by using a triac while others say that a resistor in series can destroy an induction motor. The fan motor is 60W.


texts:
I am building an electronic device that has a cable attached to it. I am able to design and order a PCB. I am able to get the PCB assembled with parts. I believe I have enough information to order a prototype case by 3d printing.  What I am not able to do is find a way to get the cable prototyped or manufactured.

Do you know how one would go about getting a custom cable that will be soldered to a PCB on one end? Or maybe it will have a special internal connector on the PCB end. Either way I have not been able to find any information on getting this done.  I don't know if I am using the correct search terms but so far I can only find people wiling to build "pretty" customer cables for keyboards and similar items.  I would like one end to be USB type-c and the other will be permanently attached to my PCB.

Any help is greatly appreciated.


texts: How can a 4-bit CPU have 40 instructions?

texts:
Currently, I am using Logisim(yes, still Logisim) to build a 4-bit variant of the 8-bit SAP-1 microcomputer. However, I ran into a problem with the instruction register. Let me explain.

The SAP-1 has 5 instructions(LDA, ADD, SUB, OUT, HLT). These 5 instructions amount to 3 bits of data to read those RAM words. But that leaves only 1 bit for the address, and that means only 2 RAM addresses. To fix the problem, I tried to make the RAM words 6-bit instead(I don't know why I chose 6). But then I realized that having 6-bit RAM words would mean a 6-bit bus, and therefore a 6-bit CPU, which isn't good. Yet, 4-bit microprocessors carry on with upwards 40 instructions with kilobytes of memory. How do they do it, and how can I implement it into my 4-bit SAP-1?


texts: Why do electrons flow from a lower potential energy to a higher potential energy?

texts:
So I understand that the term "voltage" refers to the potential energy difference between two points.  So, in a 5v battery, there is a 5v difference between the positive and negative ends.  When these are connected in a circuit, the electrons naturally want to flow from one end to the other.

My question is, why do they do this?  What exactly is it that makes electrons want to flow from lower potential energy to higher potential energy?

Also, does the potential energy difference between two points (voltage) determine the speed at which the electrons travel?


texts:
We are developing an automotive product according to ISO 26262 standard. For FMEDA calculations failure mode and failure mode distribution is required.
Some sources to find these are IEC 61709 standard and the book from Birolini.
However not all failure modes and distributions are listed in there.
I'm still looking for failure mode and distribution of the following components:
- High-side unipolar current sense monitor
- Rail to rail opamp
- Differential Comparator
- Constant Current Regulator
- Voltage regulator
- Real time clock
- Some 74xx logic
I contacted the manufacturers, but I did not receive a satisfying response.
Does anybody know where to find these failure modes and distributions?

Thanks in advance,

Marcel


texts: Current in a branch containing both resistor inductor?

texts:
simulate this circuit – Schematic created using CircuitLab
There is a switch in the circuit which has been closed recently so the circuit is now in transient state and we are applying KCL at node 1.
 Also we cannot use Laplace transform.
Is there a method for this?

WE have to apply KCL at NODE1 , How can we write the expression for current in the branch containing capacitor and inductor? As we have for left and right branches i.e $$ (V_1 - 1)/100 $$ and $$ (V_1 - 0)/100$$


texts: 20A 12V Load for lithium battery cycling tests - Car Battery + DC power supply with diode?

texts:
Ok I have searched, can't find anything.

I have a high capacity lithium ion battery testing rig, and I have some iCharger 406 units that are doing the testing for me. That side works awesome, and I can charge/discharge the lithium ion 3.7V battery at up to 70A.

These lithium ion cells are from EVs - 55Ah - very high capacity.

These units are able to both charge the lithium ion cell from source, plus regeneratively discharge the lithium ion cell back to the supply (at about 80% overall efficiency). Maximum current draw from 12V source during charging is about 27A.

My problem is that if I use a lead-acid source battery (12V car) then after 3 or 4 cycles the source battery is depleted due to the losses in regeneration.

I'm thinking of putting both a 12V battery plus a 12V computer DC power supply in parallel, using a diode on the power supply. I know that the computer power supply works fine on its own with this setup.

So:

DC12V --->|-+--iCharger---LiIon
Batt  ------/

I understand that this is oversimplifying, but the idea being that the battery would have a higher voltage than the power supply for the majority of the time, and thus be primarily discharged until about 11.3V (12V - forward voltage drop of diode on the +12V DC power supply), at which point the power supply would pretty much be supplying the majority of the power.


texts: Can an ExpressPCB ".pcb" file be converted/imported to any other format?

texts:
I was given a .pcb file and I'd like to view it to confirm it's a valid file and at least minimally what I was expecting.
ExpressPCB .pcb files are a proprietary format. I use MacOS so a native app isn't available and using Wine (the "free" version isn't actually free, in the end) or virtual machine aren't an option for this one file. It won't open nor import in KiCAD, Eagle nor LibrePCB. I tried a few graphic editors but none would open it.
There used to be an app called Copper Connection that would convert .pcb files but Express PCB bought this company a few years ago.
I'd even be happy with a .pdf file.
Suggestions?
Thanks.


texts: Summing Amp Response in a Cascaded Butterworth Notch Filter

texts:
I'm having trouble with a cascaded butterworth notch filter I'm designing and was hoping to get some insight on the summing amplifier stage at the end. I'm still a student, so my question may be a bit basic. I'm trying to get a unity gain response for the filter, but the summing amp pushes the response more positive rather than overlaying the responses.

I tried an inverting summing amplifier with 1kohm resistors to achieve a unity gain, and I've generally fiddled with the resistors as much as I can to get the response I want. That didn't work, so I tried switching to a non-inverting summing amp, thinking my response was pushed upward due to the inverting nature of the original design (seen below).

simulate this circuit – Schematic created using CircuitLab

The non-inverting amp didn't work for me either. It could be because I was using bad values for the resistors in the non-inverting summing amp, so I'm looking for any insight as to what I might be doing that is causing this response to behave the way it is.

EDIT: I should add for clarity that the filter is a notch filter in the range of 77.5KHz with a B of 15KHz using a 4th-order butterworth design.


texts: Issues with high voltage circuit for ESD testings

texts:
I am trying to develop a circuit to do ESD testing on an ESD protection circuit for electric matches for hobby rocketry. I want to discharge 1-10 kV from a capacitance of 100-350 pF into my circuit through a 100Ω resistor. I picked these values based on a modified Human Body Model I had seen used in similar testing by a pyrotechnics organization.
My budget is limited so purchasing a ESD tester was not really an option. I have a fair amount of experience with circuits up to about 450V DC and I felt like I could handle this. I purchased a cheap variable supple capable of putting out 1-10kv @ 5mA (https://www.ebay.com/itm/373114808728), a properly rated vacuum relay (https://www.ebay.com/itm/141816486180), and high voltage capacitors and resistors and wire. I designed a simple board which I have attached a picture of. I have highlighted the copper path in green and labeled the components. The circuit includes:

1000:1 voltage divider to measure supply voltage on my multimeter (approx 62 MΩ : 62 kΩ, the 62 MΩ is high voltage rated)
2.2 MΩ resistor in the positive rail to limit current draw from the supply
2x 100 pF and 1x 150 pF high voltage capacitors tied to the positive rail
0.6" gap disconnects between each capacitor and the negative rail (the disconnects are 7 position 0.1" headers with all but the end two pins removed)
0.6" gap disconnect between the negative input and the negative rail
100 Ω high voltage resistor between the negative rail and the negative output
I am using jumpers for the disconnect switches as shown.
The output wires are 20kV rated 18awg.
All traces carrying a high voltage potential difference are 0.6" or further apart

The intended process was going to be:

Set the supply to the test voltage and power it off
Connect the disconnects to the combination of capacitors to add to the value being tested.
Connect the main disconnect, and power the high voltage supply.
Disconnect the main disconnect.
Trigger the vacuum relay to discharge into the circuit being tested.

On the first version I found a page online that suggested the arc distance for 10kV would be less than 0.2" V so I made all of the disconnects and conductor spacing 0.3". Despite the calculations this board experienced arcing across the disconnects and didn't work. I rebuilt the board with 0.6" spacing and now I no longer get visible arcing but I do hear crackling and with none of the disconnects closed I still can get an arc from the negative high voltage output wire to the positive high voltage output wire when I bring them close together. I have not yet received my vacuum relay so I am just testing the capacitance circuit.
I'm now convinced I don't understand everything going on here, I am hoping someone can help me identify my issues and a path towards making this work. I tried researching Paschen's Law but just got more confused.


texts: Is it valid to consider back-EMF in a DC motor equivalent to increased inductance?

texts:
I know that back-EMF can be considered as a voltage source in series with the motor which is proportional to speed. This is the common understanding, and I totally get it. Before I understood this, I developed an alternate explanation on my own, and I wonder if it has any validity.

Think of this: an inductor resists change in current. A bigger inductor resists it more. A stalled motor resists change in current. A spinning motor resists it more.

A small inductor at a given current has some stored energy. A bigger inductor at the same current has more stored energy. A stalled motor at a given current has some stored energy. A spinning motor at the same current has more stored energy.

Hopefully you can see what a student might intuitively hypothesize: a motor's windings exhibit an inductance that increases with the motor's speed. Not because it's magically growing more turns of wire of course, but perhaps it's a sort of mechanical inductor, storing energy in the motor's momentum, rather than in a magnetic field. My intuitive understanding of an inductor is, after all, a flywheel. Maybe this is an inductor that actually is a flywheel.

Can this analogy be stretched further? In a resistive and inductive load, AC current lags behind AC voltage. Add more inductance, and current lags more. In a motor, current lags behind voltage. If the motor is spinning faster, does it lag more?

And if that much is true, can it be shown that back-EMF is equivalent to an inductance that increases with motor speed?

And if not, why? Intuitive examples would be appreciated first, then the math. I never seem to understand when presented in the opposite order.


texts:
The circuit is inputted with a 200Hz sine wave and the amplitude is varied. I believe the circuit is operating with negative feedback. But also the 8.2K resistor is then switched to an 18K resistor in which it is then operating in positive feedback. Struggling to understand the negative resistance aspect.

Can anyone help me understand what is happening in this circuit?


texts: What does NOM stand for in a datasheet and what does it mean?

texts: The question is in reference to: http://www.ti.com/lit/ds/symlink/sn74ls00.pdf


texts:
I am going to be working in a project involving logic gates and would like to start practical testing. However, I cannot seem to find anywhere transistors that match typical Boolean operations. While I know I can reproduce any logic gate from simpler ones, I would like to focus on the logic of the circuit and not worry about recreating all the gates.

I will be utilizing these in conjunction with an arduino, and am expecting a circuit voltage of either 5v or 3.5v. I also need these to be breadboard friendly.

Gates I am thinking of:

AND
OR
NAND
NOT
etc


texts:
The TWI on mega2560 seem to be malfunctioning. the below code, believed to be correct as per data sheet, gives a proper start sequence, a proper address and a correct ACK. But when writing and sending data to TWDR and then setting all bits in the TWCR incl TVINT, nothing at all happens. When trying the same startup with read, it works fine up to the point of reading and again - nothing happens. But the STOP condition after the Read is properly performed.
So, what's keeping it from issuing the proper Read/Write sequence?
Including a oscilloscope picture of SCL (top) and SDA (bottom) during Read.
Code:

------------- write to PCF8574N extension port -------------

I2CFLAG=false;

/*start*/
TWCR= (1<<TWINT) | (1<<TWSTA) | (1<<TWEN) | (1<<TWIE);
while(!I2CFLAG);
ta=TWSR;
/*adress+W*/
I2CFLAG=false;
TWDR=0x40;
TWCR= (1<<TWINT) | (1<<TWEA) | (1<<TWEN) | (1<<TWIE);
while(!I2CFLAG);
tb=TWSR;

/* data out*/
I2CFLAG=false;
TWDR=0x5A;
TWCR= (1<<TWINT) | (1<<TWEA) | (1<<TWEN) | (1<<TWIE);
while(!I2CFLAG);
tc=TWSR;

------------- read from extension port --------------------

I2CFLAG=false;
/*start*/
TWCR= (1<<TWINT) | (1<<TWSTA) | (1<<TWEN) | (1<<TWIE);
while(!I2CFLAG);
ta=TWSR;

/* set address+R*/
I2CFLAG=false;
TWDR=0x41;
TWCR= (1<<TWINT) | (1<<TWEA) | (1<<TWEN) | (1<<TWIE);
while(!I2CFLAG);
tb=TWSR;

/* get data*/
I2CFLAG=false;
TWCR= (1<<TWINT) | (1<<TWEA) | (1<<TWEN) | (1<<TWIE);
while(!I2CFLAG);
tc=TWSR;
twdata=TWDR;

/*stop*/
I2CFLAG=false;
TWCR= (1<<TWINT) | (1<<TWSTO) | (1<<TWEN) | (1<<TWIE);
while(!I2CFLAG);
te=TWSR;
tdata1=TWDR;
/* end of process */


texts:
I've just started dabbling with hardware design and I'm a little confused.
Which one of the following variants for the battery protection circuit is the most optimal one? I've been trying to follow the best PCB guidelines, but eh...a few pointers would be greatly appreciated.
Circuit

Variant A

Variant B

Variant C

DW01 Datasheet

https://cdn.sparkfun.com/assets/learn_tutorials/2/5/1/DW01-P_DataSheet_V10.pdf


texts: How does this USB capacitive touch light circuit work? You can touch anywhere and it turns on, not just the electrode

texts:
Here are some pics of the circuit board.

Now I'm not asking how the circuit works, I understand that. There is a capacitive touch sensor IC where the shiny electrode you see on top connects to the input. Then the output drives a transistor which turns on the LED when you touch. The capacitor on the left is a sensitivity adjustment connected between the electrode input and GND.

However, if I touch the side of the PCB, or even the back, the circuit works 100% of the time. At first I thought maybe the back was electrically connected to the electrode input with vias, but I scraped away all of the solder mask (and more) but found nothing. It wasn't even conductive.

So does anyone know why this circuit works even when you touch areas that aren't electrically connected to the input, or even connected anywhere for that matter? Is there a certain PCB stackup you use, or some other trick that isn't obvious to me?


texts:
I have been searching and working to understanding this equation below in relation to FM signals minimum threshold.

Pr [dBm]= (Eb/N0)+10∗log10(Rb)+N0 −Gm

Eb is the energy per bit to noise power spectral density ratio
 N0 is the signal to noise ratio per bit
 Rb is the bit rate
 Gm is miscellaneous gain

I cannot seem to figure out for an fm antenna how I could apply this formula to determine the dBm? For example how to know Eb and Rb from an FM antenna?

Any help is appreciate, even academic sources I could reference (books, papers, journals) to give me more clues on how to apply this to a fm antenna. Even the name of this theorem would be helpful.

This is my first stack question and really would love some help.

Thanks in advance!


texts: Measuring inductance and ESR of a motor using LCR meter

texts:
I am building a circuit, where a MCU will drive an unipolar stepper motor through MOSFETs and constant current source (not included in the schematic).

simulate this circuit – Schematic created using CircuitLab

The MOSFETs will switch at a frequency of somewhere in 10's or 100's kHz square wave. To design a constant current source, I need to measure the inductances of the coils and also their ESR. I have a LCR meter and multimeter at hand, but am unsure of how exactly to measure it.

If I measure the resistance of the coils (L1, L2, L3 or L4) with a multimeter I get around 5.5Ohms, if I do the same with the LCR meter set at 10kHz or 100kHz, I get like 500Ohm and 450uH.

How should I measure inductance and ESR of the coils?


texts: How can I easily inject a tone from a DAC into an XLR audio signal?

texts:
Let's say I have a mic-level signal running on an XLR cable - a vocal microphone going to a mixer or preamp. I'm looking for the simplest way to add another mono audio signal to the line.

I've got a sine tone generator and want to "add" it to the microphone signal (and still hear the microphone). The sine wave is coming from a DAC and will be converted to a mic-level signal.

Attaching the DAC straight to pin 2 or 3 of the XLR connection seems to work, but there must be another way that is more proper, is there? Do I need to balance the signal and connect it to both pins 2 and 3 of the mic signal? Or somehow protect the DAC or microphone from one another? Audio quality is not super important since it's just a tone. I'm more interested in the lowest parts count solution.


texts: 3.7 Volt external battery to charge a another 3.7 Volt Phone Battery?

texts:
I would like to know if a 3.7 V external Battery would be able to charge a phone battery of the same voltage. From my understanding, the batteries would charge each other until the charge in both the batteries is equal. Is this True?

Let's say the external battery has a capacity of 500 mAh, while the phone's battery has a capacity of 1000 mAh. Contingent on the prior statement being true, would it be right to say that in an ideal case, the external battery will be incapable of charging the phone once both the batteries reach a capacity of 250 mAh?


texts:
I'm trying to get a simple piece of logic working:

on the positive edge of the clock the output should always be 1, on the negative edge, the output should be the value of a provided input.

I've tried half a dozen ways of doing this, all of which result in an error either at the synthesis or mapping stage (errors regarding outputs with multiple drivers, or clocks being used on non clock pins).

I figure this must be a very easy task to accomplish if you know the trick.

I'm using ISE 13 and developing for a Xilinx Spartan 6.
update:

Place:1136 - This design contains a global buffer instance, <XLXI_3>, driving the net, <XLXN_45>, that is driving the following (first 30) non-clock load pins.
< PIN: XLXI_19/XLXI_3/XLXI_205/start_memory1.A5; >
This is not a recommended design practice in Spartan-6 due to limitations in the global routing that may cause excessive delay, skew or unroutable situations.      It is recommended to only use a BUFG resource to drive clock loads. If you wish to override this recommendation, you may use the CLOCK_DEDICATED_ROUTE constraint (given below) in the .ucf file to demote this message to a WARNING and allow your design to continue.
< PIN "XLXI_3.O" CLOCK_DEDICATED_ROUTE = FALSE; >


texts: Schottky datasheet - divergence in Vf / If diagram vs "pulse test" table values

texts:
while looking at datasheets for clamping schottky diodes, I noticed that the values that manufacturers state in their tables ("Pulse test: tp < 300 µs; delta < 0.02.") are different from the values you get out of the diagrams.

NXP BAT54 for example:
https://assets.nexperia.com/documents/data-sheet/BAT54_SER.pdf
Table 7 vs. Figure 1 on page 4

Table: ("Pulse test: tp < 300 µs; delta < 0.02.")
If 0.1mA Uf 240mV
If 1mA Uf 320mV
If 10mA Uf 400mV

Diagram @25°C: (roughly)
If 0.1mA Uf 160mV
If 1mA Uf 210mV
If 10mA Uf 300mV

What causes this difference? What do they perform pulse tests for?

And if I plan on using the diode for a constant overvoltage condition (to protect an analog input), do I use the diagram values rather than the pulse values?


texts: Measuring direction of current to determine moisture is present

texts:
I am building a moisture sensor with an AC current to prevent electrolysis.

The AC will be generated with a simple schmitt trigger oscillator with the midpoint reference set at 2.5V.

Water would bridge the gap between two tracks. It has an approximate resistance of 200K. The switch and the resistor represent the water.

When the oscillator is at 5V, (conventional) current flows from let to right. When the oscillator is at 0V, current flows from right to left.

When the switch is open, no current flows to the 2.5V.

I would like to detect whether or not moisture is present. This can be by detecting the reversal of current.
How could this be implemented or is there a better solution?
PS: this is a resistive measurement, not a capacitive measurement.

EDIT: I didn't realise that the answer was not 50/50 bias. Well spotted.
I also noticed another issue. There will be multiple probes which will all have a common point (e.g. oscillator) and another side which can be probed.


texts: Is this reason why we can let the current source be attached to a grounded?

texts:
In this question,  someone shows me that these two circuit are equivalent. I want to make sure that my idea about why is these two circuits are equivalent, is correct.

The inner resistor of an ideal current source is infinity,and how much current that current source provide to the circuit, how much will the circuit feedback to the current source, I mean if a current of \$x\$ A flows from the current source, then that \$x\$ A current will flow into the same  current source, that is the reason why we can let the current source be attached to a ground.

So if I connected the resistor next to the current source, the equivalent circuit is as below:

Is my thinking right?


texts:
I want to make a linear regulator oscillate.
----------------------------EDIT------------------------------------
I change the PNP transitor by a PMOS and I corrected the polarity of the ideal opamp.
----------------------------EDIT----------------------------------
Here is my linear regulator:

I have done an AC simulation to get the open loop transfer function:

It seems that if I am able to add a gain (constant in function of the frequency) equal to -123 dB by using a perfect op amp, it will oscillate. In this way at a certain frequency, I will have :
$$|G(s)H(s)| = 1 $$
$$arg(G(s)H(s)) = 180° $$
I added this op amp as follows:

Nevertheless it does not oscillate.
Why not?
The new open loop gain is the following which does not respect the criteria for instability:


texts:
I'm planning to use this MOSFET to switch about 1.5A at 5 Volts. But the datasheet is a bit confusing. All voltages are positive, even though they should be negative, shouldn't they? This confuses me a bit. I'm thinking of a circuit like this:

So will be there a problem?


texts:
I was reading these slides about receivers architectures, and I have some questions about Zero - IF receivers:

Precisely:

Why is the spectrum around the carrier (i.e. the 2 "side bands") mirrored after the demodulation?
From what I read it seems that this kind of receiver cannot work with signals with asymmetrical spectrum around the carrier frequency. But in theory, AM and FM spectrum are symmetrical. So, is that a limit for this receiver?


texts: voltage selector circuit for programming microcontrollers

texts:
I have a microcontroller that has a VPP pin which requires 12 volts to enable programming mode, 5 volts for normal mode, and 0 volts for reset, and I want to achieve all these modes without manually connecting the pin to each of the voltage sources.

So far, I'm able to control whether it receives 0 volts or one other voltage source simply by connecting VCC to a resistor and to collector of an NPN. The emitter of the same NPN is grounded, and If I apply 5 volts to the base, then the output at collector is at zero. Otherwise its at VCC.

Can I somehow achieve a similar effect with two NPN transistors where they both control the same VPP pin on the microcontroller without blowing anything up?


texts: I have a 12Volts, 2Amperes transformer and I need a lower voltage and lower current power source for my other components. I want to know how to make a step down transformer i want to lower it up to 5Volts and 750mA... Can I make it that low?


texts: How to evaluate normative requirements for a new device/design?

texts:
I realize that this may be "opinion based" but I would like some general advice and feedback anyway and it is a engineering question after all.

I often feel overwhelmed by the sheer amount of information available with respect to European technical standards (EN standards) alone. There are just so many things to consider and most papers are for purchase only. So figuring out what documents to acquire is a first hurdle.

Working with only one or two engineers per project, I have a hard time feeling confident that we took everything important into consideration.

So far, we (small company) were mostly concerned to meet the basic safety aspects and to design with EMC in mind. Then we went to a EMC testing facility and checked that we don't exceed the emission limits, performed susceptibility testing and verified that our product is not sensible to ESD. But so far, it was more common sense engineering, than aiming to fulfill specific requirements with respect to application scope and type of device.

Is it maybe common to consult someone specialized on this topic?
Is there a good reference/book/on-line resource I should be aware of?
What is a good approach to evaluate normative requirements for a new device/design, maybe someone can share some experiences from a real world project?


texts: Troubleshooting NOAA double cross antenna

texts:
I've been trying to recive NOAA automatic picture transmission (APT) pictures for a year now.

I never got a picture with V-dipole, so I decided to build a double cross antenna.  I used 75 ohm coax because here in Italy I can't find 50 ohm cable. I used galvanized gardening wire for making the dipoles.  Why is there no signal? (Sometimes I see it but SNR is only 5 or 10 db.)

If this can help I live in south Italy, in a city named Messina. I have a DVB-T USB stick (RTK820T2.) I built the antenna with wood. I even tried to use a fridge door as reflector. Nothing. I tried all possible settings and softwares. Still nothing. My antenna is at 2 meters up from the ground. I would really like to hear your possible solutions.


texts: Does increasing the current make a thermistor more accurate?

texts: For example, if the resistance/temperature ranges were fixed to 7500ohms (0C) and 400ohms (70C). At 30mA, the voltage would be 225V (7500ohm), and 12V at (400ohms). If the current was to 50mA, it would be 20V at 400ohms and 375V at 7500ohms. So the range between the volts at 30mA is smaller than at 50mA. Does this increase in a range increase the accuracy of a thermistor, if the analog signal is converted to a digital signal with a 10-bit ADC? If this doesn't increase accuracy, what will?


texts: Default-on, latch-off, MOSFET power switch

texts:
I'd like to build a low-battery circuit. It should default on when first connected, but if a particular signal goes high for a small amount of time (say, 10 microseconds,) then it should turn off, and stay off.
It's the "default on" that gives me trouble. The closest I can get is something like this:

simulate this circuit – Schematic created using CircuitLab

From null, "OFF" is floating. Supply 15V, and the capacitor starts out acting like a bit of wire, which pulls the M1 N-channel gate high, which makes the N-channel conduct (I'm likely to use a BS170, not the IRF on the schematic.) That pulls the gate of the P-channel M2 low, which makes it conduct. That, in turn provides voltage into R3/R2 divider that keeps the circuit latched open.

Now, when OFF goes low-impedance to ground, it will turn off M1, and thus R1 will pull the M2 gate high, and M2 will turn off. Because C1 already has a charge, the system will now stay with M2 turned off even if the OFF signal goes high impedance again (which it will, because it's a MCU output eventually powered by the SWITCHED voltage.)

At this point, the system is unlikely to turn on again unless I short "OFF" to "+15V." In fact, I may add a pushbutton to do just that for manual turn-on.

While off, the leakage through C1 and the leakage through R1/M1 (and, I guess, leakage through M2 and the entire powered subsystem) will still draw a little bit on the battery, so if it's a LiPo, I shouldn't leave it in that state forever or it will die, but as a safeguard for a hobby robot, I think it might work.

Is this correct, or am I getting something wrong? Will the system oscillate when the "off" is triggered? Will the system automatically turn on from "zero" as intended?


texts: Different outputs of a sensor in its recommended load range

texts:
I want to use this sensor by using 5V supply voltage and I do the connections as shown in its datasheet. According to he data-sheet the minimum load is 80k which means I should use less than 80k.
But when I use different resistor values I get very different outputs and Vsupply is 4.96V in both cases:

For instance, using a 15k load I get 1.08V output; and if I use a 22k load I get 1.48V output. Both loads are less than 80k but I get very different results. What could be the reason?


texts: Code to add two 4bit numbers in verilog doesn't work

texts:
I have a code that adds two 4 bit numbers; unfortunately it is not working for every case even though the formulas are really simple and I don't find the problem...

module part2(SW, LEDG, LEDR);

    input [17:0] SW;
    output [17:0] LEDR;
    output [4:0] LEDG;

    //Red lights for each one
    assign LEDR[17:0] = SW[17:0];

    //Wires between adders.
    wire carry[2:0];

    //Add the first digits of A and B
    full_adder F0(SW[4], SW[0], SW[8], LEDG[0], carry[0]);
    //Add the second digits of A and B
    full_adder F1(SW[3], SW[1], carry[0], LEDG[1], carry[1]);
    //Add the third digits of A and B
    full_adder F2(SW[6], SW[2], carry[1], LEDG[2], carry[2]);
    //Add the last digits of A and B
    full_adder F3(SW[7], SW[3], carry[2], LEDG[3], LEDG[4]);

    endmodule

module full_adder(A, B, CI, S, CO);

    input A, B, CI;
    output S, CO;

    //Sum
    assign S = A ^ B ^ CI;

    //Carry out
    assign CO = (A & B) | (CI & A) | (CI & B);

endmodule

It seems to work for most cases but look what happens with 1 and 10:


texts:
I ran across some code that is being used to create a 1ms timer in polling mode, not interrupt mode. However, I'm having a hard time wrapping my head around the function.

So the Systick is configured like this:

Systick->LOAD = 19999UL;
Systick->VAL = 0UL;
Systick->CTRL = Systick_CTRL_CLKSOURCE_Msk | Systick_CTRL_ENABLE_Msk;

So this makes sense. The systick is configured for a 1ms reload value (processor system clock is 20MHz). The systick is enabled but not setup for interrupts, but rather polling.

Now is where I get confused. The following code handles the polling of the systick register:

if(SysTick_CTRL_COUNTFLAG_Msk == ((Systick->CTRL) & Systick_CTRL_COUNT_FLAG_Msk))
{
    Systick->CTRL |= Systick_CTRL_COUNTFLAG_Msk;
    Timer_ms++;
}

So I'm confused about the line

Systick->CTRL |= Systick_CTRL_COUNTFLAG_Msk;

I don't understand why this line is there. When you read the control and status register, the countflag bit resets according to the spec. So why is the code setting the bit to 1 after it was already 1 and reset via the read?

Thanks.


texts: Building a power supply, Mysterious voltage jump?

texts:
I have been building a 28V linear power supply to power a vintage military radio. I want it to be as simple as possible,o I built it with a 120-30VAC transformer, it then runs through  bridge rectifier diode.

The voltage coming out of the diode is 26VDC which is close enough for those old radios. But when I wire in a capacitor to smooth out the signal the voltage jumps up to 40VDC regardless of the value of the capacitor I use. I have tried a 50V 3300 microfarad capacitor and a 28V 6600 microfarad capacitor. I am not using any kind of voltage regulator IC because I didn't think I would need one if I could just get the power supply to output the voltage I want. My main question is why does the voltage jump so high after the capacitor and how can I fix it? I have included a wiring diagram for the circuit I made.


texts:
I'm adding a 'mute switch' into my XLR cable.

To mute an XLR cable/Phantom powered microphone you temporarily connect pin 2 and 3 in the cable to short the connection. I have seen plenty of youtube videos and tutorials online of people doing this to add quick mute buttons and stuff into their podcast setups.

The difference with what i'm planning is instead of a momentary switch like a lot of people make, i'm going to add an SPST switch, so that I can flick a switch and mute my microphone for long periods of time, and only enable it when I want to.

Will there be any risk to my equipment when I mute the microphone and short pins 2 and 3 for long periods of time?

If it helps, the microphone and usb interface in my setup are

https://eu.audio-technica.com/AT2020

https://focusrite.com/en/usb-audio-interface/scarlett/scarlett-solo


texts: DC analysis of common source MOSFET circuits to find gate voltage using different power supplies

texts:
simulate this circuit – Schematic created using CircuitLab

strong text

I am solving problems on DC analysis of MOSFET circuits. We are supposed to find various parameters like Id(Drain Current) and voltages at various nodes like Vg(Gate Voltage).

The MOSFETS used are both NMOS(n-channel enhancement type)

In my book, where circuits of first type are concerned, Vg is given by

Vg=[R3/(R2+R3)]*Vdd  ____________ eqn 1 (I figure this is because resistors R3 and R2 form a voltage divider network. Correct me if i am wrong)

However for circuits of second type, Vg is calculated by

Vg=[R3/(R2+R3)]*(Vdd-(-Vdd)) - Vdd _______________ eqn 2

I don't understand why Vdd is being subtracted. I scanned all the pages of my book looking for a one-line explanation but didn't get any. I also tried joining the 2 nodes to form a third loop and then use KVL(Kirchoff's Voltage Law) but I just don't get it.

Can someone explain me the equations 1 and 2?

PS: This is my first question on this site so general tips about asking specific,easy to read questions and courting quick answers will be appreciated.
Have a good day.


texts:
I am designing a circuit that needs to have 18 thermistors to measure the temperature at various points.
The thermistors are 2metres+ away from the ADC
Usually when I power a thermistors I use a Vref IC and an opamp buffer. I also take the op-amp buffer into the ADC ref for ratiometric measurement. With 18 Thermistors and 2-3mA per thermistor, that's getting up to 50mA+ and beyond the current output of op-amp buffers.
How should I do this many thermistors in parallel? Should I split them up into say 3 blocks of 6, with 3 six channel ADCs and have 3 op-amp buffers from the Vref?
Or should I do all 18 at once with 1 op-amp buffer
Should I even be using an opamp buffer?


texts: Is this way proper to create differential inputs from a function generator for this setup?

texts:
I have soldered an RS485 to TTL converter on a board and want to test it. The thing for a test, I need differential inputs as DATA+ and DATA- and I don't have a sensor which outputs differential signal at the moment.

So currently below is the diagram in my mind:

A μC board is supposed to receive the converted TTL signal. The μC board is powered through the USB of a laptop. The laptop uses an adaptor which is not earth grounded aka floating wrt earth.

Now to create differential inputs to the transceiver, I want to use a function generator named as Fungen in the above diagram. The function generator is mains earth grounded.

I plan to use two 100 kOhm resistors and wire the middle connection to the ground of the transceiver which is also connected to the μC ground as shown.

Is this way of creating differential inputs correct without any worry about CM voltages ect?


texts:
I’m new to electronics and I got the SainSmart LCD keypad Arduino shield from Ebay.
I’ve got an Arduino Mega 2560. I have been able to load the “ADC Key Testing” sketch from the seller, nichegeek but, I can’t seem to get any others to work, i.e., Autoscroll, Display, etc. from the example codes that come with the Arduino 1.0 software amp “GuessTheNumber” found elseware without getting a lot of error messages. I loaded “Hello World!” and it compiles amp loads fine according to the Arduino 1.0 but, the shield doesn’t respond or show the message. The LED on my Mega flashes, so I know that it sent. However, while looking the code over, I saw that the pins in the sketch are calling out : LCD RS pin to digital pin 12, LCD Enable pin to digital pin 11, LCD D4 pin to digital pin 5, LCD D5 pin to digital pin 4, LCD D6 pin to digital pin 3, LCD D7 pin to digital pin 2, LCD R/W pin to ground, 10K resistor: ends to +5V and ground, wiper to LCD VO pin (pin 3), which are different than what the docs (from SainSmart) say this uses. I tried to figure out the correct pins/locations but have had no luck.
Hope you understand what I am talking about.


texts: How come RTOSs are considered deterministic?

texts:
On a pc (an OS of course) any C program becomes indeterministic in terms of timing. For instance a loop takes between 1.2 and 1.3 seconds depending on "how fast I am moving another window". It is because the OS makes processes (or threads) share processing power.

As far as RTOSs are concerned (on an embedded system), when we write a multithreading application, I think the same thing happens depending on how many threads are executing concurrently.

I do not have instruments to test this accurately on an embedded system. Thus, I wanted to ask. Is my concern reasonable or am I missing something very fundamental?

EDIT: I will give an example. we have task1(takes 10 ms) and task2(takes 20 ms). They started at the same time on separate two threads. My claim (also concern, not sure) is that task1 takes more than 10ms, because they share processing power with task2.


texts: I have a question which I can not give an answer even if it is some days I am thinking about that. In general a INS is made by an accelerometer + a gyroscope. Is it possible to obtain the same information using accelerometer + magnetometer? If it is possible what are the pros and cons of this new solution?


texts:
I need to replace a burned-out diode.

It is marked P6KE16A 240K.

What do these numbers mean?  Is there any information encoded?  (e.g. 16A, 240K-Ohm)

Is this information sufficient for sourcing a new part? I can't find an identical part.

I can find a part (here) that matches P6KE16A -- how can I know whether it is a suitable replacement?


texts: how many low observable signals in iscas benchmarks do we have?

texts:
How many low observable signals in ISCAS benchmarks do we have? For example in c17, c432, .... I mean in a circuit there are some signals we don't see them for example 99% of times in output, and we see them just for example 1% of times in output.
Do you know any tools for finding low observable signals in a VHDL code?


texts: 8 ohms and 4 ohms speakers wired in series - volume issues

texts:
I have two identical sets of ceiling speakers connected to a cheap 2 channel Chinese micro amp - one 8 ohms and one 4 ohms, wired in series per channel.
The 8 ohm speaker is too loud when the volume is set ok for the 4 ohm speaker.

How can I reduce the volume of the 8 ohm speaker so they are more evenly matched?

Would a resistor make sense here? If so, what rating?


texts: Need uninterrupted power to car power socket, even during ignition on/off, direct battery tap only option?

texts:
I have a carputer setup with a Nexus 7 tablet and a Carlink wireless carplay adapter connected via OTG splitter cable to the tablet. I have a problem in which the carplay dongle needs constant power to operate properly without resetting itself which often requires the tablet to be restarted to bring the dongle back online and get carplay up.

Needless to say, its a hassle to have to restart the Nexus with every time I start and stop the car ignition.

I need to solution in which I can supply a constant source of power to the tablet and the dongle.

I believe my options are 3. Any suggestions much appreciated for these or any others I may not have considered:

Wire a circuit directly to the battery to avoid any interruption or power drop when the ignition is toggled on/off.
Tap an existing constant 12v circuit such as hazards, power seat, etc. I believe possibly drawback here is that the ignition toggle may still interrupt power for a split second, long enough to cause the dongle to lose power and reset?

Add a Jumper to relay controlling the accessory power socket I've currently got the tablet connected to. The jumper on the relay makes the socket hot continuously rather than on just with accessory. This may also be subject to power drop during ignition toggle?

Get a "pass through" USB portable battery pack and connect to the power socket so that when the car is off, the tablet and the dongle draw power from the USB battery pack and when the car is on, they draw power through the car battery. I can verify that this is subject to voltage drop during ignition toggle, but it may just be that my tiny 3500mah Jackery battery pack is not sophisticated enough to switch from car battery to pack battery and vice versa, without dropping power.


texts: Is there a component/method that can take any signal, then increase it to 5 volts no matter how small the signal is?

texts: I was using a logic level MOSFET that should turn on when a voltage other than 0 volts between two points is detected. My problem is that the voltage is at times less than 5 volts and probably won't activate my logic level MOSFET. I need to know if there's such a component that takes any input voltage (0.1V or higher) then outputs 5 volts unless the voltage is 0.


texts: Why does my CD 40106 and CD 4069 inverters have such a bad output signal shape at 10 MHz?

texts:
I am measuring both the 10 MHz (5V pk-pk) input signal, and the output signal of the above mentioned inverters. Why does the output signal looks so much different than the input? I have decoupling capacitors on the supply, near the chips, the supply is stable, there are really no differences between the measurements, other than that I am probing a different pin.
The images below are the result of the CD 4069, but the CD 40106 schmitt trigger version produces very similar results as well.
Input, which looks exactly as I expected:

Output:

I forgot to adjust the probe scale on the scope, this is why you see these high numbers, but I am doing it with 1:1, and the levels are good.


texts: How does a wireless and batteryless pushbutton work?

texts:
I saw this ZBRT Transmitter for Wireless and Batteryless pushbutton and I bought one:

I don't know how it works. Could anyone explain?


texts:
I am trying to make a simple Press ON - Hold OFF latching circuits using a momentary swicth. Here is a very well explained method. I made the exact same as fig6, with same passive value, but using differents MOSFET : Si2312CDS and Si2333CDS. Also not I am using a Schotkky diode MBR0530 instead of the BAV99. My main power is a regulated 3.3V. I fixed the Auto-OFF configuration, as I would like the system to stay switch OFF at boot.

Here is my exact schematic :

The left part is the 3.3V regulation from a sigle cell LiPo battery. On the right end the POWER_OFF signal is controled by a microcontroller GPIO in order to switch OFF by software.

After soldering a prototype, some functions looks to be OK :

Press ON : it is powering ON when short press is applyed to switch
Hold OFF : need to hold the switch for several second to switch OFF the system

But I also have an unwanted behaviour :

when OFF, it automatically switch ON after 2 seconds or so...

This does not look like the Auto-OFF(/ON) feature, even if at first boot the system goes ON (after 2 seconds) but we are in Auto-OFF case... It is more because it does not keep the OFF state...

Maybe because I use the Si2312/33 MOSFETs, that have Vgs different that the recommended iRF7319, and the passive components values are triggering the switch ON procedure ???

Does anybody can help me looking for the issue ? I can stick my oscilloscope into the system, but I am not sure to know what I should see...

Thanks


texts: How to implement a delayed release for a reset button?

texts: I have a microprocessor with two lines, /RESET and /HALT, which are independently pulled to +5V DC.  To reset the processor, both of these lines must be grounded for at least 100 ms -- they may not be wired together and treated as one line.  How do I create a circuit such that, when a single DPDT reset button (debounced) is pressed, both of these independent lines are grounded, and when it is released, they stay grounded for at least 100 ms?


texts: Use a single GPIO for Multiple Uses (TMS320F2803x MCU)

texts:
My question is regarding a pin(s) on an MCU, specifically a TMS320F28035, that has multiple functions. Pins 57-60 of the 80-pin QFP version of this MCU are GPIOs but also douple as JTAG pins TCK, TDO, TDI, and TMS, respectively. In fact even the TCK pin could also be an XCLKIN, but that isn't where I am going to take this discussion. Here is the actual question:

If JTAG is only used when I initially program the MCU, or diagnose issues in units that were deployed in the field, could I use the pins as GPIOs when not being used for the JTAG function? Is this a bad practice? If I can do this, is there a good way to do it through firmware?

A quick thought on the firmware approach, I was thinking of using a flag on the TRST input, which is a dedicated pin, that way if 1 (connected to JTAG) use the above GPIOs as JTAG pins, else if 0 use GPIOs for other functions.

Thanks in advance for any help!


texts: Can FPGAs dynamically modify their logic?

texts:
It would be theoretically possible for an FPGA to write a configuration image to an external memory, and load the configuration image from the memory to reconfigure itself. This would be "non-dynamic" reconfiguration.

Do FPGAs have the ability to rewire their logic fabric dynamically? Indeed, while flip-flops can have their value modified, I have not heard of dynamic reconfiguration of the look-up tables and internal wirings that make up the logic fabric.

Can FPGA internal logic (other than memories) be dynamically modified? If not, why not?


texts: Heat dissipation zener diode and resistor

texts:
I have the following circuit

When I am testing the circuit with 5V USB 3.0 power supply, the zener diode and/or resistor
does not build heat up. Using the 18650 7.4V battery makes it build heat. The ATMEGA328P only use its TX and RX pins so I am just using minimal current in that part. Why is it that using 18650 7.4V battery makes the resistor/zener diode heat up so much?


texts: Are Ethernet (copper 10/100/1000) compliance tests mandatory?

texts:
The IEEE 802.3, for Gigabit Ethernet, and supposedly the ANSI INCITS 263*, for the Regular and Fast Ethernet, have lists of signal quality requirements, which are generally tested using the so-called Ethernet Compliance Tests.

The dogma I was exposed to during my education, is that every serious Ethernet product needs to pass the compliance tests for the supported types of Ethernet it's using. Therefore, the tests are mandatory and must be done.

However, I never found an explanation why the tests are needed. I know that the regular EMI tests are needed because the agencies responsible for spectrum regulation (should) police the spectrum. For USB, the USB logos are copyrighted and compliance tests are among things needed to get the license to use the logos.

So my question is:
If my device passes EMC tests, and my Ethernet magnetics pass isolation tests, and my Ethernet port works with a crappy 100 m long cable,
 is there some sort of Ethernet police which can come and get me, if I say that my device has Ethernet port, but I did not do the Ethernet compliance tests?

Background: General answers are very welcome, but I'm particularly interested in EU and USA regulations, especially those covering medical devices.


texts:
I'm trying to drive a strip of WS2812B LEDs with a Beaglebone Black(revC). Because the LEDs expect a data signal at 5V and the BBB outputs at 3.3V, some sort of level shifting is required.

However, when using either a 74LVC245 or a 74AC245 chip to adjust the voltage level, the strip begins flashing erratically, as if the signal were corrupt or not at the right level.

The strip works if I connect it directly to the 3.3V output because 3.3V is just high enough to register as a one, but the signal fades after about 160 LEDs and the random behavior resumes.

Things I've tried:

Connecting 3.3V and GND to the level shifters and confirmed that the output 5V and GND, respectively.
Adding a 100uF capacitor between the power and ground lines to smooth the power supply.
Touching the ground plane. I found this by accident, but it appears that I can actually fix the flashing issue by touching the ground plane of the circuit. I suspected that this was due to me introducing capacitance into the circuit, which is why I tried adding a smoothing capacitor.
Powering the LEDs both from the same 5V at 2A power supply, and from different power supplies.

Altogether, I'm stumped. I've already tried everything that comes to mind, but none of it has worked.


texts:
I followed the below procedure to design a 700MHz 1/4 wave monopole PCB antenna.

Is this correct?

  a. The trace length decided to match with Wavelength of the frequency

   Wavelength (Lambda) = Wave Velocity (v) / Frequency (f)

                =299792458 /700000000
                =428.2/4
                =107mm
    So, the trace length =107mm.

 b.Trace width decided by microstrip 50 ohm impedance matching calculation

So, the trace width  =51.9mils

How to decide the gap between two trace line? Is there any calculation?

Please guide me.


texts: To use my sensor I need to supply 24V. So I converted 4.5 V from battery pack to 24V and converted it again to 0-1.66V using a voltage divider. So far I can read the output of the sensor using the wifi module ESP 8266. However, the value is slightly floating (~4). Is there any way to eliminate this floating?


texts: 74LS163 Counter Exhibits Constant Voltage on an Input Pin

texts:
I built a circuit that uses the 74LS163 synchronous counter. I am using in such a way that I reset the counter, using the /clear input pin, externally via and LPF connected to a tactile switch.

The design works fine, except that I am getting a strange output voltage from the clear pin. A block diagram presented in the datasheet for this pin is:

So, clearly the clear pin is an input to a gate, so how could a constant voltage appear at this terminal? Specifically, I am observing a ~1.41V on this terminal when it is left floating, and 1.11V when connected to the LPF with the switch fully depressed. I thought perhaps there was some excess charge at the transistor base, so I directly tied the clear pin to ground to discharge it. Upon removing this pin from ground the ~1.41V returned immediately.

The schematic I have wired is as follows:

When the switch is fully depressed, the capacitor will only discharge down to 1.11V. If I disconnect the clear pin from the capacitor anode then the capacitor will fully discharge to 0V as expected, so something is going on here that I cannot explain. I tried replacing the '163 with different physical device to rule out a malfunctioning chip, but the device I replaced it with also exhibited this behavior.


texts: Can I safely replace flat Lipo battery with a Li-Ion round battery pack on a constantly powered device?

texts:
I did some research, but didn't find the exact situation.
I have a device that has a battery inside and is powered by a 5V 4000mA USB-C charger. The device requires the battery to be connected at all times and won't turn on if the charge is less than 5%. The device is constantly connected to the charger when in use anyway, but it simply requires the presence of a battery.
The original battery was 3.7V 6200mAh 22.92Wh flat Lipo pack, made of 2 parallel 3100mAh batteries connected to a protection circuit.
I only found 2 batteries of the same size:
1; 3.7V 6600mAh LiIon pack made of 3 parallel round batteries 2200mAh each
2; 3.7V 3000mAh LiIon pack made of 2 parallel flat batteries 1500mAh each
Even though the device is connected to the charger, it still drains the battery while in use and when turned off it takes around 20 - 30minutes to recharge. So I suppose the battery is somehow used alongside the charger. Is it safe to use any of these 2 battery packs?


texts:
I have a question regarding the equivalent circuit for a solar cell.

The circuit includes a diode to model the p-n junction of the cell. When some part of the photo-generated current flows through the diode, what physical situation does it imply? Does it mean that the photo-generated electron-hole pair at the junction, move according to the depletion field (hole towards p-type and electrons towards n-type) giving rise to the photo-current and some portion of this current flows as a diffusion current (holes towards n-type and vice versa), creating the diode current?

I just want qualitative arguments as an answer.


texts: Which ARM Cortex M chips allow for execution from RAM?

texts:
I've been playing around with writing operating system-like software, mostly as a self learning experience.  I've been doing this on the Atmel AVR processor, since it's simple enough for me to understand and get a program going quickly.  I now want to move into an architecture in which the user stores programs that are run in RAM.  I know that some Cortex-M chips can run from RAM, but I've heard that this is not universal.  I've checked out the datasheets for a number of them from a few different manufacturers, but I can't find any reference to execution from RAM.  For what it's worth, I have one of these: http://www.nxp.com/assets/documents/data/en/data-sheets/KL27P64M48SF2.pdf  I also have an Atmel SAMD-10, but I hate the ASF like rats so I'd rather avoid using it.

Can the chips I have execute from RAM?  Is there anything I should be looking for in a datasheet that indicates whether or not this is possible?


texts: How will current divide in a LED matrix in one select line when there are 8 data lines?

texts:
simulate this circuit – Schematic created using CircuitLab

Let's say I have a select line that is connected to 8 data lines in an LED matrix. The current at the drain of the MOSFET is 800mA. Will the current divide among the 8 LEDs into 100mA for each data line? And if so, does that mean the current in the wire between the first and second diodes on the select line is 700mA, the second and third diodes 600mA, and so on?


texts:
I have a requirement where the diagnostics of a vehicle has to be carried out using BLE. The number of read/write parameters would be over 300.

I had worked on BLE devices in a wearable application where the attributes were around 12-15 (using GATT).

Is BLE the right choice for over 300 parameters in different profiles?
What kind of BLE profile and UUID type can be used for this?


texts: Distance requirements in antenna arrays?

texts:
Antenna array is a broad term and it encompasses at least the following concepts:

MIMO or massive MIMO: for spatial multiplexing
beamforming: increasing the SNR (at transmitter or receiver) by aligning the signals properly
phased array: special case of beamforming for narrowband signals in which the phase can be adjusted to align the signals. Mainly used in transmitters to stear a beam into a certain direction without mechanical movements. Used in RADAR.

Please correct this list if it is wrong or if I have forgotton something.
I could also think of cases like increasing bandwidth by having many narrowband antennas in parallel - not sure if this is done in practice?

It is well known that the size of an antenna has to be on the order of lambda/2 but conventionally larger than ~lambda/10.

Suppose for a moment I would have a hypothetical isotropic radiator (an infinitely small antenna able to radiate at any desired frequency).

Are there upper (or lower limits) on the distance between the individual antenna elements in antenna arrays (for the cases listed above)?

Stated differently, can antenna arrays be decreased in size if the antenna elements themselves can be decreased in size?


texts: Capacitors in series, equivalent capacitance to reduce voltage rating

texts:
For example, I need 100uF 60V capacitor for filtering in power supply. The DC source is about 40V, but I have 400uF 20V capacitors.
If I arrange four of them in series I got in total 100 uF and each capacitor has a voltage drop of 10 volts according DC source.
Thus, can I replace 100uF 60V capacitors with four 400uF 20V capacitors in series? Are 20V capacitors OK?
How can I design symmetrizing resistors for it?


texts:
Ok so here's my idea to run backup 12V DC motor power, but I'm stuck on a part of the wiring.

120V AC Plug---> 120V AC to 12V DC Converter---> SPDT Relay (This is where I'm stuck. How would you wire a relay in the event that the 12V DC converter is not putting out any power so that power can then be drawn from a backup battery..I think you need a solenoid in there too but I'm not sure how)--->12DC Pump


texts: Maintaining constant gain through impedance coupling

texts:
Para_1

The following discussion is about type of coupling involved to couple rf amplifier with the mixer. The coupling involved is impedance coupling in which Lm provides a shared mutual impedance between two stages and provides coupling.The higher the Lm higher is the mutual impedance and higher is bandwidth.

Now one requirement that needs to be fulfilled in Vhf tuner circuit is that the gain should remain constant at all frequencies of the entire vhf band(that need to be coupled). According to the figure L2//C2 and L3//C3 is not coupled directly so there is no transformer action between them. They are only linked via Lm.

Para_2

So to make gain constant for whole passband and to achieve this special techniques are being employed and one of them is involving mutual inductance to manipulate the gain in predetermined way.
The equivalent mutual inductance m is the sum total of various planned and unplanned coupling prevalent in the primary circuit.

The eq. mutual inductance m, seeks to maintains its value constant around every frequency of the vhf broadcast band. This is possible because m has two component one is fixed and other is variable with frequency. This variable component is higher at high frequency. This variable second component is subtracted from the fixed one so m is less at high frequencies and at lower frequencies vice versa making m a little high. So in both of these cases m has been observed to put its value apparently constant thus maintaing gain constant over the frequency range in demand.

The how does this is possible to maintain gain constant in the below circuit if the circuit is not mutually coupled..??


texts: Increasing speakers impedance by adding resistors

texts: I've got a (pretty dumb) radio which increases volume by digital dB, and not some analog device. Thus it goes something like { Mute, -75db, -65db, -56db, -49db, etc }. Now I use this radio basically only at night, and the problem is, -75 is too silent, it's hard to hear that, while -65 is too loud again. The radio is a stereo setup, with the speakers having 6 Ohm impedance. If I introduce for each speaker lets say a 6 Ohm resistor, would that half the volume, and just that, or would it have some sort of effect on the sound I am getting? I only found (http://www.tdpri.com/forum/amp-central-station/200037-changing-impedance-speaker-resistor.html) as reference, and did not really find an answer to that.


texts: Simultaneous reading of multiple I2C devices with the same address

texts:
I'm a teacher of a secondary school in the Netherlands. My students are working on a sun sensor placed on a moving object, with which the attitude w.r.t the sun is determined. A couple of ambient light sensors (BH1730FVC) in different directions are used for this. The sensor data is processed by an Arduino. The ambient light sensor have a I2C interface and all have the same address.

The sun senor has 3 groups of 4 ambient light sensors. One group must take a measurement simultaneously. To work properly the sun sensor needs light intensity data from all sensors in a set measured at the same time. Time shift between measurements introduces an error in final output. To minimize this negative effect, conversion is triggered in all sensors exactly at the time. In order to do this, all four sensors in a set are connected in a special way.

The idea originates from a PW-Sat2 Cubesat project. See attached page from the CDR.

The SCL lines are connected and the SDA's are per sensor connected to a GPIO pin of the MCU. A procedure for Writing and reading is described.

Questions

Has someone an Arduino example code for the type of I2C connections? I was thinking to use SoftWire, but my experience in this field is limited.
Are there (better) alternatives to simultaneously read I2C sensors with the same address?


texts:
Obviously reverse voltage has to be higher than V+, but are there specific requirements regarding speed and current? Is a 1N400x fast enough? What about a 1N4148?

edit
The question is a general one, but I can pick a relay to make it more specific: the Takamisawa 24SMB is a 24V relay with a coil resistance of \$1000 \Omega\$.


texts: Load Sharing charging circuit for Lithium polymer

texts:
Charging lithium battery while at the same time trying to use circuit didn’t quite workout, with problems like the circuit not turning on and the battery never finish charging.

The battery is 3.7V and capacity of 300mAH.

However I found the microchip app note on same issue.

Here is circuit:-

When USB power is applied at Vin this circuit will turn off Q1, and then the load will instead use power from USB through D1. This allows the battery to charge normally without any outside disturbances.

The Q1 is P channel MOSFET, but I am not able to understand the
connection. Why source is connected to load and Drain connected to
Vbat? It should be reverse.
Which MOSFET should I select for this circuit? If my Load Current is
100mA max? What should be the Rd (on) and VGS(th) of the MOSFET which
I can use in above circuit? Any suggestion for the part number

I am considering this P-Channel MOSFET DMP1045U http://in.element14.com/diodes-inc/dmp1045u/mosfet-p-ch-w-esd-12v-sot23/dp/2061526

I am considering Diode B130LAW :- http://www.farnell.com/datasheets/887879.pdf?_ga=1.83230549.251839788.1488841003

Also D1 is to prevent current flowing from the battery into the charging power source. D1 should be a schottky diode. The reverse leakage current of D1, which could be up to a few hundred microamp (schottky diodes are very leaky).

This leakage current will create a small voltage at the MOSFET gate
which, if high enough, could cause the MOSFET to not turn back on
properly when the main Vin power is removed. How to overcome this?
How to minimise the leakage current of D1?
What should be the Value of Rpull ?


texts:
see this picture given below, they are not given terminal row spacing then how to design land pattern for this dip package,and if they didn't given in datasheet how to take terminal row spacing from given values.
thanks for your help


texts: Why are currents IQ2 and IQ3 in this circuit the same, but is IQ1 larger (image)

texts: I was wondering why IQ2 and IQ3 have the same current values, but why the current value of IQ1 is larger. All bases of the bipolar transistors are connected to the same current. I would expect all three currents to be the same


texts: How to calculate the frequency of oscillation of this low-pass phase shift oscillator?

texts:
In the following phase-shift oscillator a low pass network is used instead of a high-pass network.

simulate this circuit – Schematic created using CircuitLab

Usually the frequency of oscillation for a high pass is given by:

$$ f_{oscillation} = \frac{1}{2\pi RC\sqrt{6}}$$

However, I'm I don't really know how this is derived, I just use it. For the this circuit, how would one calculate the frequency of oscillation?

With the given values of R= 2.2Meg and C = 1uF, LTspice gave a frequency of about 0.174Hz.

(In the actual simulation I amplified Vsin)

Thank you.


texts: Power supplies with medical safety approval

texts:
Regarding the data sheet of this SMPS power supply. In the first page it says:

  2 x MOPP Medical safety according to AAMI/ANSI ES 60601-1:2005(R) and
  IEC/EN 60601-1 3rd edition

Then I googled to read about IEC 60601 and I found this article.

In the article it is written:

  It is the MOP (Means of Protection) used for medical device
  requirements to protect both the operator and the patient from
  electric shock.

As you know most of the power supplies have leakage parasitic capacitance and a phantom voltage can be measured sometimes upto 100VAC between any of DC terminals and the earth. This sometimes causes unpleasant electric shock which is not dangerous. But it can still be unpleasant.

My question is, is this medical approved power supply does not have this problem? Or by "medical safety" do they mean dangerous electric shock not the parasitic capacitive coupling?


texts: PIC12 TRIS Register not setting, No GP0 GP2 output

texts:
I originally asked the this question on Stack Overflow.  I think here would have been a better audience.

I'm trying to program a PIC12C508A to do a simple LED learning circuit.  I've read some examples, the Microchip Datasheet, pic12c508a.h and pic12c508a.inc.  I've tried to set the TRIS register using a C program and an ASM program but it does not take.  Using MPLAB X, the XC8 compiler, and the built in simulator to check the SFR registers I can see that the TRIS is not updating even when the WREG holds the correct values.  If anyone has experience with this please check out my code and see if I am doing something wrong.

#include <xc.h>

// -- CONFIG
#pragma config MCLRE = ON       // RA5/MCLR/VPP Pin Function Select bit (RA5/MCLR/VPP pin function is digital input, MCLR internally tied to VDD)
#pragma config WDT = OFF        // Turn Watchdog Timer Off.
#pragma config CP = OFF         // Flash Program Memory Code Protection bit (Code protection off)
#pragma config OSC = IntRC      // Internal RC Oscillator

// -- Internal Frequency
#define _XTAL_FREQ 400000

int main()
{
    OPTION = 0b11011111; // Added this from feedback on Stack Overflow
             //--0----- Clear T0CS per PIC12C508A datasheet on using GP2 as output

    TRIS = 0b111010;  // 0x3A
           //---0-0 Set GP0 and GP2 as outputs

    GPIO = 0b000100;  // 0x04
           //---1-0 Set GP2 as HIGH and GP0 as LOW

    for(int countdown = 10; countdown > 0; --countdown) {
        __delay_ms(60000); // Delay 1 minute.
    }

    GPIO = 0b000001;  // 0x01
           //---0-1 Set GP2 as LOW and GP0 as HIGH

    while(1)
        NOP();
}

I also tried it in assembly which is pretty much identical to the Gooligum tutorials for baseline PIC models. (Update: I have not tried to set the OPTION register in ASM yet.)

  list  p=12c508a
  #include <p12c508a.inc>

  __CONFIG  _MCLRE_ON & _CP_OFF & _WDT_OFF & _IntRC_OSC

RCCAL CODE    0x0FF   ; Processor Reset Vector
      res     1       ; Hold internal RC cal value, as a movlw k

RESET CODE    0x000   ; RESET VECTOR
      movwf   OSCCAL  ; Factory Calibration

start
      movlw   b'111010' ; Configure GP0/GP2 as outputs
      tris    GPIO      ;
      movlw   b'000100' ; Set GP2 HIGH - GREEN LED
      movwf   GPIO

      goto    $         ; loop forever

      END

This all seems pretty straight forward but when I use breakpoints and examine the SFR registers in the simulator I can see that the GPIO and TRIS registers are never changed even though the WREG will hold the correct values.  I've examined the ASM output that the XC8 compiler generates and it is almost identical to the ASM I wrote when it comes to setting the registers.

I've also tried using HEX values and straight integer values and the results are the same.


texts:
I am working on a project that would look really cool if I was able to put a ring of LEDs (kind of like the one on the TRON Identity Discs) light up smoothly in a circle, rather than have sections of the LEDs light up one by one. I know EL wire will achieve that smooth, uniform look that I want, but I can't get EL wire to light up little by little in a loop.

Are there any ideas? I've thought about writing some script on a microcontroller that lights them up smoothly, but I'm not sure what kind of LEDs I would need for that, or if there may be an easier solution.


texts:
Verilog has a bunch of math system functions.

I'm trying to use $floor in my Verilog code but I'm getting this message:
System function call floor is not allowed here

Does anyone know why I'm getting this message?

I have to say that before asking here I googled and couldn't find any solution.

This is my code to test $floor:

module floor_test();

  parameter kCols = 3;
  integer kCenterX = $floor(kCols / 2);

endmodule

Thanks in advance


texts:
The datasheet is very long and I found it hard to grasp the essential information about the AFE4403 (https://www.ti.com/product/AFE4403). From what I see, it has the following main components: Microcontroller, AFE4403, PulseOx Connectors (DB9-F), LEDs and a photodiode.
My questions are:

What are the functional differences exactly between the Microcontroller, AFE4403 and the PulseOx Connectors? In other words, do we really need all of them? Why can't we connect the DB-9 to the microcontroller without the need for an AFE4403 (or the LEDs and a photodiode to the microcontroller)?
It seems that we can connect 3 LEDs via a common anode. If the LEDs are identical (say infrared with forward voltage and current 3.3V and 1 A, respectively), what is the maximum number of LEDs that we can connect in parallel such that they are driven by the AFE4403 simultaneously?
how to switch between the H-bridge configuration and the common anode configuration (pages 41 and 42)? Do we need to have separate PCBs, one for each configuration?


texts: Opening and reading pixel values from bitmap images in Modelsim

texts:
How do I open a bitmap image, read the pixel data (24 bits) and store it in a memory that I created in a Verilog module in ModelSim?

How do I open the below image in Modelsim? Is it possible in the first place?

If yes, how should I read the pixel data and store it in a 2d-array(memory) that I created as part of the Verilog module?

I have a bitmap image of checker-box.


texts: Programmatically determine the lowest waiting time for character LCD display

texts:
I made working code in an older microcontroller for a character based LCD that's based on the HD44780 chip.

My code stops execution of everything else every 70uS to display one character from the remaining characters that need to be shown. I chose 70uS because I believe that's the worst case scenario for timing.

I have seen command charts that say that the waiting time is only 40uS or 50uS and I seen one that says waiting time is only 37uS.

I am aware that the busy flag exists in the LCD but I also read online that it takes longer for a character to be recognized as completed if I depend on the busy flag. On top of that, I'll be required to put the LCD in read mode and poll the busy flag. I have it hardwired in write mode. (R/W pin grounded).

Rather than constantly modifying my code by playing with the fixed wait time value, Is there an ideal way in code to figure out the minimum wait time for a character to be processed on the LCD?

I'm using an 8051 based microcontroller but answers in pseudocode are fine. I just don't want my system crawling slow all because of an LCD.

In fact, at 70uS, filling up a 16x4 line display with characters means 64 characters + 4 commands to set starting row positions equals 68 bytes to send, times 70uS = 4760uS = 4.7mS which can be pretty high if this LCD is used in a system with a high-speed internet connection and the LCD data needs to be changed in real-time as data is received from the internet.


texts:
We have the function: f = p'c' + pb' + qc
With satisfiability don't cares given by SDC = {pb, q'b', qbc, q'*c'}
The K-map for the function is :
      \ b'*c' | b'*c | b*c | b*c'
p'*q' |   1   |  0   |  0  |  1
p'*q  |   1   |  1   |  1  |  1
p*q   |   1   |  1   |  1  |  0
p*q'  |   1   |  1   |  0  |  0

and using the "don't cares" in the k-map gives the unfilled k-map
      \ b'*c' | b'*c | b*c | b*c'
p'*q' |   X   |  X   |  0  |  X
p'*q  |   1   |  1   |  X  |  1
p*q   |   1   |  1   |  X  |  X
p*q'  |   X   |  X   |  X  |  X

Why does the book say that the minimized function is
f = p'c' + q
when the k-map indicates that the function should be
f = q
Did I mess up somewhere?


texts:
We are looking into the possibility to replace our multi-drop SPI (@10MHz) with an alternative solution that allows for more data through put. I've started to look into possibilities of potentially having some 100BASE system customized by possibly usinng PHYs that allow for TD to be set into high impendance mode. Is Multi-drop even doable in the 100MHz range?

Thanks

edit
This would be for maximum of 16 drops (clients) -> fewer might be possible if required. Distance would be across a 9 inch rack, maybe 50cm.... and it would be lines on a PCB


texts: Are these max-capacitor ratings (for a bridge rectifier) too conservative?

texts:
I'm looking at the Diotec BxxC2300-1500 datasheet (where xx is the max RMS voltage), and I'm a little miffed by the following table, which I've not seen in other manufacturers' similar datasheets:

It seems a little odd that the max capacitance would depend on the max RMS (and equivalently blocking) voltage of the device. Are they assuming that the capacitor is charged to the max voltage the rectifier can output? Because otherwise it doesn't jibe with how other manufacturers present such data or with my practical experience of (ab)using the run-of-the mill DB156 (or even DB107) rectifiers with a 4700uF cap, but at 12V; I've not seen any failures running that for years.

EDIT: I wanted to write this a comment to Olin's answer, but it turned out a bit too long: every bridge rectifier factory from Bulgaria to China makes something like those bridge rectifiers (and even more certainly the DB series). In the datasheets of such generics you can at best read "For capacitive load, derate current by 20%." and nothing more. Either those generics' datasheets are very skimpy of capacitive-load limitations, or this one is very conservative.

Also compare with Vishay's way (fig. 1) of presenting such info, where the derating factor depends on the I(peak)/I(average) ratio but not on the max RMS of the device. For such devices (including Diotec's), IFSM(max peak) and I(average) are the same for an entire series, i.e. they don't depend on max rms.

So I strongly doubt there's something special about Diotec diodes that imposes the dependency on max rms seen in the table, and I think there has to be some calculation that applies to any such device behind that table.


texts:
We've got a mouse in the house. I want to setup traps in the attic, but I don't want to go up there to check them. My thought is to use a simple circuit that uses the trap itself as a switch. I think it needs two circuits: a path for the electricity when the trap is set (circuit A) and a path when the trap has gone off (circuit B).

I think:

Circuit A should be nothing except a resistor. (If it was just metal, the battery would run down real quick... plus... you know... hot).
Circuit B should have a resistor and an LED (and a long pair of wires so we can hang the LED out the attic door and it is visible from the hallway.

When the trap is set, circuit A will have less resistance than circuit B, and thus short circuit the light. When the trap goes off, circuit A will break, and B will then be the only path for the electricity thus lighting up the LED.

Questions:
How do I calculate out what resistors to use?
In terms of power, how do I decide on 9V? 5V? 1.5V?


texts:
I have a 2 Relay module from Sainsmart. http://www.sainsmart.com/arduino-pro-mini.html/

The output has 3 connections instead of just 2. I want to know which two of these three connections I need to wire up. I want to find this out without actually having to connect my final 240V cable.

How can I do this? Is this possible with a multimeter? If yes, how?


texts: Increasing voltage maximum value from 10 mv to 5v

texts:
Since microcontrollers usually don’t have specific ports for measuring currents, but they do have ADC channels through which you can measure analog voltages of a certain range. This means a dc current can be indirectly measured by a microcontroller’s ADC channel by converting the current into voltage by placeing a resistance in series with the current path and measure the voltage drop across it.
My current range is from 0A to 10A , I have chosen 0,02ohm as a shunt resistance so my voltage will be in the range of 0 to 10mV.However, I need to increase this range to a maximum 5V to be measured by the microcontroller
How can I do that?


texts: TRIAC gate resistor keeps getting burned

texts:
R85 in the following circuit keeps getting burned out when the photo-triac is turned on.  It may last for a few minutes before burning out.  It is a smallish 1/10 W resistor, while R83 is in DIP package.

I am confused about what's causing R85 to exceed its power rating.  AC_HOT is 220 VAC.  The load is an inductive load (an incline motor, rated at 15W).

Is there anything in the following circuit that does not make sense? Any pointers are appreciated.

BT137-600E datasheet

PC1S3063NTZF datasheet


texts: Manipulating Amplitude and Axis of symmetry of BUBBA oscillator in Simulink

texts:
So far i have a bubba ocsillator that can produce smooth sinusoidal waves, but the output waveform is asymmetric about the y-axis and the amplitude is not 1. What exactly do i need to do to :-

Make the sine output symmetric about the Y-Axis
Change the amplitude of the output to -1 <--> +1

Below is my circuit, Vpp = 20V, and Gnd is Ground and waveforms, Finite Gain OP-Amp Gain Value = 100,000.


texts: Voltage controlled current source for VLC

texts:
Im trying to design a driver circuit for the purposes of modulation of a white LED for visible light communication. The circuit i need to build has to be a voltage controlled current source. The speed of modulation is between 30-50MHz. So really fast. This is the basic schematic of the circuit but i cant seem to get it working on Multi-Sim.

http://i.stack.imgur.com/thtot.png

I think what im really missing is an understanding of what each component in the circuit is doing. The role of the op-amp and the FET. Because of the high speeds the components im using are:

AD8021 -
http://www.analog.com/en/products/amplifiers/operational-amplifiers/low-noise-amplifiers-lessthanequalto-10nv/ad8021.html

PD55003-E (1GH, 2.5A)

If someone could explain the role of each of these components in the circuit i would be very grateful

Thanks


texts: Discharge rate of a motor run capacitor?

texts:
I have a capacitor on a pool pump, specs : Motor Run Capacitor Round 30 uf MFD 370 Volt VAC 12717
As I understand even with electric circuit the pump is on turned OFF, the capacitor can still carry electric charge.  How do I calculate the time I need power off so to ensure the natural leakage of capacitor will completely be depleted ?  ( I do not prefer short circuiting the cap. to release the electric )
Thanks.