texts: Not able to perform operations based on the data received to MCU through UART?

texts:
I have been trying to do a simple operation based on the data byte received by the MCU(pic18F) from the PC terminal through UART. The operation is turning ON an LED depending on the content of the received data byte. So here is the code for the logic:

char data = 0;
unsigned char UARTReadByte()
{
   while(!PIR1bits.RCIF); //Wait until the receive buffer is full
   return RCREG; //Return received byte
}

void main()
{
   TRISAbits.TRISA1 = 0
   UARTInit(); //Initialize UART
   LCDInit(); //Initialize LCD
   while(1)
  {
     data = UARTReadByte(); //The received data from the virtual terminal (UART) is stored in another variable char
     Write_Command(0x80);
     Write_data(data); //Display the received data on the LCD
     if(data==1)  //check if the data is 1, if 1 turn ON the LED
     PORTAbits.RA0 = 1;
 }
}

The received number is displayed on the LCD, however the LED is not turning ON. I presume the MCU is not able to check and validate the received byte due to issues in the data format. Can anyone help me with solving this problem. Thank you all in advance.


texts:
Original schematic:

Here is the goal switch between two VGA outputs from one source VGA input.
Parts list:
1 SPDT switch for switching between A or B video outputs.
2 CBT3244AD IC chips (here's the datasheet)  http://www.nxp.com/documents/data_sheet/CBT3244A.pdf
The VCC on the IC chip is that the 5volts power? How can I wire the IC so I don't have to have more than the one switch?
Are the enables connected to the switch and ground? Basically both enables are connected on the outside pair of the SPDT and the ground is on the inside line?

Possible wiring of switch?
Or is this the proper way to go
Using a DPDT IS THIS THE CORRECT DIAGRAM?


texts: TO-220 MOSFET (or SS relay) for 24VDC with 0V turn on voltage

texts:
I am in need of a MOSFET (or solid state relay) in a TO-220 package that will switch 24 VDC high side to an inductive load (up to 2 amps) when 0VDC is applied to the gate.

I don't even know where to begin to look for such a solution. Any suggestions on specific components or how to proceed will be greatly appreciated.

Thank you.

Edit: I would like to do it with zero other components, if possible. I have limited space on the PCB to include other components.

I am currently using a BTS462T as a switch but that requires 5VDC to turn on. I am looking for a solution that will turn on the 24VDC with a low.

Would depletion mode or enhancement mode be best in this situation?


texts: A question about temperature change of a transducer

texts:
This load-cell has sensitivity Cn = 2mV/V. In the data sheet the only part about the temperature coefficient is:

How can I calculate the change in sensitivity for a 10°C temperature difference?


texts: Powering three separate shaded pole axial fan motors with one 3-phase VFD

texts: I want to power and control the RPM of three 115v .47amp shaded pole axial fans each powered by a separate leg of the 3-phase coming from a VFD. Can it be done? I'd like them to run at full speed (60hz) down to possibly half of that or less if that's an option.


texts: GbE Phy(88E1543) with POE+ PSE(LTC4266) design (POE+ magnetics? RJ45 with Integrated magnetics?)

texts:
I'm trying to understand how i can inject power to a 4 bank RJ45. I want to use these parts :
 - LTC 4266 4 ports PSE (802.3 at compliant for GbE, in type1 class3 for 13W at each port)
 - Marvell 88E1543 4 ports Gigabit Ethernet

In the 4266 datasheet p.32, they use a ETH1-230LD magnetics to inject the power. My questions are :

do I need to use RJ45 jack with integrated magnetics in this case ?
where should be placed the 50 ohm terminations? before the ETH1-230?

I'm a bit confused at the moment.

many thanks,
J.


texts: Who do IGBT rectifiers have floating gates (unlike MOSFET rectifiers)?

texts:
When I search Google Images for "IGBT rectifier", I notice that they all appear to have floating gates.

But don't IGBT's have gates like the ones on MOSFET's, in which it's insulated from the other pins on the transistor?  How do they work without an input to control the gate voltage?  Wouldn't this be terribly sensitive to the environment.
Why don't these rectifiers have gates connected similarly to the ones in MOSFET rectifiers like the one below.

On the side note, I also notice that the IGBT rectifiers all seem to be 3-phase.


texts: Electrical components that modify current

texts:
Are there any electrical components that 'consume' current? That is, the current coming out of the component is different than the current going into it? For example, the following components consume voltage (outside of a voltage source):

Resistor
Diode
LED
etc...

Are there any similar components that do the same with current?


texts: I have a Address Select pins (A0, A1, A2) for I2C Serial EEPROM. These 3 lines enables 8 different addresses for IC. What I want is to connect these lines to DIP switch, so I can manually change addresses. Can I connect those lines from dipswitch directly to GND and VCC or I need pull-up/pull-down resistors?


texts: Does the value of a resistor matter when doing voltage division to cut it into a half?

texts: I have a 7.4V (8.4V when fully charged) battery that is connected to an Arduino and I need to monitor the battery. To do so, I need to plug the battery into an analog pin. However, that pin only accepts voltages from 0-5V, and returns a value from 0-1023. Therefore I want to cut that 8.4V when fully charged into 4.2V. I understand I need to use voltage division where the resistors are both equal, does it matter which resistors? \$10\text{k}\Omega-10\text{k}\Omega\$ vs \$1\text{k}\Omega-1\text{k}\Omega\$?


texts: Delay introduced by parallel R/C components

texts:
I have an envelope follower circuit which uses a LT1013 op-amp to multiply an audio signal to a logic level (~4.7V). Then the signal is filtered to create an output of the original signal’s envelope.

In the attached schematic, there is a 1k resistor in parallel with a 10uF cap. which is used as an envelope follower.

However, the envelope is delayed by approximately 0.3 seconds. My first reaction was that the cap. and resistor was introducing an RC delay. But, their wiring is not the way an RC circuit is wired and hence an RC delay calculator is useless.

Does a parallel RC circuit introduce a signal delay? And how does one calculate the delay?

Thanks for your help.


texts: What is the physics dynamics behind inset patch antenna radiation

texts:
I know that the radiation from an antenna is caused by a fringing field between the patch and the ground.
I also know that the length of the antenna is lamba/2, so both fringing field radiation will add together.
But this is only intuition.
Is there some actual explanation regarding the physical dynamics of an inset fed patch antenna?


texts: Why is USB Battery Charging v1.2 compatible with v1.1, or is it?

texts:
As declared in the USB Battery Charging specification, a USB port can indicate that it is a Dedicated Charging Port (DCP), e.g. a dumb wall charger, by shorting D+ to D-. Version 1.1 of said spec declares that such a port must be able to supply up to 1.5 A. However, the latest (and final) version 1.2 increases this to 5 A.

This confusues me. Say a device following v1.2 is plugged into a DCP that follows v1.1, with no communication happening besides the shorted D pins, the device would identify the port as being able to supply 5 A and could happily start drawing much more than 1.5 A, which the charger may not be able to supply, or maybe it would.... and then catch fire.

How can this be in a system that is as backwards compatible as USB? Sure, nowadays with Power Delivery, we're back to having to check all parts of a USB charging chain (charger, cable and device) to get optimum performance, but surely not for safety? Am I missing something? Was version 1.1 only ever a draft, not meant for implementation?


texts: Data packet format when USB initialized as COM port

texts:
Does anyone know how the data in data packet looks like when the USB is initialized as COM port?
I have a Arduino Mega 2560. I have initialized COM port with a baud rate of 9600. I know that there are four types of USB packets as

Token Packet (Commonly used for device identification and transaction initiation.)
Data Packet (Contains the data that needs to be transferred from host to client or vice-versa.)
Acknowledgement Packet (Acknowledgement for error-free data reception.)
Special Packets (Hub to hub communication and speed differential.)

The payload in data packet is formatted as
DATA1 >> PAYLOAD >> CRC16 ; DATA2 >> >> PAYLOAD >> CRC16 ; etc.
Till this point I am clear about whats happening.
Now all I want to know is

How the data is structured in the PAYLOAD section, when USB is initialized as COM port?
How the baud rate comes into picture i.e how a particular baudrate is achieved in this type of communication?
How is communication in terms of packet sequence? Does the sequence of packets change? (Like token>>data>>ack>>data>>ack>>...)

As @Simon said that this might be a vendor specific protocol, does anyone know how its used in Arduino?
This is really important to me to explore. Below is what I am trying.

This is what I have already done. I was successfully able to transfer the data of 180KBytes of data in one sec. If I increase the data even by 1Kbytes, it starts to show error in the received data. I didn't initialized communication at any fixed baud rate. Mega is just waiting for data. I the next bit doesn't arrive in next 50 milliseconds, it considers this as end of communication.
I wish to achieve same data rate for each Arduino Mega. Thus USB has to transfer total of 540KBytes of data in one sec. Here also I have to use USB hub. I would also like to know if this might cause any trouble, for proposed data transfer.

Now here I want to know weather this limitation is from USB side or Mega side or combination of both. So before I actually go and buy new Mega to test, I would just like to know if it will work or not.


texts:
I'm really new to electronics and I'm working through the Arduino starter kit.

With this example, I'm having trouble understanding the flow of electricity and a few other things. Here are my questions:

It looks like the motor is receiving two positive sources of voltage: one coming from pin 9 after it goes through the transistor-- then another coming out of the 9v battery, down the power rail, and into the motor. Why is the power from the 9v battery necessary? I thought the transistor's purpose was to modify the electrical current so that it was capable of operating the motor. Further, if the 9v battery is connected to the motor, why is that in itself not spinning the motor?
I don't understand how everything's flowing back to the leftmost ground rail. From the perspective of the motor, one wire is attached to the positive lead of the 9v battery and the other wire is attached to the gate coming out of the transistor. How is this thing grounded?
The positioning of the diode throws me off even further. My understanding was that their purpose in a circuit like that was to prevent electricity from flowing back into the circuit from components like motors, but in this circuit, it doesn't seem to be positioned between the motor and the rest of the circuit like I'd expect.


texts: Development with InvenSense MPU-6000/6050 - where to begin?

texts:
I'd like to use a MPU-6000 chip for an AR app on an Android device.
However I have no clue where to begin, which parts I need or whatsoever.
I'm familiar a bit with Arduino, but only as a newbie.

Which parts do I need to purchase? InvenSense sells some evaluation board, is it enough to connect it to my PC? Do I need some additional board? Which one? Are there any other parts that may help me? I also want to connect an additional magnetometer sensor to get full 9-axis motion tracking - which board will support both of them? Which software development environment should I use?

One more thing - I'm going to glue the board to an Android device (on the outside, with batteries as a power source), but how should I connect it? Do you thing Bluetooth is fast enough to transmit high-frequency real-time feedback from the chip? Any other options you can think of?

Thanks!


texts:
After a day of struggling with trying to simulate an LM2678 based buck converter (see: this post) another user suggested using TIs online power designer web bench tool to simulate. Selecting a design on the site gave me just about the exact same circuit I had designed by hand for a 5v buck converter using the design equations found in the LM2678 datasheet. I'm struggling to make sense of the simulation results from TIs web-bench, in fact they seem entirely nonsensical to me:

Transient Load Analysis:

Transient Steady-State Analysis:

Could someone explain to me what this means, if anything? I'm expecting to see a constant 5v out of the steady state analysis voltage over the load but maybe I'm just not understanding what the results are telling me?


texts: Stability & error from nyquist POLAR plot?

texts:
I have been given the following Nyquist polar plot of an unknown transfer function, along with the fact that this system is openloop stable:

Now I can directly see this is a type 1 system. - So there is a non-zero, limited error when given a constant input. A simple system that shows a similar shape is for example (constants are different of course).
$$H_1 = \frac{1}{s+1}\frac{1}{s^2 + s + 1}$$

Now it is asked from me to determine -from the graph- what the steady state error will be, if this system is inputted into a unity feedback loop:
$$H_2 = \frac{H_1}{1+H_1}$$


texts: My gas sensor is stuck physically, how can I fix it?

texts:
I'm not sure if this is the right area, but it's a problem with one of my components physically.

When I press on both sides, it doesn't come up. Is there any way that I can get this 'up' cosmetically without taking it apart? Thanks!


texts: 2KW - 48V - 240v / 50Hz UPS - Unknown Topology

texts:
I am refurbishing a 2kw ups that a friend gave to me. It had failed and had been left in a shipping container on a site and the PCB had suffered some low level corrosion. The PCB is a 2 layer board, all through hole main power circuit stuff is on one side and the logic/signal circuitry is all SMD on the other side. I have de-soldered nearly every through hole component on the board and have been removing blistered overcoat and corrosion off the tarces/vias/tracks.I have a blown trace from an IGBT emitter back to the gate driver PCB to repair but so far so good and I am nearly ready to re-apply some CW3300G overcoat and get the PCB back to scratch.

** - L7 is larger inductor towards the back and L1 is slightly smaller closer inductor.

What had failed -

The Bat-BUS DC/DC converter was all ok. 'Battery +' connects to center tap of a SMPS transformer and each winding end gets grounded by 2 parallel mosfets (70N20). the secondary side of the transformer goes through a bridge rectifier -> filter and then connects to the DC BUS. This bus is a 3 level bus composed of 2x 450V/940uF Nippon Chemis (2x470uF)) in series. The intermediate '0V' stage of this DC Bus is tied to 'BAT -' as is both Input AC grid Neutral and Output AC neutral. So +320V / 0V / -320V is the obvious voltage levels on this Bus.

Bat-BUS DC/DC had no problems apart from corroded components which I have ordered replacements.

Inverter stage - DC BUS->AC OUT

So this stage was composed of 2 x IGBT'S (infineon K25H1203)in a half-bridge configuration, effectively flipping AC Line Out to either Bus- or Bus+.

The High side IGBT had blown (gate,collector and emitter all shorted together) and the current has blown the trace connecting IGBT emitter to Gate driver PCB.

Replacement IGBT's ordered, trace is no problem to repair and I will check the Gate driver PCBs before re-install.

So now comes the topology I don't understand. AC grid input neutral is tied straight to the '0V' stage of the DC BULK CAP Bank. The AC Line Input goes to 3 places. 1st is a 'toggle' relay that connects the AC OUT to either the AC IN or the inverter half bridge/low pass filter. Simple enough.

The 2nd path the AC LINE INPUT takes is through a large inductor (L1) 2 power diodes that rectify the AC and supply's power to the DC BUS +320V / -320V.

The 3rd path I do not understand. The AC LINE INPUT goes through a large inductor (L1) through a bridge rectifier and the + and - out of this rectifier get shorted by an IGBT and that's it. It connects nowhere else after this bridge rectifier.

What does this circuit do? What is its purpose? Power factor correction? )I can find no mention of power factor correction in the UPS manuals/data sheets.

Also in the DC/DC converter what is the purpose of the inductors,resistors,capacitors and diode? -(D15,D23,R48,R105,R58,R104,C47,C48,L2,L3,L4,L5)) A type of filter?

Thanks.


texts: New to circuits: Creating a toggle button in Logisim using Latch

texts:
I have just started doing logic and circuits and I am trying to make a toggle button using a button and a latch. I can't seem to figure out how to make the light toggle instead of turning on when the button is realeased

This is what I have, just a basic latch, I just need a direction to go to make it toggle (If the button is pressed the light will only stay off if I keep the button clicked).


texts: Measuring the strength of a magnetic field with a microcontroller

texts:
I'm trying to make a very simple magnetic field detector. Now I have a very simple circuit (the transmitter/magnetic field generator) with an inductor and a push button. Whenever I press the button 'on/off' really fast, the inductor produces a magnetic field.

I have ATMEGA328 with ADC enabled (the receiver/detector circuit) (voltage reference set to 1.1v). I have a primitive antenna (a 6cm wire floating in the air - plugged directly into ADC input, no op-amp).

If I move the micro-controllers ADC input 'antenna' next to a 220v power socket, I can see a sine wave being formed, so I believe the ADC is picking up the 50/60Hz AC sine wave from the wall, so it's detecting magnetic/electric field.

The problem is when I place my inductor circuit next to the microcontroller and trigger it, the micro-controllers ADC doesn't pick up anything, even when the 'antenna' and inductor is right next to each other. I tested the same inductor in the 'dc to dc boost converter' and it was working very well on 2A 0.3v.

I can't understand why it doesn't detect the magnetic field generated by the inductor, but picks up the field generated from the wall.

Is it because I need to 'convert' the magnetic field/current into voltage (as ADC shows voltage levels) or is the magnetic field produced in the inductor too weak for the simple wire to pick up and I need ether another inductor to pick it up or an op-amp for my 'antenna'? Thanks


texts: Latched comparator output higher than supply

texts:
I am trying to simulate the following latched comparator (the detail analysis of that circuit can be found here).

At low clock frequency (200MHz), the circuit works perfectly well . However, when I try to increase clock frequency to 1.25GHz, the comparator doesn't work and the output waveform looks strange.

As you can see, my supply voltage is 1.8V and all signal is less than or equal to 1.8V. But from the waveform Outn, Outp, we can see that these output volatage exceeds supply voltage.
 Could anyone explain why?

Also why doesn't the circuit work at that clock frequency? How to modify to make it work?


texts: What exactly starts the clk during spi communications?

texts:
According to section 28.9.1 (of RM0091), the spi communications are enabled when register 6 is active (SPE set to 1). According to the rm0091 guide, once the spi communications are active, and register 14 is set to 0 (receive only mode) then the clk pin should start up. But when I pause the debugger at that stage, I can see both those pins be in the correct setting, but sometimes the clock is on and sometimes it is not on. So what exactly starts the clk during spi communications?
I dont know if it matters, but I am connected in half duplex master mode to an spi compatible chip (ssc). I am using an stm32f042k6t6 chip on a nucleo board.


texts: What do the different interrupts in PCIe do? I referring to MSI, MSI-X and INTx

texts: We have the following interrupts: MSI, MSI-X and INTx. What do these different type of interrupts do in PCIe? I only need a short description. I only know that in PCIe interrupts are generated as packets when they are to be asserted and also when they are to be deasserted and that MSI and MSI-X exist for legacy support. I could be wrong. Is it possible to get answer to this very specific question on this forum?


texts: Secondary voltage spike in flyback transformer

texts:
simulate this circuit – Schematic created using CircuitLab
I am using a TNY264 IC to make a custom flyback transformer. (U1 is the TNY264.)
The primary to secondary turns ratio is 10 with the primary inductance being 6mH.
I am using the standard design of flyback topology suggested by TNY264 datasheet without any bias winding.
The output is regulated at close to 13 volts using two 6.2V Zeners in series with an optocoupler providing feedback. (I used an LED and photodiode in the schematic to represent this as I couldn't find an optocoupler.)
The issue is as follows:
Large voltage spikes occur at the secondary when the switch is opened or when "flyback" occurs.

Blue -Drain voltage, yellow -output voltage
The ringing caused by the leakage inductance is reflected onto the secondary.
I have clamped the drain with a RCD snubber, which peaks the drain voltage at 164V.
The nominal value of drain after the ringing stops is about 130 volts which is in agreement with the turns ratio. The circuit is working in DCM mode.
How can I stop the voltage spikes on the secondary? Should the primary snubber network be improved?


texts: Differences between atmega32u2 and atmega32u4?

texts: What are most important differences between ATMega32u2 and ATMega32u4?


texts:
I'm having a hard time understanding how to calculate input impedance of the inverting op amp.
First, which two points do I need to calculate the impedance between? Is it between the two points indicated by the red line on the picture above?
In this case I don't understand why the impedance is equal to Rin. It seems to me that it should be infinite because the impedance between the op amp inputs is infinite. What am I missing here?
Thank you!


texts:
I'm having trouble getting to the result of the feedback gain (β) of the following phase shift oscillator:

Is the circuit correctly designed?

How do I calculate the feedback gain?

Edit: Is it possible that the B in the image doesn't correspond to this oscillator?


texts: Why does the voltage regulator not regulate when ac is around 200V AC?

texts:
So the voltage regulator works well when the input of the primary winding transformer is at 220V or greater and the 12V regulator does output around 12V. Why is it that when I turn down the variable transformer to say 203V the voltage regulator does not output around 12V and in fact outputs less?

The transformer I have is VC 16/1/9 https://catalog.block-trafo.de/prodvardatasheet/393257-524506_EN and the voltage regulator is an L78S12CV


texts: Trying to identify an unknown current-source symbol

texts:
Searching Google for a picture is difficult even with their new "similar image" functionality... While trying to understand an open collector pin's description on a schematic (for the TH72031, see page 7, pin 7), I found this symbol:

I know that two overlapping circles means a current source, but what does the "T bar" signify? Some sort of variability?

Thanks for any help!


texts: I have a furnace that is heated by a small Kanthal coil. The core is formed by wrapping the Kanthal wire around an alumina cylinder. One problem we have had is that the wire springs out of shape after it is wrapped. We temporarily solved the problem by gluing the wire as we wrap the core with super glue; however, even after the glue cures there is enough spring force to break free from the ceramic. Is there a way to cure the Kanthal wire to help it retains its shape?


texts: What happens to excess energy fed into the power grid?

texts:
The closest question to this is Linear useage of excess power generation.

I'm no engineer so I may not be able to phrase this correctly and would appreciate an answer which assumes minimal background knowledge (I have only a basic understanding of voltage, transformers, etc). The question arises from all this talk of the variable wind and power potentially disrupting the grid.

For example see the 2012 Electrical Connection article Rapid increase in solar installations potentially overloading the grid which discusses the potential for "reverse power flow" and also talks about some sort of "network protector" device. Also there is a or similar article about Hawaii The Interconnection Nightmare in Hawaii and Why It Matters to the US Residential PV Industry , which says the only "concrete concern identified by the Hawaii experience is the potential for transient overvoltage on the feeder – essentially a short duration voltage spike".

I'm curious about what happens here both with regard to a large grid and in a micro environment. For example, let's say I have a fully charged battery and I keep flowing electricity into it. What happens? Are there devices which will divert or dissipate the electricity as heat without damaging anything? I found a few similar questions online but the answers weren't too clear.


texts: What is this effect I am seeing in a current/voltage plot of a 2N2222 NPN transistor?

texts:
I have been working on a home made IV tracer for diodes and transistors.
I noticed a slight curlicue in the low voltage and low current end of the plot for a transistor, and wondered what was going on.
This is the plot of the collector current and collector voltage for a 2N2222 transistor made with my setup:

You can see the "curlicue" down there at the lower left corner.
This is a closer view of the "curlicue":

I've been trying to figure out what is going on here.
This is the circuit I used to make the plots:

There's an Arduino Nano off to the left connected to the analog and PWM signals.  It uses oversampling to get better than the 10 bits of resolution of the Arduino ADC.
The best explanation I've been able to come up with is that at low collector voltages, some of the base current "goes the wrong way" out through the collector instead of the emitter.  That raises the collector voltage (A3-VCollector) against the bias voltage (A2-VCollectorBias) resulting in a current flowing back through R4.
ICollector is calculated as \$\frac{VCollectorBias - VCollector}{R4} \$
Does that explanation seem right, or have I missed something?

Between those two charts, I changed R4 from 1k to 10k and made some software changes to get a little more resolution.

At a suggestion from Hearth, I simulated the circuit in LTspice.
Here's the simulated circuit:

This is the plot of the collector current against the collector voltage:

It does in fact have a negative tail, though not as extreme as in my circuit.  The tail in the simulator is also straight rather than curved.
At any rate, the "tail" isn't a figment of the Nano's imagination.

I ran a trace of a 2N3904.

It also has a negative tail on the collector current, though much smaller than on the 2N2222.


texts: Sampling rate understanding for ADC requirement

texts:
So I have this voltage plot. These are voltages corresponding to a current changes on a wire.

I am trying to understand the rate of transmission for choosing a ADC to read these analog values.

The peak to peak time is 3-4us. I need to sample them in order to get digital values. What kind of ADC is required?

According to my calculation its T= \$3*10^{-6}s\$ or \$4*10^{-6}s\$ i.e. 350 - 400 kHz approx. What must be the ADC criteria if I have to select a micro controller for my task?

Since Nyquist criteria says twice the sampling frequency, so anything more than 800kHz works? Or am I missing something here?

EDIT
I think I must specify this point. There are 3 levels of data I need to track, 0, 1 ans 2 level (0= 0ma; 1= 10mA; 2=20mA lets say). Each represent a voltage level proportional to the current on the wire. So I need to track the each of the levels.


texts:
need some help with interrupts and the 16f887.

I'm using MPLAB and writing my code in C. I am using the 44-pin demo board from Microchip. There is a push button wired to RBO/INTO which is normally high, and pulled low when the button is pressed.

I've already verified that the input and push button are working, however I dont think I'm setting up the interrupt properly. When the button is pressed, I'm try to turn PORTD on, and when the interrupt returns, PORTD is turned off.

However when I run the code, PORTD turns on right away. Any ideas?

#include <pic16f887.h>
#include <htc.h>

__CONFIG (DEBUG_ON, LVP_OFF, FCMEN_OFF, IESO_OFF, BOREN_OFF,
    CPD_OFF, CP_OFF, MCLRE_ON, WDTE_ON, FOSC_INTRC_NOCLKOUT, BOR4V_BOR21V);

void intMain() {
PORTD=0xff;
INTF=0;
GIE=1;
}

void main(void){

 TRISB = 0xff;        //set PORTB as inputs
 TRISD = 0x00;        // Set PORTD as an Output
 ANSEL = 0x00;
 ANSELH = 0x00;
 GIE=1;
 INTE=1;
 PORTD=0x00;
 while(1)
 {
     PORTD=0x00;

 }
}

EDIT

I've updated my code based on some suggestions below. Here is the current code. I've written it so that, when the ISR is called, port D will count from 0 to 256, then clear and exit the ISR. I've written in a trap to stop the ISR from exiting and keep it in an endless loop. When i start the controller, the port counts to 256, clears and restarts repeatedly.

#include <pic16f887.h>
#include <htc.h>

__CONFIG (DEBUG_ON, LVP_OFF, FCMEN_OFF, IESO_OFF, BOREN_OFF,
    CPD_OFF, CP_OFF, MCLRE_ON, WDTE_ON, FOSC_INTRC_NOCLKOUT, BOR4V_BOR21V);

void interrupt intMain() {
int i,k;
i=0;
k=0;
while(i<256)
{
    while(k<3000) //delay
        k++;
    i++;
    k=0;
    PORTD=i;
}
while(1){} //trap
//INTF=0;
}

void main(void){

 TRISB = 0xff;        //set PORTB as inputs
 TRISD = 0x00;        // Set PORTD as an Output
 ANSEL = 0x00;
 ANSELH = 0x00;
 INTE=1;
 GIE=1;
 INTEDG=0;
 nRBPU=0;
 WPUB0=1;
 PORTD=0x00;
 while(1)
 {
     PORTD=0x00;

 }
}


texts: 3.6V battery filtering Capacitor calculation

texts:
I am using the follow battery as power supply:

http://uk.farnell.com/eve/er26500/battery-lithium-3-6v-c/dp/1973582

The circuit demands a constant current of 0.01 mA until an interrupt happens where  the current demand varies from 18mA up to 90mA for 4 seconds.

I have read that "In power supplies, capacitors are used to smooth (filter) the pulsating DC output after rectification so that a nearly constant DC voltage is supplied to the load".

Is it correct to say that filtering capacitors on power supply is similar to decoupling capacitors?
As i can understand both techniques has the same benefits, right?

I am sure there is a way to calculate the capacitor value exactly, but is there any common values for 3.6 volt batteries on these current demands? (like decoupling capacitors).

For an example i have device that uses the same battery as i do, and they used two parallel capacitors 1F each.
Moreover, i can make a guess that the current consumption will be increased if i use capacitors after the power supply.

Is there any other disadvantages on using them?


texts:
For an LED Driver chip I will be using, an inverse PWM signal must be used due to the way I will be wiring it, but could this be established by simply writing a value of (255-Value)-for 8bit PWM or should a NAND chip or other method be used?

Thank You


texts: In PSPICE how do I get a plot showing the reflection co efficient on the y axis?

texts: I need to plot a graph of the reflection coefficient against the frequency.I ran an AC sweep of in the range of frequencies I need. However I am unsure of how to get the reflection coefficient on the y axis for the circuit I want to stimulate. Will I have to use an additional component ?. Anybody familar with PSPICE please advice?.


texts:
I've prototyped the circuit below on a normal breadboard and it works as desired. However, I'm very new to electronics and what to make sure I'm not abusing my transistor.

I'm using the piezo element to detect a certain knock pattern. If the correct pattern is detected, it disables the electomagnetic lock (allowing the door to be opened).

When my microcontroller is booted, it immediately sends a HIGH signal to the transistor (thus activating the electromagnetic lock) and keeps it there until the door is successfully unlocked. After a few seconds of being unlocked, it then reactivates the lock. As a result, it's going to be "on" 99% of it's lifetime. After letting this run for several hours, my transistor is a little hot to the touch.

My question is this:  Is it OK to use the transistor this way (i.e. in an "always on/open" state)? Or is this a bad idea and I should take a different approach?


texts:
I have a GPSDO design I've been building and selling for a while now, and it's mostly successful, but sometimes the 3.3v buck converter to power the oscillator won't start up properly.

It isn't universal - most of them work, but it happens often enough that I think there must be some aspect of the datasheet that I am not heeding 100% that's causing the design to not be 100% stable.

When it doesn't work, the output is more like 1.7 volts instead of 3.3 volts. Momentarily shorting out the 10 µF cap on the input of the SC189Z is enough to get it to start up properly (but obviously that's a pretty heinous workaround).

The schematic is on the hackaday.io project page. The 2.2 µH inductors are Murata 1285AS-H-2R2MP2s (I couldn't handily obtain the part mentioned in the datasheet). The 10µF, 0.1µF and 0.01µF caps are ordinary X7R 0805 ceramic caps. The input power is a 6W rated wall-wart style 5VDC power supply. The OH300 requires 3W at startup reducing down to 1.1W steady-state (at 3.3V).

The relevant portion of the circuit starts with the buck converter, which is followed by an additional 2.2µH inductor and 10µF cap and 0.1µF cap as a ripple filter. From there, there's about a 1 inch long 32 mil wide trace over to the OCXO, where there's another 10µF filter cap, a 400Ω ferrite bead and a 0.01µF cap, then the power supply pin for the oscillator.


texts:
I've read on forums that OBD port can provide max 5A current at 12V. What is the source of the power? Is it coming from battery directly or is it regulated power supply from somewhere else, maybe ECU? Also if the source is battery, what is the maximum transient voltage? I have read this and it says a maximum of 120V. Can anyone confirm this limit?
Thanks in advance for help :)
[Edit]
The reason for asking this question is that many open source obd readers I've seen do not implement over voltage protection or offer very basic one with just zener. Is zener protection enough or should I go with over voltage shutdown with automatic reset method?


texts: ModelSim Altera: simulating the "lpm_add_sub" module?

texts:
I'm trying to simulate a verilog module that uses the "lpm_add_sub" module to provide an adder with a separate carry in (for some reason Quartus II doesn't recognise that a+b+c where c is a single bit can be implemented in a single adder and synthesizes two adders for it).  However when I try to start the simulation in ModelSim, I get the following messages:

vsim -L altera_ver -L altera_mf_ver -L cycloneiv_ver -L cycloneive_ver -L lpm_ver -voptargs=+acc work.rotation_sensor
# vsim -L altera_ver -L altera_mf_ver -L cycloneiv_ver -L cycloneive_ver -L lpm_ver -voptargs=+acc work.rotation_sensor
# Loading work.rotation_sensor
# Loading work.bitcounter
# Loading lpm_ver.lpm_add_sub
# ** Error: (vsim-3584) C:/Development/ican/IcanFinal2/rotation_sensor.v(119): Module parameter 'LPM_DIRECTION' not found for override.
#
#         Region: /rotation_sensor/bitcounter/genblk1
# ** Error: (vsim-3584) C:/Development/ican/IcanFinal2/rotation_sensor.v(119): Module parameter 'LPM_REPRESENTATION' not found for override.
#
#         Region: /rotation_sensor/bitcounter/genblk1
# ** Error: (vsim-3584) C:/Development/ican/IcanFinal2/rotation_sensor.v(119): Module parameter 'LPM_WIDTH' not found for override.
#
#         Region: /rotation_sensor/bitcounter/genblk1
# Error loading design

Any ideas what I'm doing wrong?  The line of code causing the error is this:

        lpm_add_sub #(.LPM_DIRECTION("ADD"), .LPM_WIDTH(SUBRESULTSIZE), .LPM_REPRESENTATION("UNSIGNED")) a (
            .dataa(tophalf_count),
            .datab(bottomhalf_count),
            .cin(bits[INPUTWIDTH-1]),
            .result(add_out[SUBRESULTSIZE-1:0]),
            .cout(add_out[SUBRESULTSIZE]));


texts: Questions about prototyping a DMX Splitter

texts:
Original schematics

I want to make the following DMX Splitter:

Credits by J. Mack, see Full article: DMX Splitter

Changes

Changes made by me (with help of Maple, Transistor and many others, thanks for that):

Four instead of three output channels
Power led
Signal led
5 separate DC/AC converters
Separate 220 ohm resistors per output
Temperature fuse and varistor
TVS diodes

My circuit

The circuit I came up with is:

Because not all components are present in DIYLC I used some conventions:

Light blue circles are header pins
Black dots are terminal boxes
There are 6 PCBs
The bottom middle PCB is overlapping slightly. On the left bottom and right bottom PCB there are two black squares, these are broken off to fit the enclosure.
The dark areas on the other two left PCBs are to make sure the fuses can be replaced if necessary (to have a gap to the fuse boxes)

Questions

I have a bunch of questions (hopefully I can ask them in one question since they are all related to the circuit).

In the left bottom PCB there is a QuickBlow fuse, but in the original link it is a SlowBlow. I don't have these; will this be a problem?
Would the HiLink HLK-PM01's have enough distance between each other?
I'm putting everything in one enclosure. I know officially a double enclosure should be used, however, there is really no space for it. And I intend to put the AC220/240V signals UNDER the bottom PCB which will be screwed tightly, so there is no possible way to touch 220/240V. Is this 'acceptable'? I'm intending to use the device on stages with my music bands. The device will be under my keyboards stand, reasonably safe.
The TVS types are 1.5KE18CA DO-201AD 1.5KE18 Bidirectional TVS diodes. Are these ok? I checked them, but I couldn't check the real usage.
I tried to lay the wires as good as possible, although several overlap (some I can route a bit better not crossing an IC, but it cluttered up the picture more to use only straight lines.
Is there anything I didn't think of (regarding safety/functionality?)

[Transaction Screenshot]


texts: Is it practical for firmware to be uniquely identified in production

texts:
Are there systems available in large scale manufacturing that allow a unique serial number to be programmed into the firmware or some free memory space for each PCB that comes through?

I've found that the FDA has decided to start enforcing it for medical grade devices, but is this something that is easy to accomplish or would it require developing your own manufacturing process?


texts:
The (I^2R) heat losses in a transformer are caused by the primary and secondary winding resistances, as the page below lists the transformer losses:

But what about the eddy currents don't they generate resistive losses?
I found the following:
Eddy current loss is conductive I2R loss produced by circulating currents induced in response to AC flux linkage, flowing against the internal resistance of the core.
So, based on the above is eddy current loss a heat loss?
SOURCES:

The Principles and Practice of Engineering (PE) Electrical and Computer: Power exam Reference Handbook
Version 1.1.1
Pub. NCEES

science direct Eddy Current Loss


texts:
I'd like to build a ghost detector. I'm only just beginning the design stage, and thought I'd reach out for some suggestions.

Receiver: I'm planning to end up with a handheld device with an analog backlit meter, which illuminates when the house lights turn off. The meter will display the present of a particular frequency. I have lots of old FPGA projects which I can modify to use as the radio. Or maybe an Arduino for the logic and ADC interface to the meter? I haven't used an Arduino before.

Transmitter: Now to generate the ghosts... The "ghosts" should be some RF signal or frequency which can readily be received in a common household. While I have a good bit of experience in building transceivers, they have always been over coax or fiber. I'm not familiar with all the FCC codes for OTA, so I'd rather stick to detecting "ghosts" (ambient signals) which already exist. Which leads me to my questions:

Q1 Which frequency should I look for? The lower the better, to keep costs down. The project is for my kids - I'd like for them to be able to walk around and find the presences of "ghosts" coming in and out of range. So the signal should be readily available, but intermittent (attenuation by the home's structure, perhaps). Would 60 Hz work?

Q2 I think it might be fun to have the house lights flicker when the meter hits a high mark. To do this, I would have to transmit after all, but the signal could be very low power - just enough to trigger a remotely controlled wall socket. Surely the socket is a COTS device, but if any of you have done this before, or know of a suitable unit, I'd appreciate the information.

Any other suggestions or ideas would be greatly appreciated.

Note I'm not looking for real ghosts here. It's just a toy for the kids.


texts: What happens when a Thermoelectrical generator exceeds its maximum temperature ratings?

texts:
I have a commercial Thermoelectrical Generator used to generate 12V of power from the heat of stove. The data sheet says the maximum Temperature rating is 452 C°.

What happens when this temperature gets exceed? Will the energy production become inefficient again or will certain parts of the peltier-element melt? Will it cause irreversible damage?


texts: Difference between natural response and forced response?

texts:
Reference

Second post on EdaBoard.com

  Time response of a system is the time evolution of the variables. In
  circuits, this would be the waveforms of voltage and current versus
  time.

  Natural response is the system's response to initial conditions with
  all external forces set to zero. In circuits, this would be the
  response of the circuit with initial conditions (initial currents on
  inductors and initial voltage on capacitors for example) with all the
  independent voltages set to zero volts (short circuit) and current
  sources set to zero amps (open circuit). The natural response of the
  circuit will be dictated by the time constants of the circuit and in
  general roots of the characteristics equation (poles).

  Forced response is the system's response to an external stimulus with
  zero initial conditions. In circuits, this would just be the response
  of the circuit to external voltage and current source forcing
  function... continue reading

Questions

How can there be even a natural response? Something has to be inputted to create an output? The way I see it is like turning of the main water line and then turning on your faucet and expecting water to come out.
How can we v(t) (from the link above) be solved for if we don't know dv(dt) in order to find the natural response?
If you can please expand on the 2 concepts (natural response and forced response) by explaining their differences in Layman's terms, it would be lovely.

@Felipe_Ribas Can  you please confirm this and answer some of the questions? (you can just edit this directly if you want)

Given an an equation 10dy/dt + 24y = 48 means rate of change of output + 24 * output = 48. The initial conditions are y(0)=5 and dy/dt=0.

That would mean that the input is 48/(24*5) Is that a correct assumption? The solution to that is 0.4 which is the constant input?


texts: Implementing a very sharp IIR (125Hz sampling rate, 0.2Hz bandwidth)

texts:
I am trying to design a IIR lowpass filter. The purpose of this filter is to get pure DC from noises.

The sampling rate is: 125Hz.
The bandwidth of the filter: 0.2Hz.

I designed the filter with Matlab:

[b,a] = ellip(3,0.001,60,0.001);
freqz(b,a);
figure(2)
out = filter(b,a,ones(1,2000));
plot(out)

The frequency response: at 0.3Hz is -20dB, which is good for me.

The step response:

The coefficients:

a = [1.000000000000000  -2.984668175804313 2.969460975930567  -0.984792292477895];

b =    1.0e-04 *[0.750233362790290  -0.747695120994728 -0.747695120994729   0.750233362790290];

My questions

From the step response, it seems that the 452th data is close to 1. Can I say that I have to wait for 451 data to get a desired DC value? By desired, I do not care much about the gain ripple on DC, meaning that it is fine for me if DC has a small gain(0.9-1.1) on it.
The filter coefficients seem to be pretty small, especially the b part. Can I implement the filter successfully on a Cortex-M4, which is a 32 bit MCU with FPU?


texts:
I'm trying to write data to usb memory stick with stm32f107. Main function is:
 while (1)
  {
    /* USER CODE END WHILE */

    MX_USB_HOST_Process();

    /* USER CODE BEGIN 3 */
     switch(Appli_state)
                {
                    case APPLICATION_IDLE:
                        break;
                    case APPLICATION_START:
                        counter_start++;
                        if(f_mount(&myUsbFatFS, (TCHAR const*)USBH_Path, 0) == FR_OK)
                            {
                               UsbTest_Write();
                            }
                        break;
                    case APPLICATION_READY:
                        break;

                    case APPLICATION_DISCONNECT:
                        break;
                }

      }

Write function is :
bool UsbTest_Write(void)
{
    //Open or Create file for writing
    if(f_open(&myFile, "a.csv", FA_WRITE | FA_OPEN_ALWAYS ) != FR_OK)
    {
        return 0;
    }
    //Copy test Text to my temporary read/write buffer
    f_lseek(&myFile,myFile.fsize);
    sprintf(rwtext, "test\n");
    //Write to text file
    res = f_write(&myFile, (const void *)rwtext, strlen(rwtext), &byteswritten);
    if((res != FR_OK) || (byteswritten == 0))
    {
        return 0;

        f_close(&myFile);
    }
    f_close(&myFile);
    return 1; //Success
}

I have 2GB usb memory stick and it works without any problem. When i try to write the other memory sticks that 8GB and 16GB it's not write. I debugged and
f_open()->find_volume()->get_ldnumber()
get_idnumber() function returns 0 so f_open() function return FR_DISK_ERR.
what can be the reason and how to solve this problem?


texts: Why is there always fixed rated current for an SMPS?

texts:
Possible Duplicate:
  Choosing power supply, how to get the voltage and current ratings?

I have a conceptual question about the rated current shown on a laptop charger. And I assume it is a kind of switch mode power supply. Before I ask my question I would like to mention why I am asking this question. Let’s say I have a 9V battery and I hooked it to the ends of a 1 ohm resistor. Theoretically the current flows would be around 9A. If I increase the resistance (impedance) the current will go to zero linearly. If resistance is 4.5 ohm the current will be 2A and when it is 9 ohm the current will be 1A ect. Theoretically the current decreases linearly and goes to zero as the resistance increases.

In SMPS devices such as laptop chargers the output voltage is regulated and kept at a value around 19V. My question is: “Why is there always rated current such as 4.6A for a laptop charger?” Is that because the total impedance of laptop input is in some interval? Isn’t it possible for a laptop charger (or for any SMPS) to feed a bigger impedance and flow very low currents with the same regulated voltage?

My charger has rated voltage and currents 19V and 4.6A. I really wonder if it is possible to draw 1A with again 19V fixed voltage or draw 10A with again 19V by just adjusting the impedance it feeds.  Is regulation related to this rated current in SMSPs?


texts: Is there an advantage to my sequential circuit optimization?

texts:
I'm trying to create a snake game on a Xilinx Artix7 FPGA, and one of the things I want to check is if the snake has collided with itself. I need to perform this check between game updates to know by the next update whether the game has ended.

The snake in my game is made up of discrete segments, so to check if the snake has collided with itself, I just check if the first segment (the head) overlaps with either the second, the third, the fourth, etc. My plan is to do this sequentially with a clock much faster than the game clock.

The thing is I think I can get away with only checking if the head collides with every other segment. However, is there really any advantage gained by this "optimization"?

The game, if running at say 50 FPS, would have an update period 20 ms. The clock the Basys3 board supports is 100 Mhz which is a period of 10 ns. This means that in the interval between updates for the game, I can go through 2 million segments, which is far more than the snake could ever have. Since the game doesn't really need to get faster than 50 FPS, finding the answer twice as fast doesn't do anything because all I would do is just sit around and wait for the next update.

Another thing I thought of was maybe I could configure the create_clock command in my XDC (constraints) file to be slower, but is there an advantage to doing so? Does it consume less power or something?

The last thing I could think of is if I used a combinational version of collision checking like so

(head == seg1) || (head == seg 2) || (head == seg3) || ... || (head == segN)

With my optimization, it would only take half as much hardware, but still way more than the sequential version. Since it's combinational, the answer would be available almost instantly, but again, since I've got time to kill, I don't see an advantage there either.

Is this a useless optimization?


texts:
I am learning about AVR microcontroller programming and currently have a simple LED blinker set up on an ATtiny26.

A 10k potentiometer is connected to ADC7 (pin 7) as per the example in part 1 of this tutorial. The output pins of port B are connected to LEDs via transistors in a multiplexed array. (The circuit works just fine without the ADC involved.)

To test/learn, I am blinking a single LED and waiting for a number of milliseconds equal to what is read from the ADC. I am having a problem when I try to multiply the value to implement longer delays.

I thought the problem was that the variable I store the ADCH in was an int but needs to be something else because this is an 8-bit microcontroller and an int can only be 0-255. Substituting long in did not work, however.

Here is the code that works:

#define F_CPU 1000000UL
#define ADC_VREF_TYPE = 0x40
int SD = 1;
int main()
{
    // Set port A to output (1)
    DDRA = 0b11111111;
    // Set port B, pin 3, to input (0)
    DDRB &= ~(1 << PB3);
    // Set control and status register
    ADCSR = 0b11100111;
    // Set ADC multiplexer selection register
    ADMUX  = 0b00100111;

    while (1)
    {
        // Set SD (step delay) to value from ADC
        SD = ADCH;
        // Turn on LED (it is a multiplexer, so two pins are used)
        PORTA = 0b00010001;
        // Wait for SD milliseconds
        milli_delay(SD);
        // Turn off LED
        PORTA = 0b00000000;
        // Wait for SD milliseconds
        milli_delay(SD);
    }
}

The problem occurs when I try to use a multiplier like this:

SD = ADCH * 10;

When doing this, the LED will flash quickly at one end of the potentiometer sweep, but will light solid and stay that way at some point while turning the pot to slower speeds (larger ADCH values); essentially "locking up" and requiring a reset while the potentiometer is at the original position again. My guess is that I'm trying to store a value greater than the numeric type holds, but I can't seem to overcome this by changing the variable type. I've tried long and uint32_t but I don't really understand what the numeric types hold on this micro.

Q: What do I need to do so that I can implement delays ranging from 0 to say 2000 milliseconds?

FYI I have the following libraries included:

#include <inttypes.h>
#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#include <math.h>

Edit:

I had placed _delay_ms(x) directly in my example to avoid posting the functions I am actually using which call _delay_ms(1) inside a loop. My thought was it would be more concise, but as one answer pointed out, it actually appeared to be a mistake.


texts: I want to have a square wave that goes from 0 VDC to 5VDC go through some sort of amplifier and that amplification takes that same wave ( at a frequency of 1200Hz but could also be adjusted later ) but now makes it 0VDC to 13VDC (at least 13VDC, it could be 13.4 VDC, but not lower than 13VDC). The original wave would be generated from a function generator, but I do not want to exceed 5VDC. How would I got about doing this?


texts: Adding PWM option to continuous wave laser driver

texts:
I've been struggling for a few weeks now trying to add a PWM option to my CW laser diode driver design which works OK.
When adding a MOSFET or BJT to PWM the output, I'm getting voltage spikes and noise.  This is bad for the driver since the laser diode is a very sensitive and expensive component.
I tried three options to PWM the signal, option 1 (MOSFET ATTACHED TO V3 analog input) works the best, but still not good enough.
Currents are 0-250mA, 1kHz - 10kHz operation.
The PWM signal is currently supplied by an industrial function generator to avoid any problems related to MCU low power pins.
Do you have any idea how to wire the switch correctly for best noise performance?
Am I doing something wrong?


texts: Can a smartphone transmit over the 902-928MHz bands?

texts:
I came across a remote control that uses the 902-928MHz band. Can a smartphone transmit WiFi/Bluetooth over those frequencies? If yes, is there anything special about it?

Thanks


texts: Multiple power input + Reverse polarity protection

texts:
I have the following power sources:

AC/DC adapter (5V-36V)
5V USB

I connected the two power inputs properly (diode) but I am not sure about the reverse polarity protection. I haven't found any sources on the internet which mentions if there is any problem with ground short circuit.
My problem is if neither the adapter nor the usb is isolated then reverse polarity connection could cause short circuit through the zero line in the "wall".

simulate this circuit – Schematic created using CircuitLab

So what is your opinion about this? Are the adapters isolated?
How can I protect the circuit if the power sources are not isolated?


texts:
In the specifications of a 10 KW BLDC motor  I've seen

Motor Wire  ------ 2 - Strand 1.9mm
Max Continuous Current ----- 200 Amps
Max Continuous Power ----- 10000 Watts

The details are as follows, it's a Scorpion HK-7050-340KV BLDC motor http://www.scorpionsystem.com/catalog/helicopter/motors_4/hk-70/HK_7050_340/

Now my question is, the max continuous current is a huge 200 amps but the winding used in the motor is just 2 strands of 1.9 mm diameter wire.

Why doesn't the coil burn out at such huge amps.

Thank you.

P.S.  If you like take a look at this https://www.youtube.com/watch?v=77uK19KxMuI
            just to see the power of this monster in action.


texts: Oscilloscope (Rigol DS1054) displaying two mirrored signal traces?

texts: My scope is showing two of the same signals about 50mv apart no matter voltage I'm measuring. Is this an issue with my scope or is there a function I'm missing? Can someone please tell me what going on?


texts: Rectifier and EMI filter for multiple led drivers

texts:
I try to make a power supply stage for 2 offline led drivers insted of making 2 different boards.
Find in atteched file the design A and B. Could you explain and suggest me what is the best design to follow ?


texts: The MDK-5 (Keil-5) cannot build my project!

texts:
I'm trying to build my project but the MDK-5 give me this error:

And also as you can see, in target you just can see Xtal.

What happened?

What's the problem?


texts:
I have a USB ventilator, that I want to use while i'm soldering to bring some fresh air to my atelier. I don't want to have my computer there to do it. So I was thinking to connect it to a 5v regulator and connect it direct to AC. I google around but didn't find any diagram or project that I could use as base. Basically I want to have something like:

AC -> Switch On/off -> 5v Regulator USB Port -> GRD.

any idea, links, etc?

UPDATE:

Links to buy iphone charger isn't what i'm looking for.  I would accept it if at least, the iphone charger have an on/off switch


texts: Small brushed DC motor speed falls off above a certain PWM frequency?

texts:
I'm using the kind of small brushed DC motor shown below. My MCU controls the motor using PWM via a DRV8833 motor driver, also shown below.
If I set the PWM frequency very low, e.g. 10 Hz, the motor clearly judders on and off. So for a smooth motion, it would seem obvious to set the frequency as high as possible.
However, above 100 Hz something odd starts to happen: the speed of rotation actually starts to drop off. I'm confused - I can vary the duty and frequency values independently and it was my understanding the duty value affects the speed while the frequency should just affect the "smoothness" (i.e. the judder) that I see at low frequencies.
What's going on here? I tried Googling and the only thing I found was a DesignSpark article where they say:

One explanation may be that the very narrow pulses of a high-frequency signal are just not long enough to ‘kick’ the rotor into action.

This doesn't sound terribly convincing. Is this really the explanation for the behavior that I'm seeing?
When experimenting to find the optimum frequency, I kept the duty value at about 25%. I'm using a 3.3V ESP32 connected via two PWM pins to the A_IN1 and A_IN2 pins of the DRV8833 chip (i.e. pins 15 and 16). I'm using a library where the PWM duty value is a 10-bit value that can vary between 0 and 1023 - I keep it fixed at 255 for A_IN1 and 0 for A_IN2.
At 10 Hz and a duty cycle of 25%, I believe that the judder that I see is the result of the frequency being low enough that the starting and stopping of the motor is visible to the human eye (with the low duty cycle meaning that the motor does not have enough momentum to carry it through the off phases).


texts: Why does a comparator changes its state when I touch any node at the input?

texts:
I'm connecting LM339 as a comparator and it works well but it becomes very sensitive when the input voltage(at the +ve input) is near to the reference voltage(at the -ve input), It changes its output state whenever i touch any of the inputs (Even with a multimeter lead).

Is that noise? if yes, what kind of noise is that? and is it avoidable?


texts: How to drive riding lawn mower ignition coil?

texts: I have a ignition coil I scavenged from a dead lawn mower and would like to play around with it. The problem though is it is not like a standard car ignition coil and I have no idea how to drive it.  It seems  like a magnet in the engine spins around and induces current and in turn a magnetic field in the primary to get high voltage from the secondary.  My problem, though is it is impractical and annoying to do this, how can I drive the primary without a magnet? Or it might just be a matter of how to connect to the primary, but I don't know.


texts: PIC's serial receive peripheral questions

texts:
I have a few questions regarding the PIC16F690's USART when doing asynchronous receives, and the user guide is sending me mixed signals. It has a two character FIFO buffer, and I'd like to know:

What happens to the data in the FIFO buffer when I turn the receive block off and on again (this is necessary to deal with overruns)?
When exactly is the receive flag set (RCIF)? When the receive buffer is full (page 40)? When there is an character in the buffer (paga 153)? Or when there is an character in the buffer AND the receive block is on, that is, SPEN and CREN are set (page 153 again)?
The datasheet tells me "the data recovery block is actually a high-speed shifter operating at 16 times the baud rate". This sounds wrong: does this mean that the data recovery block can multiply clocks by 16?


texts: Low cost low speed fiber optic connection for embedded applications

texts: I would like to use a fiber connection to send data between two nodes. The nodes would typically have a 8 or 32 bit micro controller. I need data rate of 2 Mbps or higher and distance is about 100 meters. What are some cost effective ways of achieving this? Can full duplex communication be achieved with single fiber as is the case with fiber from various ISPs?


texts:
I found this discussion while looking for a way to wirelessly charge my 3S drone battery. I would like to find a way to drop my drone on my desk (like I do my phone) and let it charge.
If I am understanding the discussion, in order to safely use a wireless qi receiver and transmitter I would need a lipo charger configured as:

I am wondering if my 3S 11.1V battery would charge in the above scenario since each cell in the series is 3.7V?
Adafruit uses what seems to be 3 x 2200mAh balanced batteries at 3.7V in their example with the lipo charger. The 3S drone battery I use is a 3 cell lipo in series at 3.7V each totaling 11.1V. Could I charge my 3S in the scenario above? Or since the total 3S is 11.1V does that disqualify this battery as the maximum this lipo charger will charge is 3.7V total?


texts: Analyzing input/output characteristics of a diode circuit

texts:
In "Fundamentals of Microelectronics" textbook. The question number 27 of chapter 3 is:

The part b of the question is:

And the solution of b from the solution manual of this textbook is:

Can anyone explain simply how did he got the solution ?


texts: Is memory possible without a flip flop circuit?

texts: All the memory circuits I've seen use some form of flip-flop/feedback mechanism to store a value. Is this the only circuit design that can store a value?  Is there anyway to create memory without a feedback loop?


texts: Supernode with 2 voltage sources and 1 current source: node voltage analysis

texts:
I'm struggling with defining a super node in this case. My initial thought was to create a super node with V1 and V2, but I'm not sure how to handle the current source. Doing KCL in this configuration would mean that the current source cancels itself out and becomes irrelevant. Is that correct?

The other option is to also include the current source in the super node, but I'm not sure how I would do that.

Note that the goal of the problem is to find the voltages at each node.

simulate this circuit – Schematic created using CircuitLab


texts: Making sense of non ideal elements on signal conditioning circuit

texts:
So I was trying to solve a problem where I would get an input signal of 230V,16A@50Hz and the output had to be the same frequency but in the rage of 0V and 5V. Through the analysis of the circuit below I got to the expressions :

Corresponding to this circuit:

With the values used on MultiSim I should be seeing a sine wave with a slight phase difference between 0V and 5V. Are my calculations wrong? Is there something I am getting wrong in the schematic from the simulation? Are non ideal components causing this much fuss?


texts: How to theoretically determine max clock speed for a circuit?

texts:
I was wondering what influences the max clock speed and how to calculate it for a circuit implementation. Let's take a CPU for example:

From what I understand the clock speed has to be choosen so that an input signal can propagate through the CPU in a way that all gates (and especially those on the "critical path") have enough time to stabilize their outputs. Therefore the design (determining the "critical path") and the propagation delay seem to be important for determining max clockspeed. However this leaves a lot of open questions on my side:

How can I determine the propagation delay of a single gate?
Is the propagation delay dependent on the manufacturing process? (I'd guess
so... e.g. I would assume that 10nm manufacturing results in lower
propagation delay than 100nm manufacturing)
Are there reference
values for propagation delays with different manufacturing process?
Is it really as simple as I outlined or am I missing relevant
factors? (max speed = delay * gates within critical path)
How big is the variance between propagation delay of gates within the same
manufacturing process (in state of the art 10nm manufacturing for
example)
Could I determine the gates within the critical path of an
let's say a current i7 cpu by dividing its clockspeed through the
assumed propagation delay or will I come up with a significantly
wrong result?


texts: Why would a Intel 8080 chip be destroyed if +12 V is connected before −5 V?

texts:
The Intel 8080 is a classic microprocessor released in 1974, fabricated using an enhancement-mode NMOS process, and shows various unique characteristics related to this process, such as the requirement of a two-phase clock, and three power rails: −5 V, +5 V, and +12 V.
In the description of the power pin from Wikipedia, it says

Pin 2: GND (VSS) - Ground
Pin 11: −5 V (VBB) - The −5 V power supply. This must be the first power source connected and the last disconnected, otherwise the processor will be damaged.
Pin 20: +5 V (VCC) - The + 5 V power supply.
Pin 28: +12 V (VDD) - The +12 V power supply. This must be the last connected and first disconnected power source.

I cross-referenced to the original datasheet, but the information is a bit contradictory.

Absolute Maximum:
VCC (+5 V), VDD (+12 V) and VSS (GND) with respect to VBB (−5 V): −0.3 V to +20 V.

Even if VBB is 0 V when it's unconnected, VDD would be +17 V, and it shouldn't exceed the absolute maximum. Is it the original claim on Wikipedia that a Intel 8080 chip be destroyed if +12 V is connected before −5 V correct?
If it is correct, what is the exact failure mechanism if I do this? Why would the chip be destroyed if +12 V is applied first without −5 V? I suspect it must has something to do with the enhancement-mode NMOS process, but I don't know how semiconductors work.
Could you explain how the power supply is implemented internally inside Intel 8080? Did the problem exist among other chips in the same era built using a similar process?
Also, if I need to design a power supply for the Intel 8080, let's say using three voltage regulators, how do I prevent damages to the chip if +12 V rail ramps up before −5 V?


texts:
can someone, simply explain why does the capacitor current leads the resistor current by 90 degree in an rc ac parallel circuits, pls be simple.
I thought about it but found no answer.


texts: Does cutting LED strips into smaller strips then wiring with low AWG decrease temperature?

texts:
As you know SMD LED Strips can get damn hot and I'm looking at easy ways to reduce the temperature so that the LEDS remain bright for longer. It is my understanding that your typical LED strip will look something like this:

simulate this circuit – Schematic created using CircuitLab

As you can see the input is 24v and the resistors half that to 12v and then that is shared across 6 LEDS, but obviously on a roll of 5m or even 10m this is repeated many more times than displayed.

On a large roll I can imagine that the high demand of current is going to heat up the copper within the LED strip. Which brings me to my question:

Does the current draw affect the temperature of the LEDS in anyway?
Does slicing the LEDS into smaller strips and then wiring them together using low AWG cable reduce the heat? (see example below)


texts: Making PWM from 2 Analog input in MSP430G2231?

texts:
I am a newbie to this MSP430. So, please tell me when I go wrong.

I have a final project making MPPT (Maximum Power Point Tracker) using MSP430G2231. The basic idea is to measure to Analog input (voltage and current), then multiply it (power) and compare to the previous result. That's why, before going further to the algorithm of the MPPT itself, I am trying to use this MSP430G2231 to read 2 analog input and create PWM using it.

I use two pins as an input, P1.0 and P1.1. Then, I use P1.2 to produce the PWM.
The coding that I made goes like this:

#include <msp430.h>
#include "msp430g2231.h"

//Global Variable
unsigned int AdcData[2] ;                 // Store results A1,A0
unsigned int Current ;         // store value from P1.0
unsigned int Voltage ;         // store value from P1.1

void main (void)
{
  WDTCTL = WDTPW + WDTHOLD;   // Stop WDT

  BCSCTL1 = CALBC1_1MHZ;   // Set range
  DCOCTL = CALDCO_1MHZ;      // SMCLK = DCO = 1MHz

  ADC10CTL1 = INCH_1 + CONSEQ_1;            // A1/A0, single sequence
  ADC10CTL0 = ADC10SHT_2 + MSC + ADC10ON + ADC10IE;
  ADC10DTC1 = 0x02;                         // 2 conversions
  ADC10AE0 |= 0x03;                         // P1.1,0 ADC10 option select

  P1DIR |= BIT2;                            // P1.2 = output
  P1SEL |= BIT2;                            // P1.2 = TA1 output
  TACCR0 = 1024-1;                             // PWM Period
  TACCTL1 = OUTMOD_7;                       // TACCR1 reset/set
  AdcData[0]=32;
  AdcData[1]=16;
  Voltage = AdcData[0];
  Current = AdcData[1];
  TACCR1 = (Voltage*0.04)*(Current*0.05);         // TACCR1 PWM Duty Cycle
  TACTL = TASSEL_2 + MC_1;                  // SMCLK, upmode

  while (1)
  {
  __bis_SR_register(LPM0_bits + GIE);     // LPM0, ADC10_ISR will force exit
   ADC10SA = (unsigned int)&AdcData;        // Data transfer location
   ADC10CTL0 |= ENC + ADC10SC;             // Start sampling
  }
}

// ADC10 interrupt service routine
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
{
  __bic_SR_register_on_exit(LPM0_bits);     // Exit LPM0
}

I try to trace it using "step into" in debugging mode. Everything seems goes well until it reach this line :

ADC10SA = (unsigned int)&AdcData;        // Data transfer location

When the pointer reach that line, the "step into" button is not active anymore which means there's something wrong.

Do I write the algorithm right, especially when assign the values from ADC to the AdcData?
And, I can multiply the output value from ADC right and then use it to generate PWM?

In response to jsolarski answer (thank you for giving me feedback)

Actually I've been writing the algorithm like you mention and it goes like these and it still not working

for (;;)
{
   ADC10CTL0 &= ~ENC;
   while (ADC10CTL1 & BUSY);               // Wait if ADC10 core is active
   ADC10SA = (unsigned int)&AdcData;        // Data transfer location
   ADC10CTL0 |= ENC + ADC10SC;             // Start sampling
   __bis_SR_register(CPUOFF + GIE);        // LPM0, ADC10_ISR will force exit
}

// ADC10 interrupt service routine
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
{
  //code from reading from res and sending it to AP
  __bic_SR_register_on_exit(CPUOFF);        // Clear CPUOFF bit from 0(SR)
}

I don't use this code: P1OUT |= 0x01; because I use that Pin for ADC input.
And this line,

ADC10SA = 0x200;                        // Data buffer start

ADC10SA means ADC10 Start Address right, where you want to transfer the ADC conversion value? So, when I want to transfer it to my AdcData array, is it okay to write it like it did?


texts: Quartz Frequency Selection for STM32F334K8T6

texts:
The frequency of the built-in HSE STM32 generator has a range of 4-32mHz.

On many boards, I saw a crystal at 32.768mHz.

Tell me, is it possible to use crystal oscillators with a different frequency?
For example, 16 or 25 mHz. Is this normal mode?

As far as I understand, the frequency at 32mHz is worse than the frequency of 16 or 25mHz in terms of noise immunity of the device.


texts: Flashlight IC with various modes - what IC is that, and how to disable it?

texts:
I've had a cheap 18650 flashlight for some time now - when turning it off and on, it cycles through five modes - full power, medium power, low power, strobe, SOS signal.
I'd like to disable that feature and just use it in full power mode whenever I turn it on.

I assume the "HL6S2" component controls those modes, but I couldn't find any useful information on that.
Positive power comes through the via near the red lead.
Ground is on the perimeter of the chip.
The flashlight is turned on and off via a switch on its back, which connects the case to the battery ground, so the IC seems to have some sort of memory to retain its information for prolonged periods of time.
I assume the IC switches the left leg (connected to the blue lead via two 500 Ohms resistors in parallel) to ground, which is on its middle leg.
Does anyone have a datasheet for this chip? Searching for the markings wasn't very helpful.
To mod it, I'd remove the IC and solder a bridge from the left to the middle port - does that sound reasonable?


texts: How to restrain this soft latching power switch from eating too much current?

texts:
I am designing a two buttons soft latching power switch for a project involving a raspberry pi, li-ion cells I salvaged from the battery of a broken laptop, and a power booster from adafruit.

I wanted the circuit to be controlled by two momentary push buttons : one for ON and another for OFF (so this is NOT a regular one button soft latching switch).

I came up with this design :

P1 is the battery input (5V currently regulated by a 7805, see details at the end) and P2 the output to the raspi (requires 5V).
I am beginning in electronics but this is how I understand it :
When you press SW1, Q1 gets activated, so current can pass through. The base of Q2 gets activated too, so that it is no longer required to hold down SW1.
When pressing SW2, the base of Q2 gets pulled to ground, so the base of Q1 is no longer connected to ground, thus cutting off the circuit.
Without the capacitor C1, noises can trigger the circuit making it unreliable.

I tested this circuit with a LED first, and everything was ok, but I had some doubts about getting it to work with a bigger load, like the pi.

As I thought, when testing with the pi, there is not enough current to power it fully : its power LED is very dim, and it cannot boot. Also, I have to hold down the OFF button for a few seconds, otherwise the circuit gets ON immediately after.

So I thought well, I don't have enough power coming out of there, but I could use this circuit to drive a single transistor as a switch.

So here is the revised design :

The result is way better now : The pi's power LED is very bright, and it tries to read the SD card and engage the booting process. But it's still not enough. The pi seems to loop into its first booting process, without getting completely ON.

To add more details not showing up on these schematics : As I wait for the power booster to ship (I just ordered it), for a quick and dirty alternative, I am using a 7805 to get the voltage of my 11.1V laptop battery down to 5V.

So my questions are :

Is my design correct considering what I want to achieve ?

I only have those BJT (547 and 557) at hand right now, they are rated 50V 100mA, are they really efficient ?

The resistors' values were chosen quite randomly, inspired from what I saw on some forums (there was one guy who retro-engineered a similar circuit from a chinese product, so I thought well, those values might be ok). Are the values of the resistors really well chosen ? (I still don't understand how to choose them well)

Finally, is it safe to keep that circuit connected to the battery when in OFF position ? Will it still draw current ?


texts: Resonance frequency of filter independent of resistance?

texts:
I have the following circuit and problem.

What is the resonance frequency of the filter, \$ \frac{\mathbf{I}_{out}}{\mathbf{I_{in}}} \$?

I found this rather straight forward formula for the resonance frequency for a parallel RLC circuit.
\$f_{resonance}=\frac{1}{2\pi \sqrt{LC}} =\frac{1}{2\pi \sqrt{62\text{nF} \cdot 63\text{nH}}}=2.55 \text{MHz}\$
Okay, so from the formula it's seems like the the resonant frequency is about 2.55 MHz, but is this right? Is the resonant frequency independent of the resistance? Why even include it then?


texts:
I've noticed that when soldering small PCBs can get very hot. Since I haven't yet been able to find a good vise in which to hold PCBs, I mostly hold them in my hand and after several minutes of soldering, they tend to get uncomfortably hot.

I haven't seen many information on Internet about this, so I'm asking for tips here.


texts:
I'm trying to make a hole partially through a PCB in Eagle to allow a reverse mount led to shine through to the other side. I got this idea when I saw a torch shine through a pcb where there was no ground plane on either side as shown below.

I have some 1206 SMD leds and want to figure out how to design a hole in Eagle that only cuts through about 1/2 of the pcb or layers 1-15. I did some googling and couldn't find anything relating to this.


texts: How to use sensor to measure amount of ink used for each print job?

texts:
Problem:

I have done a bit of research and noticed a lack of this feature in the official software by the major inkjet printer manufacturers to measure and record the amount of ink used in each print job.

This is useful for home users and critical for commercial users to find out the true cost for each print job.

I found one by Epson(official software).

Software: https://www.epson.eu/lfp-ink-cost-calculator-app

Review of the software: https://imagingspectrum.com/blog/2016/07/track-the-cost-of-print-jobs-on-epson-p-series-printers/

However, it is closed proprietary software and device dependent, Ie, only meant for Epson printer.

For printer companies are widely known for their excessive ink profiteering, it is very hard to imagine that they would open their platform(API) for third-party developers.

In the spirit of the maker movement, I would like to gather more information around this area and hopefully hack out a solution for any chosen printer.

Ideal Solution:

1) Before Printing: To anticipate the amount of ink to be used for the print job.

2) After Printing: To record the actual ink used for the print job.

3) The amount of ink used/to-be-used to be listed by their colors(refer to screenshot in the review link).

Implementation Options:

a) Hacking the printhead driver.

This method mainly revolves around messing with the software(driver). It also takes a lot of time in codes digging and writing the hack. But to do it at the driver level, it could potentially accomplish all #1, #2 and #3. However, this method may not be even possible as drivers for non-Epson printers may not be addressing ink usage at the get-go.

b) Adopt an ink tank system and attach a "valve meter" on the tube connected to each ink cartridge.

This method is more of a hardware/electronics implementation. It may involve a microcontroller/sensors at the "valve meter" level to monitor ink flow and record ink drawn from the tank. Data will be saved, manipulated and displayed on an external dashboard in whatever way we want it. It seems like a neater solution in theory. However, it wouldn't be able to accomplish #1 (which is not a bad trade-off). But this creates a one-off solution that is device independent, Ie, virtually works on any printer with ink tank system. Huge plus!

--

If you have any suggestions and/or know-how, I would be delighted to hear from you and love to see this project through.


texts:
Simultaneously touching my dishwasher (i.e. the aluminum coating on the inside) and my kitchen sink just gave me a rather unpleasant electric shock. Measuring the potential showed around 110v between the two. Shorting the connection, I measure around .2A.
My questions are:

Am I right that this is unacceptable?
Would any device bring remedy, e.g. an Fi-plug between dishwasher and wall socket, or
should I just get rid of the dishwasher?
And, living in Europe with 230v@50Hz, what could be the source of those 110v?

(I somehow suspect a quite sounding "yes" for 1. and 3., but I might well miss something.)
Thanks


texts:
I probably spend most of my time in OrCAD / Allegro schematic capture just trying to find relatively simple parts.  I'm assuming I'm missing something critical, as I've never had any formal training on the software.

For example, if I'm trying to find a Zener diode, in which library do I look?  This goes for all sorts of simple circuit building blocks.  For passives (caps, resistors, etc) I just use the pSpice components, is this the correct way to do that?


texts:
I'm working on a relatively simple board design using a PIC18F87K22 processor.  It spends most of its time asleep, waking up to send an alert via an embedded cell module when there's an external interrupt, or when triggered as a scheduled check-in by the real time clock.  It's using an external oscillator (CM200C32768DZFT) to drive the real time clock, and I'm noticing some occasional strange behavior.

Specifically, I'm noticing that the scheduled check-in is triggered much more frequently than expected, or sometimes much less frequently.  I'm sending the current clock status along with the cell packet, so that I can see that the device has apparently incremented by 60 minutes, even though much less time than that has passed.  It's not off by a consistent factor (and, as noted above, sometimes it can be fast or slow), and I have only seen it affecting some of the devices; others that are apparently identical appear to work fine.  Also, it's an issue that only appeared when we began testing outside in cold weather (the device is intended for outdoor operation).  Bringing one of the affected devices inside and letting it warm up does seem to resolve the problem.  However, we have not been able to replicate the problem indoors under controlled conditions, even in a freezer that reaches the same low temperatures that the device was exposed to outside.

So, a problem that only shows up sometimes, only for some devices and not others, and only under certain environmental conditions certainly seems to point to a hardware production problem.  But the failure rate is higher than I'd expect, and when we tried swapping out the oscillator on one of the affected boards from another that we knew was working, the problem stayed with the board, not the oscillator.  I'm attaching the relevant portion of the schematic and the board design itself.  Maybe there's something I'm doing wrong with the connection to the oscillator, maybe the oscillator itself should be replaced with a different component, maybe there's something obvious that I'm not thinking of in the circuit design that can cause an intermittent problem like this.  I'd be happy for any recommendations or suggestions.

Edited to add:

Hmm, and maybe I'm looking in the wrong place for the source of the problem.  There is another oscillator on the board (FOXSDLF/160-20), tied to pins 49 and 50, maybe that's the primary clock input.  That one is tied to ground with 2 22pF capacitors.  I'll continue to do more research, but any additional comments or suggestions would be welcome.

Edit to add further:

No, I think I was right the first time.  X1 is the primary oscillator, used for setting the main processor frequency when powered.  X3 is the secondary oscillator, used to drive the RTC even when the processor is asleep, and used to drive RTC-based interrupts.


texts: A4988 current limit formula: Where does the constant "8" comes from?

texts:
I am trying to calculate the VREF for my A4988 and while my A4988 is not from pololu I am using their formula over at https://www.pololu.com/product/1182 to calc the current limit.

The formula used (and seen elsewhere) is
$$
V_{REF} = 8 \cdot I_{MAX} \cdot R_{CS}
$$

Can somebody hint me to where the 8 comes from? I can figure the I and R out but the constant is not clear to me.

The only 8 I found was the minimum voltage for pololu's driver and since my driver has a min rating of 12V I kinda hesitate to go blindly with 8.


texts: How to calculate thermal resistance when I have two metal sections as shown below?

texts:
I have to calculate the Thermal Resistance of the heat-sink which as below.

The ICs top is first first connected to a solid piece of Aluminum and then that solid Aluminum is connected to top plate of the Unit.
In this case, how to calculate the thermal resistance of the "Solid piece of Aluminum + top plate"?
Even some pointers to any reference design will help.
Thanks.


texts: Using port 0 in AT89C52 without pull up resistors

texts:
So at my university professor gave us following scheme to program this double 7 segment display on the right. At start I tried to simply adress it using P0=(someData) although it didn't work. Then I asked my friend how to do it and he said that during lecture professor said that if you want to make it to work you have to adress left part of display as:

unsigned char xdata left _at_ 0xFE00;

and right part of display as:

unsigned char xdata right _at_ 0xFD00;

The question I'm having is why specifically those adresses make it work for port 0? I tried to use other adresses such as 0xFA00 and 0xFB00 and it didn't work. I've also read specifications, documentations of programming those microcontrollers although I didn't find anything.

Can someone explain why it works like that? It apparently is some trick and I'm reaaally curious.


texts: Interfacing external high speed ADC techniques

texts:
I am designing a power converter for solar micro-inverter based on fly-back topology (step-up).

I have to extract maximum power from the solar panel and for this I analyze voltage and current change with respect to my switching characteristics.

I measure voltage during OFF-time of my PWM and measure current (both high side and low side) during ON-time of my PWM. Currently I am using the on-chip ADC in my Infineon XMC4500 controller (12 bit, 1 Megasample/s) which is hardware synchronized with the PWM.

I wish to use external ADC with high resolution (16 bit or more). I tried with ADS1115 but it appears to be too slow for precise time measurement (100 kHz I²C bottleneck - my assumption).

How I can interface external ADC with my controller?


texts: On a 3-terminal bench power supply (+, -, GND), are there positive and negative drivers behind each of the terminals?

texts:
In a 3-terminal power supply like this, are there individual regulators behind the positive and negative terminals? For example a LM317 on the positive and a LM337 on the negative?

If not, what kind of circuitry drives a floating output like this, in general?

Side question, probably related: If you can connect either terminal to ground, why doesn't the connected terminal dump current into ground?

I want to build or buy a bench power supply, and I'm having trouble understanding how one control set can drive positive or negative voltage.


texts: Is it possible to measure multiple photodiodes on one pin?

texts:
I'm trying to use multiple photodiodes to detect passing objects. Currently, pins are at a premium. Is it possible to use an array of photodiodes on one or two pins? VCC and ground are not counted. The schematic below is how I currently measure one photodiode.

Thanks in advance!

simulate this circuit – Schematic created using CircuitLab


texts: How does a 5,000 watt hub motor differ from a 4,000 watt hub motor (Both BLDCs), when powered by a 72V 100Ah Lithium ion battery?

texts:
I'm trying to design a motorcycle conversion kit for an underprivileged population in a rural area. I'm currently looking at potential hub motors to be powered by my selected battery (as mentioned in the title question). However, different manufacturers display different prices depending on their motor's wattage. I wanted to know whether it even mattered?

The controller I'm looking to use is a 72v 100A Sabvoton controller. Since, from what I have gathered, my controller needs to handle the output from my power source (please feel free to tell me if I am wrong here).

Thank you!


texts: ESD Capacitor Calculation, 330Ohm Series Resistor and ESD Clamp Voltage

texts:
I have a input power filter circuit.
It has ESD Protection capacitors which help to protect the downstream circuit from ESD Pulses.

ESD Capacitors Specifications :
C0001, C0002, C0003, C0004 = 47nF, 100V, 10%, 0805
My ESD Pulse Specifications :
Contact Discharge : +/-4kV & 150pF / 330Ohms
Contact Discharge : +/-8kV & 150pF / 330Ohms
Air Discharge : +/-15kV & 150pF / 330Ohms
My ESD Calculation:
For example, I take the +/-8kV & 150pF spec
Consider the -8kV pulse
Q=CV ;
8kV * 150pF = 1200nC
This Charge will then get to the input ESD Capacitors :
V=Q/C;
1200nC / 23.5nF = 51.06V ----- This is less than 200V (both capacitors are connected in series)
Required Capacitance:

=((8000V*150pF)/40V)-150pF = 29.85nF  ---- Assume my Clamp voltage is 40V at the cathode of D0002
Therefore, the voltage ratings of the capacitors are satisfied. But the required capacitance is very much higher than 23.5nF which I have.
My questions :

Are my calculations of the Required Capacitance section correct? If they are correct, my circuit will fail at -8kV pulse right? What to do in this scenario?

I have never included the 330ohm series resistance in my theroretical calculations. Should I include the 330ohm series resistor in my calculations? If so, where?

On what should should I set my ESD Clamp voltage? In this case, I have set it to 40V since the absolute maximum ratings of the components present in the downstream is 40V? Is it Ok ? Or on what basis should I select my ESD Clamp voltage?


texts: Dimming LED lights with PWM, driver quite far from LEDs, noise considerations

texts:
There were a few questions like this before, however I haven't found ultimate answer yet.

I'm going to drive LED lights in my house with multi-channel driver (PWM controller + MOSFET Transistors), which is going to be located in a basement.

At this time cables are already plastered inside walls, they are 4 x 1.5mm^2 each (for RGB). Some of them are 10m long, some of them are 50m long. There is no option to split the driver into single channel drivers and put them close to LED bulbs, so I'm stuck with this solution.

The target lights varies in power, some of them are going to take 300mA, some of them 5A or maybe 10A.

The PWM frequency is going to be somewhere between 200Hz and XXkHZ.

I'm worried, that this solution is going to cause serious interference.

What devices are going to be interfered and how badly?
FM Radios?
GSM / 3G / LTE Signal?
WiFi Signal?
Any others?

What other problems should I consider?

How can I prevent unwanted side effects?

I have also seen this solution for some professional home-automation systems, like ABB 'Light Controller, 1-10 V, x-fold, 16 A, MDRC LR/S x.16.1, 2CDG 110 08x R0011'


texts: Half bridge DC-DC converter circuit analysis

texts:
I was trying to learn how the flyback and half bridge DC-DC converter is working.
For Flyback circuit,

Understood output waveform is as follows.

Keeping this understanding in mind, I was trying to analyze the Half bridge DC-DC converter working.

MOSFET Part number: BUK7K17-60E

Current flow as per my understanding is

For M1 is conducting: VIN -> M1 -> T1-> C2->GND

For M2 is conducting: VIN-> C1 -> T1 -> M2 -> GND

Please correct me if I am wrong.

Also, any direction to the current and mosfet drain voltage characteristics (plots) will be appreciated.

Datasheet of LM5109B: Link


texts: Are selected values for R1 and C1 reasonable?

texts:
Can anybody help with the circuit and specifically the selection of values for \$R_1\$ and \$C_1\$?

I tried to create a p-channel based MOSFET 1A switch for MCU based upon OnSemi AND9093  Using MOSFETS in Load Switch Applications.

After reading the application note the following choices were made:

\$R_1\$ is 5 \$k\Omega\$ to limit current through Q1 to ~1mA at +5VDC
\$R_3\$ is 5 \$k\Omega\$ sized for ~1mA through the GPIO pin of MCU
\$R_4\$ is 50 \$k\Omega\$ to drain any voltage between GPIO pin of the MCU, when MCU is not yet
initialized to prevent accidental switching on.
\$R_4\$ is 50 \$k\Omega\$ based upon 10 times
the value of \$R_3\$.

The application note also refers to the need for \$R_1\$ and \$C_1\$ to limit the inrush
current due to the capacitance of the load. Thats where I got stuck. The formula (eq. 8) on page 4 is

\$R_1 = R_2\cfrac{(V_{in} - V_{sg(max)})}{V_{sg(max)}}\$

where

\$V_{in}\$ = +5V
\$R_2\$ = 5000 \$\Omega\$
\$V_{sg(max)}\$ of IRF7406 (\$Q_2\$) =[Gate-To-Source Voltage] = \$\pm\$20V (Did I read the data sheet correctly?)

It looks like using the negative value for \$V_{sg}\$ does not make sense as it would result in negative \$R\$. Is that correct?

The calculation is then

\$R_1 = \cfrac{5000 (5 + 20)}{20} = 6250 \Omega\$

The formula for \$C_1\$ (eq.9) is on page 4. I estimate \$C_{load}\$ as 20\$\mu\$F and \$I_{inrush}\$ at 5A. Are assumptions valid? Regular load will be \$I_{load} = 0.5A\$

Then I calculate  \$C_1\$ as 0.001716\$\mu\$F. Does the value for \$C_1\$ make sense?

I plan to use the circuit for 12V in another incarnation, so I am trying to understand the calculations.

IRLML6346TRPBF is selected for lower Rds compared to 2N7002 for example.

P.S. I am an amateur DYI trying to do simple things.

Here's the updated schematic without D2:


texts: What classes to take to start learning about ARM?

texts: I want to learn more about the cortex M0, M3 and ARM cores in general and am willing to pay up to 1k for classes.  What are the best ways to spend that?  Best ways for someone interested in consumer electronics (not at the scale of a building a computer, more at the scale of building IoT widgets).


texts: How to setup STM32F103C8 encoder triggered output signal

texts:
I have a project where I need to read the encoder phase A&B to output the pulse so I can drive a motor, I did some research and saw this picture where it is exactly what I wanted to do:
output a pulse signal to a gpio pin triggered by the rising and falling edge of both A & B.
my setting: using STM32CubeMX: encoder mode TIM2.
Now, can someone point out to me where and how I can output the pulses into a gpio pin? I only want to output the pulses when the encoder is running in a clockwise direction. I now can read the correct encoder value.
I tried outputting the signal like this:
    Data1=(TIM2->CNT);
            Data1=1;
         delay_us(1);
        Data2=(TIM2->CNT);
            Data2=2;
        if(Data1!=Data2){
             HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
         delay_us(5);
            HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_RESET);

however, the output signal isn't consistent.


texts: Selecting suitable relay for car fuel pump

texts:
I am working on a project in which i will control the car fuel pump using relay to turn it on or off.

I want the relay to be suitable for keeping the fuel pump continously working for over 15 hours so that if the car goes on long journey i will be sure that the relays wont turn it off.

I know fuel pump use only 12A 12vdc

is this suitable
https://www.ebay.com/itm/362076806216

and some pcb relays say  max25a/1 hour .does this mean it will not be able to work more than 1 hour ?

Thanks in advance


texts:
I am doing a pretty specific project, where I plan to connect up to 150 devices, mostly depending on ESP32 and a few ESP8266 devices.

All of them will be located in a tiny space of around 5-8 square meters.

Are there any research or norms (like ISO in Europe) that touches that topic?
Is it healthy to have so many active devices in such a small space?
How many wifi devices (ESP32 or ESP8266) can be “mounted” in one square meter (Ideally some researches or legal norms, not “just experience” or “commons sense” because this project aims to be a commercial one)
Is this a really health concern?
are there any research on that?


texts:
I have a device powered by a 5S NiMH battery. The device sounds a low voltage alarm at 6.6v.
When fully charged, the NiMH reads around 7v or higher.
I have a few small boost converters. Could I hook up a separate 5v supply to the boost converter, setting the boost converter to 6.75v or so and wire it alongside the NiMH?
The NiMH would keep the voltage higher than the boost converter and the converter would not do any work until the voltage dropped below 6.75v, preventing the 6.6v alarm and utilizing my backup supply in the case that the NiMH cannot maintain 6.8v or higher.
Is this correct? A higher voltage on the VOUT of a boost converter would generally cause the boost converter to sit idle?
Thank you!!


texts:
Thinking about supply voltages, and just voltages in general used to power anything, does, say a 5v supply alway have to come from +5V and ground, or can you bias it to any other set 5V apart, like 12V and 7V, or 2V and -3V?. Since voltage is just potential difference right?

Now I know they bias transistors for amplifiers, but could you do such a thing to a microcontroller? (No application just really curious).


texts: What is slave select signal on the APB bus for?

texts: I am currently working on an APB BFM and I have a question regarding the bus protocol. I understand every slave on APB bus has its own unique address space, where its internal registers are mapped. Why do we need the slave select signal then? Is it to save energy? Or am I wrong and each slave has an internal address map and their internal register addresses can overlap?


texts:
I am working on a block design to compute the coordinate in the complex set represented by a pixel.  Given an x and y pixel value, the step size, and starting x and starting y I need to compute a coordinate in the complex plane. For instance x' = start_x + step * x

Since x is an integer I first pass it though a floating point conversion module and then through a floating point fused multiply add.  This has a total latency of 24 cycles.  The problem is that I also need to provide a memory address at the beginning and get it out 24 cycles later before I pass it on the the module which gets x' y' and the address.  I am looking for an IP which can help with this.  The closest thing I have found is a shift register but I would need 24 of them.  I was thinking of maybe using a FIFO.  Is there anything that just acts as a latency delay for data while other calculations are being performed?

PS:  Not sure why I called my Fused-Mul-Add fmax