texts: Best way to power a 12V-2A load using 18650 Li-Ion batteries

texts:
I would build a small present for my friend's child who has a 3D pen like this:
3D pen link

By now it only works with an AC-DC adaptor, so it always requires a wall plug. My idea is to build a battery pack to allow the use even when there's no AC plug.

Reading the "3D pen tech. details" I sketched some project requirements:

voltage: 12V
current: 2A (max I suppose)
Li-Ion battery like 18650
At least 3000mAh capacity
Integrated IC for battery recharge and battery over-discharge protection
Others IC to protect output and avoid overheating etc (if required)
3D printed custom case, so I'm not too dimension limited (smaller is better obviously).

My first idea was to use 4 18650 cells, to reach a voltage between 16.8V (full charged) and 13.6V. Then using a step-down board to level voltage to 12V.

Another solution will be using only 3 cells (12.6V - 10.2V) without any regulator, and using only a over-discharge IC. This solution is the simpler, but I have no idea if the pen would tolerate under/over voltage.

What do you suggest? There's any other solution to achieve that?


texts: Why are VCC and GND on diagonally opposite pins?

texts: I noticed that most of ICs (DIP or SOP) have VCC and GND pins on diagonally opposite pins. Decoupling capacitors must be connected with shortest traces. Placing power pins in the corners makes the traces (inside the chip and outside on PCB) longest possible. It doesn't make sense to me, what's the purpose of doing it this way?


texts: Why use FREERTOS instead of the interrupt mechanism on a microcontroller?

texts:
This might be a very stupid question.

I have experience with embedded software on bare-metal and just started with FREERTOS. However I don't really understand why one would use FREERTOS instead of the built in interrupt mechanism. The goal of multitasking is to give the impression some sort of parallellization is going on on a single core (similar to multithreading). If you have a main function that is running specific functions continuously, next to this you can have different interrupt routines with different importance levels that can interrupt that main function and then return to the main function. With an embedded OS you have some task running and it then gets interrupted to run a task with a higher priority.

So far in my eyes the final result seems pretty similar, could someone correct me and/or give some more explanation?


texts:
I need to control a bulb of 220V, with different intensity light levels.
I've an Arduino Uno Board, which receives a variable voltage from a Light-to-voltage converter (TSL12S) (Like a photoresistance).

Depending of the received voltage in the Arduino board, I need to vary the light intensity of the bulb.

The output of the board is PWM, so I think that I need to connect to a DIMMER.

How to connect the PWM output to a Dimmer, and how to control the bulb with this?
I've been looking for Dimmers in order to connect this, but all the dimmers that i've seen have a potentiometer to regulate this, and I need to regulate with the PWM output from Arduino.


texts: Converting a push on/push off SPDT switch into a toggle

texts:
I'm working on a small electronics project: trying to convert a guitar footswitch into a push-to-talk foot pedal.

At my disposal, I've got a Teensy acting as the actual HID device (to be connected to a computer via USB), a single-pole double-throw footswitch button identical to this one, and the footswitch case itself.

My issue is that I'd like this footswitch to be a toggle: at a high level, putting your foot down should enable speech capture, while releasing it mutes a connected microphone.

Is it possible to reliably implement this kind of logic in the Teensy given that the switch I've got on hand is a push on/push off?


texts: Collector feedback resistor amplifier q-point

texts: Why the Q-point of an amplifier with collector-feedback resistor are stable and not randomly moves on output BJT-curves when the power supply in applied to the circuit? The schematic is below:


texts: battery drain rate when half batteries are empty

texts:
I have a small portable device that is powered by 4 alkaline AA batteries.

After X hours of usage, I see the "low battery" indicator flashing. At that point I assume that all 4 batteries are ~5% full (or something).

What happens if don't have 4 new batteries but only 2? So in the device I end up with:

5% full battery
5% full battery
100% full battery (new)
100% full battery (new)

Will the device display the "low battery" indicator after X/2 time of usage? Or is there a possibility that it'll go through the new batteries at a faster rate, thus I should always try to replace all 4 batteries instead of just 2?

Also, will the device at that point think that it's 50% full? Does it work that way?


texts:
I'm working to interface with an old serial protocol.
All I have actually is the frame format and various timings.

I need the baudrate to sync correctly and use the data properly.

My frame is 15 bits (one start, 12 data, one parity, one stop)
One bit is held for 10ms
One frame is 150ms
(spec says 4ms between frame, I think this is useless and it's just the change-time-rising stuff from/to 0/1)

I tried to find some calculations on the web but found nothing...

Any help for that?

Thanks.


texts: Simplest design approach for PWM control with power MOSFET

texts:
I'm designing an application in which the current running into a load is controlled by PWM. A microcontroller generates a PWM cycle at 20kHz and this signal is used to control a MOSFET which is directly connected to the load. The load absorbs 10A at 100% duty cycle, at 12V DC.
The load is a thermoelectric module and the purpose of the circuit is to have a basic temperature control. No fancy features are required, just the easiest and wastless design approach.
Which is the easiest configuration in order to achieve this?
My basic understanding is that a pattern like MCU>mosfet driver>mosfet>load would be the best option. How could the "black box" mosfet driver + mosfet possibly be designed in order to minimize the number of components while keeping a low level of EMI and dissipated power?


texts: Simple circuit to convert a RF frequency (~100MHz) to voltage without using IC

texts: I am just wondering if there is any simple circuit to measure the frequency of a signal near 100MHz. A FM demodulator IC may do it but I need it to be simple and without ICs (aka, only containing discrete R, L, C, diodes, transistors and such). There is very loose requirement about the response time -- as long as the output can settle in less a second when frequency shifts by 20%.


texts:
I am going through analog electronics.

I have seen many designs but I have a few questions below :

My Questions :

I understand that resistors are used to limit current in some places. And in other places, resistors are used to pull up/pull down the voltage and make sure that node is in a defined voltage state instead of the node floating.

I have gone through some articles and websites that recommend to take the resistor value between 10k to 100k if its for pull up or pull down purpose. I agree that you can pick depending on your application.

But I see in someplaces in other designs where the analog circuits having transistors, have resistor values like 22.6k / 11.5k / 82k. Why is there so much disparity in picking the resistor values?

Is it to limit current in those places or is it to hold up the voltage to a defined state? Or like biasing a transistor or to bleed the current of the node slowly?


texts: Can I use a LED Driver to control a Solenoid?

texts:
I have on order an LED driver and I want to use it as a simple 12v DC output to control a Solenoid Valve.  The Driver says Constant Current & Constant Voltage.  I obviously don't want 1A pumped into the Solenoid.  I will of course put a Diode in to protect against back EMF.

Have I chosen the wrong type of Transformer?
I will be using a relay to switch the solenoid on and off with the output of the LED Driver as the feed to the solenoid (I will probably put the relay on the input side of the LED Driver so it is not always on).

Thanks in advance.


texts: Is it practical to measure an unknown capacitance by measuring its impedance?

texts:
I've recently seen some fourth year engineering projects at my school (University of Waterloo) and one that I found interesting was this novel pressure sensor that uses nano silver separated by a di-electric gel. It is very flexible and the pressure causes a change in capacitance. They are not electrical engineers and for their demo, they used an Arduino to measure the time constant of the RC circuit. It took 1 second to produce a reading.

It could be much nicer and presentable if the reading was instant and I was wondering why they didn't try measuring the capacitance by measuring it's impedance?

So I looked online to find information about finding unknown capacitances with an Arduino and found nothing regarding measuring the impedance.

Though, this one used a 555 timer which is very clever!

My Approach

My circuit design would be as follows:

First I would use a known resistance value in series with the capacitor and use a known and consistent AC wave to put through, then attempt to measure the voltage drop due to the capacitor. According to the impedance calculation for capacitors $$Z=\frac{-j}{\omega C}$$ where \$\omega\$ is known and Z is measured so I can determine C.

Measuring Impedance

To measure impedance I would put through a half wave rectifier, then a peak detector circuit and read the DC voltage on the peak detector with an Arduino, afterwards discharge the capacitor through the transistor.

I don't know if this would work or be practical; I can't test it at the moment since I don't own any electrical equipment and I'm preparing for exams.

Thanks for the insight!


texts: What are these hybrids from National Semiconductor?

texts:
I found some parts in my junk drawer that I can't identify. I'm pretty sure they're National Semiconductor hybrid circuits from 1969-1970, but I have no access to a National Hybrid Products databook. The part numbers are:

NS NH0009C
NS NH00012C

Both are in 12-lead TO-8 cans. Does anybody know what these are, or better yet, can point me to a datasheet?

Thanks


texts:
I excitedly received a ESP8266 based 5v relay board today (https://www.ebay.co.uk/itm/ESP8266-5V-WIFI-Relay-Module-TOI-APP-Control-For-Smart-Home-Automation-System/202004110898).  The ESP8266 daughter board looks like the AI-Thinker ESP 01 (but is not badged as such).  It is configured via serial connection.  I am using a ch340 usb to serial.  I am powering it with a USB phone charger (5v; board has a 5v>3.3v reg).  The device appears to power on correctly and creates a WiFi AP with SSID AI-Thinker_xxxxxxx.  I can connect to that AP and ping the device.  I believe it has stock Espressif AI-thinker firmware but do not know the exact version.

I have tried all the common baud rates (9600, 57600, and 115200) but only get something unintelligible where I should get the boot welcome.

I have tried gtkterm and minicom (on Ubuntu).  I also tried PuTTY on a different laptop with windows. Still get the same (i.e. same output for each baud setting).  It does not appear to respond to commands.

What is the next step to diagnosing what's wrong?

[Update]- 1) The initial baud should be 74880 according to http://wiki.ai-thinker.com/_media/esp8266/esp8266_series_modules_user_manual_v1.1.pdf .  I have tried this (tx and rx) but still get junk.

2) This thread http://www.esp8266.com/viewtopic.php?f=6&t=4459&start=4 suggests some units are dodgy and I should try reflowing solder joints (TX does look a bit dry) and/or flashing firmware.

3) In the mean time I ordered a new nodemcu board with a built in USB TTL.

Thanks


texts:
I am starting out programming micro controllers and I was reading some documentation and textbooks. I am a little confused as to what the difference is between a Micro-controller and a System on chip?

Some documentation use these two terms inter changeably. However most textbooks point out that using the two terms inter changeably is NOT correct, thus there must be some notable difference...

Thanks!


texts: What's wrong with my Comparator (Hysteresis)

texts:
My intention is to design a comparator to be used to sense the voltage change in the sensor. Exploring further into comparator's I got that, I must implement Hysteresis to avoid unnecessary switching and use the design in harsh environments.

Below is the circuit diagram and R5 is output change from the sensor

Here is the simulation graph:

I am unable to understand the sharp fall and rise between the resistances 190K and 370K. Since I am using Hysteresis, the comparator must operate in saturation region always. What can be issues?


texts: Gating Sequence for MOSFET in Simulink for a Resistive load Microinverter

texts:
I am trying to design a simple Micro inverter, using a solar cell and four MOSFET's with a resistive load.

How do i get a phasing sequence for the MOSFET's in the following circuit :-

Circuit : -

Solar cell produces a DC output using 25 Degree Centigrade as temperature, with 1000 Irradiance
The DC produced is then supplied to MOSFET's, parallel branches of two each

How do i design the Gating sequence of these in simulink, using PWM?? Or is there any other way??


texts:
The problem I am having is with my PIC24FJ64GA002 and the UART module(s). The 24F I have is in a SPDIP28 package and it is a new B5 chip (just one under the latest B8 revision) from Microchip Direct. I have checked for errata issues which afflicted me last time with the I2C module.

Anyway, I am setting the UART1 module up as a simple transmitter. I am using PPS pin RP8 as the RX, RP9 as the TX and RP11 as the CTS pin. For now I have grounded RX and CTS as I do not need them. I have set the BRG at 115,200 (actual rate ~114,285.7, but it's close enough.) I am using the code below. I expect to see a series of bytes streaming out on RP9, but I do not. RB15 is a debug output: it pulses on each byte being sent. On RB15 I get a really slow clock, about 700 Hz, which is very low for a 115,200 baud link; I'd expect about 14 kHz.

#include <p24fj64ga002.h>

#include <uart.h>
#include <pps.h>

void init_osc()
{
    // Must be programmed for FRCPLL mode.
    //UNLOCK_OSC();
    CLKDIVbits.RCDIV = 0;
    //LOCK_OSC();
}

void main()
{
    int i = 0x55;
    PPSUnLock;
    // Initialize oscillator (set FRC to 8 MHz.)
    init_osc();
    // Initialize UART1 PPS.
    iPPSInput(IN_FN_PPS_U1RX, IN_PIN_PPS_RP8);
    iPPSInput(IN_FN_PPS_U1CTS, IN_PIN_PPS_RP11);
    iPPSOutput(OUT_PIN_PPS_RP9, OUT_FN_PPS_U1TX);
    PPSLock;
    // Interrupts disabled for now.
    //ConfigIntUART1(UART_RX_INT_EN | UART_RX_INT_PR6 | UART_TX_INT_EN | UART_TX_INT_PR6);
    OpenUART1(UART_EN & UART_BRGH_SIXTEEN & UART_NO_PAR_8BIT & UART_1STOPBIT, UART_TX_ENABLE, 34);
    TRISBbits.TRISB15 = 0;
    while(1)
    {
        LATBbits.RB15 = 1;
        LATBbits.RB15 = 0;
        while(BusyUART1());
        WriteUART1(i);
        i++;
    }
    CloseUART1();
}

I feel like I have missed something obvious, but cannot figure out what it is. If anyone has had previous experience with the UART module on 24F series devices, please let me know! I've had little luck with the Microchip forums.


texts: 4BIT DAC has negative voltage at op amp output

texts:
My school task was to simulate a 4BIT DAC converter in multisim. Im supposed to simulate the circuit when the switches are on/off and measure the output on the op amp.
I think the circuit works fine but I dont quite understand why the voltage is negative. I checked the poles and tried to invert reinvert it but nothing works.
Is it standard for it to be negative? Or?
If my circuit is built wrongly please tell me how to fix it
Thank you very much


texts: Single MOSFET current source (JFET like)

texts:
Is it possible to build MOSFET current source similar to JFET current source like this:

simulate this circuit – Schematic created using CircuitLab

With MOSFET it should be something like this:

simulate this circuit

However, MOSFET current source doesn't work.
As far as I know, it should be possible to do this, since JFETS are controlled in the same manner as MOSFETs.

Or am I wrong?:)


texts: Are there many logic circuit solvers available to test / download?

texts:
All -

I have found something called "Simple Solver" located here:

http://home.roadrunner.com/~ssolver/syn.html

and you can download it here

http://www.softpedia.com/progDownload/Simple-Solver-Download-103308.html

My question is: Is Simple Solver the only one out there that solves digital circuits for you given inputs / outputs you want? Is there other software besides Simple Solver that will solve digital circuits?

Would appreciate all / any advise.


texts: How can I change the PID controller gains (Kp,Ki,Kd) in Arduino with potentiometers?

texts:
I am using the PID library in Arduino in order to control the temperature of a laser. The thing is that I would like to be able to change the controller gains Kp, Ki and Kd from external potenciometers instead of doing it directly from the code.

As you may already know, in order to tune the PID you have to play a bit with these gains and this is why I would like to do it in real time instead of have to compile and charge the program in Arduino every time I want to change any of the values.

The way of declaring the PID in Arduino is:

PID myPID(&Input, &Output, &SetPoint, Kp, Ki, Kd, DIRECT);

What I undersand from there is that you can pass the value of the Input, Output and SetPoint by reference, which allows you to update the values at every loop. But Kp, Ki and Kd are constant values that are defined at the begining and they can't be changed while runing the program.

I would like to know if it is possible to update those values while the program is runing because otherwise I don't think I'll be able to tune this PID properly in less than one month.

Thanks.


texts:
I have a single channel 2:1 MUX (TMUX7219 datasheet) and I'd like the module to switch channels whenever I connect a USB to my board.  The USB's 5V+ line will connect to the SEL pin and EN will always be 5V.
The table below specifies that when SEL pin is driven high (1.8V-VDD) S2 is connected to the drain, but I am wondering what will happen if SEL is not connected to anything?  This will happen when I unplug the USB and the VDD line, will S1 be connected to the drain or will neither S1 or S2 be connected?
My goal is to have S1 connected to drain when a USB is not connected to the board.
Also I am assuming VSS is equal to GND in this situation?

This is what my circuit currently looks like:


texts:
Following is a power supply with dual +-15V output:

http://docs-europe.electrocomponents.com/webdocs/13f8/0900766b813f8a87.pdf

I'm confused to understand two points:

1-) What is the difference between Output A and Output C ? Both looks variable. One is 1A the other is 0.2 A. I cannot figure out what is the difference. For dual op-Amps which one should be used?

2-) It also says 0 to 30V. How can it be configured for that? Output A with +15 plus and -15 GND?


texts: How to detect angular position of a device mounted on a rotating wheel?

texts:
Is there a sensor that can sense whenever rotating wheel pass the ground? Like when mounted on a bicycle wheel rims, but without anything mounted on a bicycle frame - only mounting on a wheel it self is allowed.

Sensor does not have to be much accurate, but must be fast to detect ground passed at up to 3000rpm (or at least 1000rpm). I would like to connect it to a MCU also mounted on a rotating wheel.


texts: How does the spectral response of a photodiode change with bias voltage?

texts:
Look at this data sheet, in the second page we have a graph for the spectral response.

Now, I have learned that photodiodes must be reverse-biased in order to get a decent signal from them, but then someone pointed out to me that all of the measurements in the data sheet are made at 0 volts, not at the reverse bias voltage, and so it would stand to reason that the spectral response was measured with 0 volts too.

Now, there must be a difference in the signal of a biased and an unbiased photodiode, right? A biased one produces a larger signal to the same amount of light intensity, right? That would mean that the spectral responses of biased and unbiased diodes are different.

Then the obvious question is, what is that difference? And for that matter, I would like to know all the properties of my photodiode at the voltage I'm going to use it at. How can I calculate those values?


texts:
In the following circuit, why does a certain amount of current flow into the transistor in the below circuit?

I can understand once the push-button switch is turned on, there would be current flowing through it:

But what does it flow in before then?


texts:
I need to control TFT backlight via single GPIO output from atxmega128a4u.

The LCD backlight requires +3.0V, while the rest of my schematic runs on +3.3V. I do not have access to backlight ground pin, as it is connected to ground in the TFT module. The module consumes 50mA in total, I have no idea how much power is consumed by backlight, but it should be more than allowed max 20mA from a single MCU pin. I do not want to use more than one GPIO due to pin shortage.

So, in other words, I need to have a simple schematic to supply +3.0V with at least 50mA, that is controlled by +3.3 microcontroller output.

simulate this circuit – Schematic created using CircuitLab


texts: Increase current draw of a low-voltage DC fan circuit

texts:
I have a DC fan circuit that is intended to run off of a portable USB battery pack. The fan is a 5V brushless computer fan that draws approximately 250mA. The issue I am running into is that all the portable USB power supplies I have been able to find automatically shut off if the current draw is low enough, as they assume the attached device is "charged" and no longer requires power.

Is there anything I can implement in the circuit to increase the load on the power supply without decreasing the voltage on the fan? The power supply is able to supply at least 1.0A according to the specs on the packaging.

The exact portable USB power supply in use is this model: https://www.amazon.com/MyCharge-Style-Power-Portable-Charger-Black/dp/B01LZUL0BN/ref=sr_1_12?ie=UTF8&qid=1497299186&sr=8-12&keywords=mycharge+portable+charger


texts: Are memory-mapped registers actually implemented as real registers?

texts:
I am currently trying to better understand microcontroller-architectures and I am particularly studying the ARM cortex-m3 right now. What I have always wondered is, if memory mapped registers are actually implemented by some kind of bistable circuitry like e.g. general purpose registers are?
So by memory mapped registers I mean e.g. the ones contained in the System Control Block of the cortex-m3.

Also is there a difference considering the configuration registers of the core itself vs. control registers of peripherals that the manufacturer adds to the die? Additionally sometimes the configuration / communication memory that can be addressed by bus-systems like i2c or modbus is referred to as registers, are these also actual registers?


texts: Measuring rotations problem with motor encoder

texts:
I have this motor encoder mounted on the back of a 120RPM motor which has a gearing of 298:1 ratio. The back shaft is directly from the motor, not through any gears.

Im using an encoder disk that has 3 "wings". Exactly this one,

These encoders have 2 outputs for quadrature decoding.

This is my understanding.

1) Using the 3 wings and interrupting on the RISING edge of the signal I should have 3 * 291 transitions per full rotation of the shaft?

2) I only care about how much the wheel has turned by so I can control it to do half rotation, one rotation, x rotations etc. I dont need to know the direction or speed etc.
So am I right in thinking I only need to use 1 output rather than both and having to do full quadrature decoding?

My problem

I have this connected directly to an arduino and have one function that is an ISR that is triggered on the rising edge. The function only has one line and increments a variable "ticks".

In my main loop I have it only checking "ticks" and if it = 873 (one full rotation according  my understanding of rising edge and 3 wing encoder) then it stops the motor.

The problem is that its undershooting and stopping short each time.

Is there a problem with my understanding on how to properly use the encoder and its data or is it not that simple?

Thanks


texts: AUTOSAR clarification about the data type

texts:
I have seen the following typedef

the link of the document isAUTOSAR CAN NM

He refers to the term container and mapped to the data type CanNm_ConfigType. what does the term container mean?

So the structure CanNm_ConfigType should contain the elements in the picture above? Am I correct? Please advise.


texts:
I wish to get 12VDC @ 4 amps from Sager HVGC 65 Watt power supply. Datasheet: https://www.sager.com/_resources/pdfs/product/HVGC-65.pdf

I have attached a picture of the datasheet. I would like to use the HVGC-65-1050. I am confused because it says current adjustment is only from 650 - 1050 mA. But at 12 VDC I should be able to pull atleast 5 Amps right?


texts: Microcontroller to allow or block DC current based on low voltage DC trigger and time-out

texts:
Apologies if this has been asked before, but i couldn't find anything, thought that may be due to my lack of understanding of the terminology.

I wish to know if a microcontroller can do this, and if so what i need to look for to find one.

I'm trying to use my Turn-Signal to Trigger a side view camera, but need to somehow convert the pulsing flow from post blinker into a steady flow.

My reading so far indicates a capacitor wouldn't be able to do this effectively, though if it could and i misunderstand that would be ideal.

My though is to set up a microcontroller that upon reviving a pulse of power from the blinker could somehow allow power from a 12V DC connection that by-passes the blinker, through into my camera set-up and stop that power flow if it dose not receive a trigger pulse after a set amount of time, so that it would shut off once the turn signal stops blinking.

I thought of using a Relay to act as the switch, but was unsure how to find, or if one even if one existed, that could be switched on by the pulse and be maintained by the small amount of power that passes the resistor in the blinker in between contacts, again if such a thing is available that would greatly simplify this task, but it seems as of now a microcontroller is the only way to go.

Hopefully someone will know the answer, and sorry if my explanation is unclear or my question is a simplistic one, i am new to this kind of work, and i don't know enough to know what i don't know or need to learn.

Any help would be much appreciated, thanks in advance,
~Lin


texts: How to measure which spark gap is firing, in a type of Tesla coil, using an Arduino

texts:
Firstly, I am teaching myself electronics and do not know all the lingo at this point in time.
With that said, I have conceptualized a fun(?) project in the back of my mind which consists of multiple spark gaps (inspired by Tesla coils.)
What I want to do is measure which spark gap fires (A, B or C) and then record the data using an Arduino.
Building the circuit is pretty trivial, recording it without damaging anything is a bit out of my pay grade at this stage in my "career."
The circuit will look like something like this where the sensor would be the "secondary" coil in a typical Tesla coil arrangement (although I do not need the super high voltage.)

How would I use the sensor (or secondary coil) to tell the Arduino, that spark gap A,B or C has just fired?


texts:
I'm trying to measure the bandwidth of a TIA with a gain of 1e9 on the first stage and 10x on the second stage. The first stage OpAmp is the LTC6268 with a 1G Ohm feedback resistor and the second is a LTC2050 with a 10k/100k feedback. I'm getting correct values for measured gain and my noise floor is fairly good, but the next step in testing the performance of this TIA is its bandwidth.

I know that typically, you would hook up a sinewave and sweep it to find the -3dB cutoff, but I've been told this is not entirely correct, since it doesn't compensate for the capacitance.

The set up is a function generator with a 100mVrms sine wave, sweeping from 0Hz to 100kHz, feeding into a 1G Ohm resistor to give a 100pArms current. This is connected directly to the input of the TIA.

I don't understand enough of the physics and elemental electronics to know why this setup is incomplete. Any pointers and literature would be most welcome!


texts:
So online, I found this 555 timer FM modulator circuit. But To make this a working FM transmitter, is all I have to do is attach an antenna to the output modulated signal? Or do I have to also have a series LC resonant circuit tuned to the carrier frequency?

Link: FM Modulator Circuit Using 555 Timer IC

Circuit:


texts: Deployoing compiled program from Atmel Studio or Avr dude to Atmel "XMEGA-A3BU Xplained"

texts:
Im attempting for the last 3-4 days to connect the Atmel dev board to the computer in order to either load the .elf or hex file to the bootloader in order to turn on a LED.

Im following instructions based on the online document 'Atmel AVR1916: USB DFU Boot Loader for XMEGA"

The dev board is powering on & I see the menu displayed correctly on the LCD.

My OS is Windows 10, my IDE is Atmel 7 & my device programmer is avr-dude.

These are my steps:

Press SW0 while connecting USB
Connect PC6 to GND while connecting to USB
I tried using Flip to write to the flash & write to the board, however Flip displays error "Could not open USB device".
Initially the dev board shows up as COM port "XPLAINED Virtual Com Port", however after updating the drivers the Windows device manager refreshes and the dev board shows up as "USB Serial Device (COM6)"
I updated the USB Serial Device in Device Manager with USB drivers included with Flip & tried again connecting/finding the device however again Flip displays error "Could not open USB device".

See below:

Then I re-plugged  in the USB to make sure that everything & repeated Step 1.

In Windows Device Manager the dev board is still  "USB Serial Device" so Ok.

I retried several times with Flip until switching to "avr-dude"
Now using AVR dude GUI I tried writing the hex to Flash, in the GUI menu I selected:

my target device
then I pointed to my .hex that was built via Atmel studio
Then in the Setup menu, I tried at atmel available options as device

programmer avr109,avr910,avr911

For avr109  & avr910, I got the following error output:

trying to connect to device... by 1st pressing "verify"
Found programmer: Id = ""; type =
Software Version = . ; Hardware Version = .
Programmer supports the following devices:
Device code: 0x40 = (unknown)
Device code: 0x40 = (unknown)
Device code: 0x40 = (unknown)
Device code: 0x40 = (unknown)
Device code: 0x40 = (unknown)
Device code: 0x40 = (unknown)

For avr911, I got:

trying to connect to device...
Connecting to programmer: .
Found programmer: Id = "@ d"; type =
Software Version = . ; Hardware Version = .
avrdude: error: buffered memory access not supported.

Then I tried programming the device using Atmel 7 studio, therefore I went to Tools menu & Device Programming, but all the options are empty there is no Tools or Devices to select.

I also changed the USB wire just in case.

Please help , what do I need to do to deploy my HEX file to the Atmel  "XMEGA-A3BU Xplained" dev board?

I will accept any answer either using Atmel Studio, Flip, or Avr dude.


texts: How to communicate to ATmega328 with a PC

texts:
I need to  connect the ATmega328 to a PC to show the datas that are gathered from the microcontroller, in Visual Basic .Net.

I have done it successfully using the Arduino board with USB cable.

But in order to make a PCB, I will not use the Arduino board, so I referred many articles
where it stated that I need MAX232 interface in between.

Can you explain why I need a MAX232, in order to make a circuit connection between the computer and the Arduino?


texts: Setting a pin on PORTA in the PIC18F452 high: Compilation of code failed

texts:
I am trying to write code that will set bit0 on PORTA in the PIC18F452 high if any of the conditions in the IF statements has been met. I am using the MPLAB ICD2 debugger and the Microchip C18 Toolsuite. The code is as follows:

#include <p18f452.h>

void main (void)
{
    // array containing vital sign values
    unsigned char pulseR = 0x32;  // syntax error
    unsigned char sysP = 0x64;
    unsigned char diasP = 0x26;

    // acceptable limits for vital signs according to relavant heath officials
    unsigned char pulseR_ULimit = 0xA0;
    unsigned char pulseR_LLimit = 0x28;

    unsigned char diastolic_ULimit = 0x5A;
    unsigned char diastolic_LLimit = 0x3C;

    unsigned char systolic_ULimit = 0x8C;
    unsigned char systolic_LLimit = 0x5A;

    TRISAbits.TRISA0 = 0;

    //Comparing obtained values with acceptable limits
    if (sysP < systolic_LLimit || sysP > systolic_ULimit)
    {
        PORTAbits.RA0 = 1;
    }
    else if (diasP < diastolic_LLimit || diasP > diastolic_ULimit )
    {
        PORTAbits.RA0 = 1 ;
    }
    else if (pulseR < pulseR_LLimit || pulseR > pulseR_ULimit )
    {
        PORTAbits.RA0 = 1;
    }
    else
        PORTAbits.RA0 = 0;
}

Added:

The Build output is as follows:

 Debug build of project `C:\Users\Owner\Desktop\School Files\ECNG 3006 2011\Labs\Lab 3\Softare-Hardware Only\Lab3_3.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Sat Nov 19 13:56:03 2011
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Users\Owner\Desktop\School Files\ECNG 3006 2011\Labs\Lab 3\Softare-Hardware Only\Lab3_3.mcs".
Clean: Done.
Couldn't locate build tool.  Check tool locations.
----------------------------------------------------------------------
Debug build of project `C:\Users\Owner\Desktop\School Files\ECNG 3006 2011\Labs\Lab 3\Softare-Hardware Only\Lab3_3.mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Sat Nov 19 13:56:05 2011
----------------------------------------------------------------------
BUILD FAILED

Can somebody please help me troubleshoot this code?


texts:
it is known that power losses (which become heat) in circuits are due to resistances, because of Joule Effect. But sometimes I read that dissipation is due to the real part of a certain impedance, and these two statements are not exactly the same thing.

For instance, let's consider a parallel between a resistance and an inductance:

Let's evaluate the equivalent impedance of this parallel:

Now, if the dissipated power is due to the real part of this impedance, there is something that I do not understand. In fact, if R = 0, Re{Z} = 0 so there is no active power, and that's ok.

But we may see that not only R determines the value of Re{Z}: also L, for instance. And how is physically possible that L determines a power loss?

Moreover: how is physically possible that R acts on the reactive power (which is known to be determined by L and/or C...)?


texts: Way to test control loop without using it in real life

texts:
I am trying to use a (discrete) I-PD controller to regulate the temperature of a pan I will be using to homebrew. However I would like to test my controller calculations and code, without having to fire up my heater and finding out 5 times in a row that I did something wrong. Is there a simulation I can use to test my code?
Code for reference
#include <Arduino.h>

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 2
#define RELAY 3
#define PERIODMS 2000
#define PWMVALUE 50

#define RESET 0

// Start value = 20 degrees
// Endvalue = 93.5 degrees
// DeltaTemp (DT) = 93.5 - 20 = 73.5
// T1 = time at .735*DT = (0.283*73.5) = time at DT == 20+20.80 => T = 20+20.80 = 40.80
// T1 = 691.690550
// T2 = time at (0.632*73.5) = tijd time at DT == 20+46.45 => T = 20+46.45=66.45
// T2 = 1426.1424958
// Tsys = 1.5(T2-T1) = 1101.6 s
// Theta = T2-Tsys = 324.5 s
// Ksys = 93.5/50 = 1.87 degC/%
#define Tsys    1101.6
#define Theta   324.5
#define Ksys    1.87

// Cohen-coon
#define Kc ((Tsys/(Ksys*Theta))*((Theta/(4.0*Tsys)) +(4.0/3.0)))
#define Ti (Theta*(32.0*Tsys+6.0*Theta)/(13.0*Tsys+8.0*Theta))
#define Td (Theta*(4.0*Tsys)/(2*Theta+11*Tsys))

#define Ts (0.1875*Theta)

// #define q0 (Kc * ( 1 + (Ts/(2 * Ti)) + (Td/Ts)))
// #define q1 (Kc * (-1 + (Ts/(2 * Ti)) - (2*Td/Ts)))
// #define q2 (Kc * (Td / Ts))

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

uint64_t startTime;
uint16_t flipTime;
uint8_t setPoint;

void setPWM(uint8_t pwm) { // in %
    if (pwm > 100) {
        pwm = 100;
    }
    flipTime = PERIODMS*pwm/100;
}

void setSetpoint(uint8_t setpoint) {
    if (setpoint > 95) {
        setpoint = 95;
    }
    setPoint = setpoint;
}

float getSensorTemp(bool report) {
    static float currentTemp = 20, lastTemp = 20;
    sensors.requestTemperatures();
    currentTemp = sensors.getTempCByIndex(0);
    if(currentTemp == -127)
        currentTemp = lastTemp;
    if(currentTemp != lastTemp){
        lastTemp = currentTemp;
        uint32_t secondsPassed = (millis() - startTime)/1000;
        Serial.print(secondsPassed);
        Serial.print('.');
        Serial.print(uint32_t(millis()-startTime-secondsPassed));
        Serial.print("; ");
        Serial.println(currentTemp);
    }
    return currentTemp;
}

uint16_t control(float e0, float y0) {
    // u0 = output(t-0), u1 = output(t-1)
    // e = error, y = process output (degrees)
    static int32_t u0, u1;
    static float e1, e2, y1, y2;

    u0 = u1 + Kc * (-y0 + y1 + (Ts/Ti) * e0 + (Td/Ts) * (-y0 + 2 * y1 - y2));
    if(u0 > 100) {
        u0 = 100;
    } else if(u0 < 0) {
        u0 = 0;
    }

    u1 = u0;
    e2 = e1;
    e1 = e0;

    return (uint16_t)u0;
}

void setup(void) {
    pinMode(RELAY, OUTPUT);
    digitalWrite(RELAY, LOW);
    while(RESET);

    Serial.begin(9600);
    sensors.setWaitForConversion(0);
    sensors.begin();
    delay(1000);

    // Start heating
    digitalWrite(RELAY, HIGH);
    startTime = millis();

    setSetpoint(80);
    setPWM(100);
}

void loop(void) {
    float currentTemp;
    static uint64_t lastPeriod = 0, lastControl = 0;
    static bool pinState = digitalRead(RELAY);

    do {
        currentTemp = getSensorTemp(true);

        // Control function if passed sampletime
        if(millis() >= lastControl + Ts) {
            control(setPoint - currentTemp, currentTemp);
            lastControl = millis();
        }

        // PWM Calculations
        if((millis() >= lastPeriod + flipTime) && pinState) {
            digitalWrite(RELAY, LOW);
            pinState = LOW;
        }
        if(millis() >= lastPeriod + PERIODMS) {
            lastPeriod = millis();
            digitalWrite(RELAY, HIGH);
            pinState = HIGH;
        }

    } while (currentTemp < 95);
    digitalWrite(RELAY, LOW);
    while(1)
        getSensorTemp(true);
}
```


texts: dangers of building electrical arc furnace

texts:
I am currently rewinding 2 microwave transformers to create an electrical arc furnace. I have taken the secondary coils out of each transformer and am planning on winding new ones. In theory the device should output about 200 amps at 36 volts. I got the idea from a series of youtube videos, links to which are below. The guy, who seems experienced with this kind of stuff, is using 8 gauge wire to wind his secondaries. I have purchased raw 6 gauge stranded copper wire. I have wrapped all of the wire in 3 layers of electrical tape (the hardware store didnt sell insulated). However, a quick google search indicates 6 gauge wire is only safe to use up til 55 amps. Even with the two transformers, each would be handling around 100 amps, which is almost double the amount the wire is rated for, yet this guy somehow pulled it off reliably with 8 gauge wire which only supports 40 amps.

A few questions.

Would operating this device burn my secondaries if using continuously for only brief periods of time?
Is using electrical tape to wrap the wire a bad idea?
If using electrical tape is a bad idea, how would you recommend an alternative safe insulation method?

I recognize the obvious dangers and lethality of this project, however i have taken precautions and am attempting to inform myself to avoid any accidents.

Youtube Links:

Part 1
Part 2
Furnace Building


texts: Interfacing three UART devices to Microcontroller without loss of data

texts:
I have a microcontroller TM4C123GXL Launchpad, that has 8 serial UART ports. I am using Keil uVision5 with  Tiva Ware for programming.

I wanted to interface 3 UART devices with the microcontroller without any loss of bytes. The baud rate has been set to 115200 bits/sec with no parity as shown in the figure below. All devices sent data frame periodically every 5ms.

TX and RX time are calculated using No_0f_bytes*10/BaudRate

I have successfully interfaced the devices with the UART of µC.
The problem in the communication is that that I am losing the bytes. If I do a communication with a single device (Device 2) I am still losing the bytes from the whole frame (20 bytes).

Is it due to the 16 byte FIFO limitation of Tm4c123 or anything else?

I have also implemented the µDMA feature of TM4C123. But still, bytes are lost.
What can I do to improve the system for lossless transmission and reception of data frames?

Edit:

Here is the Software Architecture:

I am using Periodic Timer Interrupt of 5ms to receive and transmit the frame.
All frame has first 2 bytes header and a counter byte as the last byte.

void Timer1IntHandler(void) //  Periodic Service Routine every 5ms
{

DisableIntrupts();

bool Correct=ReadJoystick(); //10 bytes  Device 1

if(Correct)
{
GenerateServoCardsFrame();

SendServo1Frame();   //20 bytes  Device 2
SendServo2Frame(); //17 bytes  Device 3
ReadServo1Frame();  //15 bytes Device 2
ReadServo2Frame();  //20 bytes Device 3

GenerateJoystickFrame();

SendJoystickFrame(); //10 bytes   Device 1

EnableIntrupts();
}

}

main()
{
SetupClock()  ;   //Setup 16 MHz Clock
SetupJoystick();  //Initalize uart1 port for Device1
SetupServoCard1(); //Initalize uart2 port for Device2
SetupServoCard2(); //Initalize uart3 port for Device3

InitalizePeriodicTimerHandler(5);   //Periodic Service Routine every 5ms  (Timer1IntHandler)

while(1)
{
}

}

bool ReadJoystick(void)
{
    int BytePos=0;
    int CountInvalid=0;
    int LoopoutTime=0;

    while(1)
    {
    if (ROM_UARTCharsAvail(UART1))
        {
            ByteRX = ROM_UARTCharGetNonBlocking(UART1);
            if (BytePos==0)
            {
                if (ByteRX== 0xA1)      //Header1 found
                {
                    KArray[0] = Bytebuf ;
                    BytePos ++;
                }
                else
                {
                    CountInvalid++;
                    if (CountInvalid>5)
                        return 0;
                }
            }
            else if (BytePos ==1)
            {
                if (ByteRX == 0x66)      //Header2 found
                {
                    KArray[1] = ByteRX;
                    BytePos ++;
                }
                else
                    BytePos=0;
            }
            else
            {
                KArray[BytePos++] = ByteRX;
                if (BytePos==10)
                    return 1;      //Frame Recived
            }
        }
        else
        {
            SysCtlDelay(0.25*SysCtlClockGet()/3 / 1000);        //   0.25ms delay
            LoopoutTime++;
            if (LoopoutTime > 10)
                return 0;
        }
    }

}

According to my calculation, 1 byte requires 10/115200=0.08680ms and to read a FIFO of 16 bytes requires 1.38ms.  The table in the figure shows total Tx time of 4.08ms and Rx time of 3.91 ms which sums to 8ms. This is greater than my Periodic Interrupt Service Routine.

Do I have to increase the Periodic Interrupt Timing?


texts:
I have a cheap set of Phillips SHE3000 earphones with a broken wire on the plug. Since I was repairing another set of headphones, with the same problem, I bought an extra plug, just to try repairing them too.

Here's my problem - inside the cable for each channel there's not only the ground for it, but also some weird white hairs. It does not look like those would survive soldering.

What are those and what should I do with them?


texts: Confusion about dot convention in an ideal transformer

texts: I am confused about voltage polarity and current direction in transformers , for example the equivalent circuit of the ideal transformer in figure(a) the instantaneous voltage polarity of the secondary is positive at the dot terminal,if we connect a load across the seconday terminal, isn't supposed that the current goes out from the dot to the load? or does that mean that the voltage and current of the secondary side are 180 degree out of phase?


texts:
I read some about a full wave rectifier on this website and when it got to the section of smoothing capacitor, and showed this graph and schematics:

It was also said that:

  Here the 5uF capacitor is charged to the peak voltage of the output DC
  pulse, but when it drops from its peak voltage back down to zero
  volts, the capacitor can not discharge as quickly due to the RC time
  constant of the circuit.

This got me thinking about the mathematical analysis of this circuit, because I wanted to know what the time constant is. I assume it is not T = RC like in a resistor-capacitor series circuit, but something else.

So I assume the circuit can be shown like this now:

simulate this circuit – Schematic created using CircuitLab

Only now V1 isn't really a sine function but rather this:

I have Googled for a the math here but I couldn't find much, the best thing I found was this, showing how to find the impedance or current in the circuit.

My questions are:

How can I describe the source (V1 in my circuit below), the output of the bridge rectifier, as a mathematical function?
What is the time constant here?
Here is something I'm very confused over. If the voltage is equal in a parallel circuit, aren't the waveforms supposed to be the same? How is the waveform of the voltage on the capacitor different from the one on the source (again, V1 in my circuit).

Thank you.


texts: For a microcontroller, does pulling up a GPIO pin consumes more power than pulling it down? (I've got the option to pull a GPIO pin up or down)


texts: How to design pcb layout for a scroll wheel I bought that didn't come with pcb

texts:
So I bought a scroll wheel and want to connect it to my raspberry pi 2 so I can program it to interact with a web app I'm writing. I'm a brand new hobbyist to electrical engineering. I have learned that I need a PCB to use this scroll wheel with my raspberry pi but the part didn't come with a pcb like other different types of switches did and the datasheet that I was given didn't provide a pcb circuit design.

It only gave a layout and I was told by a friend that that is not enough to design a pcb. That layout is in the PDF link I attached(the specific specs for what I bought are on page 3 of 3). How do I design a pcb layout for the part that I need?

I found lots of software that I can design it with but the problem is that I don't know what to design or how to design it correctly. All I know about this part is that is has a thru-hole connection.

Datasheet - http://www.ckswitches.com/media/1346/tsw.pdf

Part name - TSWB-3N-CB222 LFS

(Central select with jog and 4 directions, black central button, dial & direction ring)


texts: SMD Component blown in earphone circuit in S9 mobile phone - please help identify and how?

texts:
Hi all,
I am trying to identify the components marked "MT" and "7" in the first picture.  They are in the earphone circuit of a UK Samsung S9 G960F mobile phone. The repair company said the component marked "MT" is an inductor and has blown due to accidental damage caused by a "voltage zap" and denied a warranty claim. One channel of the headphone output no longer works and the repair company said that swapping out the board does not fix the problem so there's a fault on the main board.
However, I believe the blown component might be a TVS diode but after much searching I have been unable to confirm either component.  Could an ESD strike or multiple strikes have caused it to fail open like this? What else could have caused this in normal use?
I am also struggling to understand the circuit here, unfortunately it's too small for me to be able to trace and the service manual does not include the circuit or component layout for this. If they are both TVS diodes, maybe they are unidirectional but then they would use two of the same component?  If one is a bidirectional TVS diode, what is the other component? If the component marked "MT" is an inductor it seems to be in place before the TVS diode and so maybe susceptible to an ESD strike?
The audio IC used is a CS47L93 and the data sheet for it recommends the use of TVS diodes as close as possible to the connector.  It also says it will work as an AUX output for connecting to other equipment, but I do not see any other protection circuitry apart from what I suspect are TVS diodes.  Should there be other protection circuitry to prevent DC / overvoltage / surge conditions?
I have maybe used the headphone socket about 20-30 times and have used it with one channel not working as I only really used headphones for directions and audio books while cycling.  I do have neoprene cycling overshoes and have walked over nylon carpets so I have experienced static shocks which is why I think it might be ESD related. I didn't know about ESD until this happened!
To give an idea of scale, the second picture shows the big metal USB-C connector on the right.  The components are too small for me to see without a magnifying glass or zoomed in photo as shown below. I measured the marked components which are 1mm in length indicating a 0402 package with 0201 capacitors around them.
I have found the component marked "7" in use in the headphone circuit in other mobile phones, the S7, S8, S9, Note8, Note9, the "MT" is also in the S8 with the same circuit.  They both seem to be in parallel with each other by looking at the traces and one side is ground.  On the G960U S9 board variant, the "7" components are missing and on the G9600 S9 variant the marked components are missing altogether and replaced by a single capacitor for each channel.
Someone has kindly measured the marked components out of circuit and found them to be open in either direction on the diode test and the maximum resistance range of his meter.
Thank you for your help and apologies if I have done something against the rules.


texts: STM32F411 SPI slave enters debug infinite loop

texts:
I've connected two NUCLEOSTM32F411RE together, and trying to send an ASCII letter from one PC to another PC in Simplex mode from master to slave.

When I send a character the slave enters a routine in startup_stn32f411xe.s
where it is written in the comment of the code
"This is the code that gets called when the processor receives an unexpected interrupt. This simply enters an infinite loop,
preserving the system state for examination by a debugger"

I've connected SPI2MOSI (master) to SPI2MOSI (slave) as described on page 6 (PC3 to PC3)

http://www2.st.com/content/ccc/resource/training/technical/product_training/d9/cf/69/ae/71/43/4f/23/STM32L4_Peripheral_SPI.pdf/files/STM32L4_Peripheral_SPI.pdf/jcr:content/translations/en.STM32L4_Peripheral_SPI.pdf

Also SPI2_SCK to SPI2_SCK (PB10) as well as
SPI2_NSS to SPI2_NSS   (PB12)

CPOL and CPHA are configured the same in the Cube. For the slave only I have
in the NVIC checked the SPI2 global interrupt interrupt priority 0, also have USART2 global interrupt.

The configuration of the SPI slave is like this in main:

void MX_NVIC_Init(void)
{
  /* SPI2_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(SPI2_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(SPI2_IRQn);
  __HAL_SPI_ENABLE_IT(&hspi2, SPI_IT_RXNE);//My addition

 /* USART2_IRQn interrupt configuration */
 HAL_NVIC_SetPriority(USART2_IRQn, 0, 0);
 HAL_NVIC_EnableIRQ(USART2_IRQn);
 __HAL_UART_ENABLE_IT(&huart2,UART_IT_RXNE); //My addition
 __HAL_UART_HWCONTROL_RTS_ENABLE(&huart2);//My addition

}

/* SPI2 init function */
void MX_SPI2_Init(void)
{
 hspi2.Instance = SPI2;
 hspi2.Init.Mode = SPI_MODE_SLAVE;
 hspi2.Init.Direction = SPI_DIRECTION_2LINES_RXONLY;
 hspi2.Init.DataSize = SPI_DATASIZE_8BIT;
 hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH;
 hspi2.Init.CLKPhase = SPI_PHASE_1EDGE;
 hspi2.Init.NSS = SPI_NSS_HARD_INPUT;
 hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB;
 hspi2.Init.TIMode = SPI_TIMODE_DISABLE;
 hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
 hspi2.Init.CRCPolynomial = 10;
 HAL_SPI_Init(&hspi2);
 __HAL_SPI_ENABLE(&hspi2); // My addition
 }

My IRQ handler in STM324fxx_it.c looks like this

void SPI2_IRQHandler(void)
{
 HAL_SPI_IRQHandler(&hspi2);
 uint8_t data1;
 HAL_SPI_Receive_IT(&hspi2,&data1,sizeof(data1));
 HAL_UART_Transmit(&huart2,&data1,(uint16_t)sizeof(data1),HAL_MAX_DELAY);
}

Why  is the interrupt unexpected on the slave side?

//Adding more info after suggestion,init USART slave main
void MX_USART2_UART_Init(void)
{

 huart2.Instance = USART2;
 huart2.Init.BaudRate = 115200;
 huart2.Init.WordLength = UART_WORDLENGTH_8B;
 huart2.Init.StopBits = UART_STOPBITS_1;
 huart2.Init.Parity = UART_PARITY_NONE;
 huart2.Init.Mode = UART_MODE_TX_RX;
 huart2.Init.HwFlowCtl = UART_HWCONTROL_RTS;
 huart2.Init.OverSampling = UART_OVERSAMPLING_16;
 HAL_UART_Init(&huart2);
__HAL_UART_HWCONTROL_RTS_ENABLE(&huart2);
}
//Masterside stm324fxx_it.c
void USART2_IRQHandler(void)
{
  HAL_UART_IRQHandler(&huart2);
  uint8_t data1;
  HAL_UART_Receive_IT(&huart2,&data1,sizeof(data1));
  HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin,GPIO_PIN_SET);
  HAL_UART_Transmit(&huart2,&data1,(uint16_t)sizeof(data1),HAL_MAX_DELAY);

}

The interrupt routine is prepared for bidirectional communication, and is not    entered since I've initilizing it in nvic with

__HAL_UART_ENABLE_IT(&huart2,UART_IT_RXNE);

and I am not trying to send from the slave conntected PC. The transmission to the slaveside PC, I hope to accomplish with

HAL_UART_Transmit(&huart2,&data1,(uint16_t)sizeof(data1),HAL_MAX_DELAY);

in

void SPI2_IRQHandler(void)//Thank's for your interest :)


texts:
Could this be a 5V to 9V/12V USB to DC converter?

Hello,

I recently visited an electronics shop in Asia where they sell this item (see below).

Could it really be that this product converts between 5V to 9V/12V? How would that even be possible? Wouldn't it be necessary to have a bigger adapter/transformer?

Vesa


texts: Ghosting Issues with IPS and TFT Panels ( from Waveshare and Sony ZUltra)

texts:
I've bought a used Waveshare IPS LCD and it has a ghosting issue, were as if you turn it on after about 30 seconds it starts to have ghosting and also burning on the edges effects, I am 90% sure that there is a problem with the LCD panel not the Driver board. Diagnosis steps that I've done:

Turning on the LCD and driver board at the same time: It behaved
        as I described
Turning on the driver board for 5min then connecting the LCD
        panel: things started to appear after connecting the panel
Turning on the LCD and driver board at the same time while LCD
        back-light is off the turning the back-light on after 5min: It was
        already ghosting and wasn't related to back-light
After being turned on for a while I had to keep it off for hours
        to all the ghosting get removed
Different back-light levels didn't made a difference
Different ambient temperatures didn't made a difference

I'm not an electrical engineer but as I researched I thought it might be a problem from a PCB part like capacitors, also if I leave it on for more than 20min it starts to flicker and the Faraday coil on the PCB starts to make noise.
    You can see the display model and the condition and also the PCBs below (sorry in advance for the image quality, didn't had a better camera):

https://mega.nz/#!TVFAjQ5Q!cSdygakuAvUJBQfzu2favwnQ_lEb7XdRMcdfsXHNJYQ
https://mega.nz/#!SBNSQapC!YSgl0yqac-tyU5eqvx9nIODA84SO47L-URM6HgNCXCI
https://mega.nz/#!LNM0HCoT!P2OCXkQDQckWi1lpIV3kp-2x_GTM1cEUVvoC9BdiFN

I can give you voltage read outs on the LCD panel's PCB pins if needed.

The other problem I have is with a Sony Z Ultra display panel. It has ghosting issue too, but it is not permanent and it is temperature sensitive:

Being in a ambient hotter than 18c starts the ghosting and small
       amount of flickering
Tried to eliminate all the parameter that could make noise on the
       signal by electrical taping over the display's flex cable parts,
       placing the battery distant from the flex cable and removing all the
       antenna parts near it and also spacing between the touch and display
       panel
The issue happens more when LCD's back-light is on lower values
Only 1/4 bottom part of the display has this issue and also it
            happens more when the display tries to refresh the image. Some time
            there are some black lines between the problematic part and healthy
            part
After using it for a month or two the problem got to all the
            display but bottom parts the issue was more intense
After being turned off for 6 months then turning it on I had no
issue, then after a day of use, it got to the 1/3 bottom part
The phone's display had been broken and been replaced with a used
            one then the issues started to show up

You can see the images below:

https://mega.nz/#!zUd0WIZB!CLLIk1Ggb2nchPBoORpwLGKn2XXDyu2fXkCncHlbGBY

As both display panel were bought as used condition, I don't know the original cause and time of occurring this issues.
    If your solution is to buy a new one, I am aware of that. But I want to find out the reason and learn new things and if possible fix the problem and thinker with it. Thanks for your help and patience.


texts: There are some Dr. Scholl's commercials showing their "foot-doctor-o-matic" station that measures the pressure your feet put down on a mat then tells you what insoles to buy.  How does the thing actually work; what sort of component is able to translate an array of force across a plane into electronic signals?  If the thing cheats and uses temperature, the question still stands; how can I record an array of pressures across a plane?


texts: Bricked ATMEGA328PB by setting low fuse to 0xF5 - How to recover?

texts:
While programming an ATMEGA328PB via ISP, I wanted to set the efuse to 0xF5.
By accident, I didn't write the efuse but the lfuse instead.

Since then, I cannot communicate with the chip via ISP anymore.

I am not entirely sure which mode the IC is in right now. Pg. 47 of the manual suggests to me that it is in Low Frequency Crystal Oscillator Mode.

I did desolder the 3-pin 16MHz resonator that was used previously and connected my function generator set to 32.768Hz in squarewave mode with 5Vpp and 2.5V offset to the XTAL1 pin. (XTAL2 is floating now that I've desoldered the resonator).
I've also connected the generators gnd to my pcbs gnd.
Then I've tried to connect to the chip with avrdude set to 500Hz Baudrate. (-B 500Hz).
Unfortunately, avrdude still cannot connect to the chip over ISP.

I've also tried the same procedure with 16MHz squarewave in case the IC is in Ext. clock mode to no avail. I've also verified with my oscilloscope that the function generators signal is indeed what it's supposed to be.

Is there anything I'm doing incorrectly here? How can I unbrick the IC?

Precaution: Using HVSP or HVPP is not an option because I lack a programmer for that.


texts: Why does my IR receiver PCB only work when I touch the sensor pins?

texts:
I have designed a PCB based on a schematic which I am pretty sure that is correct and I have tested the schematic several times on the breadboards and all of them worked properly.

But, after I designed the PCB I found that it only works when I touch the the photo diode pins otherwise it doesn't work normally.

My PCB is only 2 layers and I have not separated (GND,VIRTUAL GND,AND 12V POWER) in to a separated PCB layers.

Also, I have checked all of my OP-AMP voltage and input voltage and compared them with the breadboard, the result was that all of them were same as each other but, I can not understand why PCB doesn't work good and I have to touch the pins to make it  works.

I am new employee in a company and it is very important for them that I fix this issue, I tried a lot to fix this issue but until now I have not succeeded.

So, I will be appreciate if any of you guys can give me an advise or guide me to I be able to fix this or issue design a PCB that works properly.

Finally I have to mentioned that this schematic has been designed by very well known company and is 100 present is correct and good but this design is a little bit old maybe for 12 years ago.

I have uploaded the schematic here.

Thank you everybody for your help and time.


texts:
I built my own Arduino Uno. I designed the schematic and laid out the PCB for a school project. I am having problems getting the serial communication to work so that I can program sketches. Here are pictures from Pin0 and Pin1 of the headers (Rx and Tx) when I send information using an Echo sketch. I programmed the sketch using the ICSP.

What can I do to fix my issue?

Below are screenshots of the code and the serial monitor before and after I send a message.

When I took the pictures I sent a long random message so that I had time to freeze the scope.

Here is the schematic I made:


texts: Read USB Input on Android from IR sensor

texts:
A mainstream IR sensor has 3 pinouts:

Vcc: 5V power
GND: Reference ground
Vo: Analog/Digital voltage output

One can power the sensor using phone's mini USB's Vbus and GND (Can one?). Can one then use USB's D- and D+ pins to read the voltage from the Vo pin?


texts: how to combine calibration element to set HFRCOCTRL

texts:
I want to set HFRCO frequency.I have found the following  register called HFRCOCTRL the closes bitfiled i found is frequency range.
Using the calibration table ,how do i combine the two to set HFRCO to be 4Mhz?
Thanks.
https://www.silabs.com/documents/public/reference-manuals/efr32xg14-rm.pdf


texts: High pass filter for electret mic to mobile phone

texts:
I’m currently working on making a lavalier microphone for use with my phone and gopro camera. I know these types of microphones are readily available and can be purchased fairly cheap, but where would be the fun in that? I’ve purchased lavalier mics in the past and dissected and realized that they connect the electret microphone straight to the trrs jack using the 2-3v supplied by the mobile device or camera to power the microphone.  I’m trying to do the same but between the ECM and the TRRS I want to add a high pass filter. I attempted to try this on breadboard and there is no signal coming through with a high pass filter of 97 Hz.  Using a 170 ohm resister and 10uf capacitor. I have done some research and I cannot find anything that pertains to my exact predicament.

What I did,

Electret mic + to 10uf cap then to trrs but between the Cap and TRRS I put a 170 ohm resister to the ground wire.

The - side of mic I connected straight to ground on trrs with the 170 ohm resistor connecting to it.

Here is a horribly drawn illustration of how I wired the mic.

EDIT!!!!!!!

Guys take a look at this circuit now and see if it’s better.


texts: Question on certain terminologies in CMOS Technologies

texts:
So, when someone says a CMOS inverter (or any CMOS component) is "weaker" or "stronger". Is "weaker" referring to smaller Width and higher resistance (or the reverse; assume constant L)?
As an example:


texts: How to switch multiple signal lines with a single mechanical switch

texts:
I want to switch an FTDI interface with a single mechanical switch towards two different endpoints. The FTDI interface has six lines, four two-way digital lines, plus power and ground.

My mechanical switch should be a single SPST or SPDT switch.

With relays, the answer would look like the schematics below. I would need six SPDT relays for that.

I would like to have a smaller solution, with a minimum of components and complexity.
Voltage and currents of my circuit are low, about 3.3V and 10mA.


texts: Is the value Vm correct in a FM modulation?

texts:
Recently I calculated the Vm and the Vc.
However I think the value is ackward and strange.
This is the scope image:

With the information:

This is what I have done:


texts: Need explanation on how to flash HEX files on ATmega32u4 via AVR109 protocol

texts:
I am not an electronic expert, so forgive me if I am misusing the terms in my question or if my question contains imprecisions and/or misinterpretation on how a Leonardo Board works. Corrections are of course welcome.

I am trying to write a very simple chip flasher that, given an HEX file, will be able to flash it on a Leonardo board, via its bootloader. I understand that the Arduino Leonardo uses an ATmega32u4 and that the bootlaoder uses the AVR109 protocol.

Based on this information, I have been able to write some code that flashes bytes on the board, but once flashed, the code does not work.

My code roughly looks like this:

Parse the (intel) HEX file into a representation of how the memory should look like on the chip (i.e. for each record I extract the memory address to write to, and the data in the record).
For each couple of bytes in this representation, I issue a set memory address instruction, followed by a write low byte, followed by a write high byte.
Every 256 bytes flashed this way, I issue a write page instruction.

I have an hard time finding what I do wrong, because I am not sure about any of these steps. Step #1 produce data that looks OK (as one can see some familiar strings here and there):

...however, if I compare my data with the same HEX file flashed by AVRdude and loaded again from the chip, the two are widely different.

Step #2 works (the bootloader responds with a 0xD byte at each command, but I don't know if I am doing the right thing by flashing the low byte before the high one.

Step #3 also seem to work fine, but I am uncertain on whether memory pages are effectively 256 bytes large (I derived this figure from the chip's datasheet, table 28-11).

I will be extremely grateful to anybody who could review my "algorithm" and provide feedback on what I do right or wrong, and where are common source of errors in this kind of application.


texts: What purpose is there for having current flow in this direction for an Op-Amp

texts:
for the given schematic my professor had current flow from R2 to R1 when attempting to finding voltage gain. I'm just wondering why he goes from R2 to R1 and not the other way around. I know you can solve it that way but wanted to know if there were a specific reason for doing it like that. Thanks.

simulate this circuit – Schematic created using CircuitLab


texts: Design a circuit that detects if one input is a delayed version of the other

texts:
The above question has an answer, which I am not able to understand. I'll appreciate if anyone can guide me.I'm not able to understand the method used in the answer and procedure it went through.
The answer:
Assuming 1b input A is generated by a random sequence, 1b input B is a delayed version of A. The delay value varies, and can be [1, 10] (inclusive).
Design a circuit, that takes A and B as inputs, and Y as output. If B is guaranteed to have 1s, then Y should be 1.
module dly_seq_dec
(
    input               clk,
    input               rst_n,
    input               A,
    input               B,
    output logic        Y
)

logic [3:0] cnt;    // represent delay value up to 10

always_ff@(posedge clk or negedge rst_n)
    if (~rst_n)
        cnt <= ‘0;
    else if (A | B)
        cnt <= cnt + A - B;

assign Y = (cnt != 4’d0);

endmodule: dly_seq_dec

Obviously, “cnt” should be [0, 10]. If “cnt” > 10, then B is delayed for more than 10 cycles, and this is considered to be a spec violation. Designers should consider to have an SVA for this case.
If “cnt” < 0, then B is not a delayed version of A. This can happen when B sees a 1 but A never sees a 1. Designers should consider to write an SVA to detect the spec violation. In addition, “cnt” should be extended from 4b to 5b, and the MSB of “cnt” is for the sign extension.


texts: What is a good way to do parallel spice simulation?

texts:
I'm doing a project that needs quite an amount of circuit simulations. I have access to computing clusters but have no idea how to do spice simulations in parallel (or maybe if I find a way to run spice over terminal that could a direction?)

Has anyone had experience running parallel simulations before?

I also Googled that Xyce simulator is built for similar purposes, is that the right tool to use?

Open to any suggestions.

Edit update:

The circuit i need to simulate is quite simple. but i am required to vary the parameter of a few components many times and run transient analysis. By operating one computer i can only run transient one by one which is making the progress very slow. and that is why i wonder if there is a faster way to do it in parallel?


texts: How do I protect a unipolar ADC input against a bipolar signal?

texts:
I am designing a circuit that should convert a unipolar differential audio signal using an ADC. The signal varies between 200mV - 28V peak to peak and I'm planning to use the TI PMC6020 ADC that accepts differential inputs up to 10V RMS.
Unfortunately, the circuit may accidentally be connected to a bipolar signal (-20V to 20V peak to peak at maximum) during installation (this condition could last for several minutes). The ADC only tolerates -0,3V negative input, so there should be some protection against continuous negative voltage.
My first idea was to use a Zener diode connected from the ADC input to ground, but that will clip the signal at -0,7V.
A normal diode in series will not work either, as the voltage drop will affect the reading of the signal when the amplitude is low.
Any suggestion how to clamp the negative voltage in this case? Are there any ideal diode circuits that can be used for this purpose?
I have no split rails available, only 3.3V.


texts: Running resistors above power rating, but with temperature within spec

texts: I am building a circuit to heat a very small area to a relatively high (~100C) temperature. To achieve this, I'm using an SMD resistor controlled by a MOSFET, with an adjacent thermistor for temperature monitoring and control. To achieve faster heating I'm considering running a higher power through the resistors than what they are rated for, at least until they reach the needed temperature. As long as I control the temperature (via PWM control) of the resistors and maintain their temperature within what they are rated for (typically around 125C) are there any issues that would result from doing this?


texts: Modern equivalent for this 1980's capacitor?

texts: I'm trying to repair an old PC Engine game console and one of the missing components is a capacitor that looks just like a resistor. I'm not familiar with these and don't know how to read the colour bands or what a suitable modern equivalent might be. It's C137 in the picture, can anyone help? Thanks.


texts: Can a power supply still provide a voltage if it is broken?

texts:
I have an ATX power supply that I'm trying to use, but it doesn't seem to power my computer. The power supply turns on and the fans run and I also checked all the voltages, which are correct. However, it just doesn't seem to power anything through the 24 pin connector, even though the voltages coming out of the connector are fine. With the 4 pin connector, I can power some fans.

So is it possible that the power supply is broken but still outputs correct voltages?


texts:
I need to make 2 sets of 4 Common Cathode RGB LEDS. In each set of 4, every led must be individually addressable. It doesn't matter if both sets have duplicate outputs or not. (Although optimally they shouldn't, but thats not essential).

Now, I can't use IC's for this, except the CD74HCT4094 shift register which will be used to limit the pin usage on my µC. I did not decide this and it is out of my control so please do not ask.

I have been trying different things for a while now, but I can't seem to find a better solution than what I have here. This still needs 12 transistors and I feel like it can be built more efficiently so I'm not quite happy with it yet.

Does anyone have any ideas for improvement? Thanks in advance!

(Note that the switches are just for simulation / demonstration purposes and that they will be replaced with the according transistor setups.)


texts: Main contactor of star delta motor starter

texts:
Why do some control circuits of star delta starter use two normally open auxiliary contacts of the main contactor and others use one?
To me only one normally open should be enough.
Can a contactor have more than one normally open auxiliary contact?


texts: Why the replacement of 7812 with R-78E12-0.5, DC/DC makes the circuit not working?

texts:
I have this simple surge protector and soft start inside the PSU. My transformer is out of its specifications yields 21.3V after bridge rectification. And 0.1A load (12V fan for cooling pass transistor) makes the 7812 very hot (despite it has a heatsink). So i decided to replace the 7812 with R-78E12-0.5 as it is a pin-2-pin replacement to 78xx. But after i did it, the CD4027 started to do weird things... after I push the On/Off tactile switch the National Semiconductor 4027 always switch the relays ON and TI CD4027 always OFF. I have desoldered the R-78E12-0.5 out and put the 7812 back - and the circuit is working as it should be...

UPDATE:
After the answers of user287001 and Huisman I have completely reworked the Soft Start. The simulation worked. Will try it on breadboard in couple of days.


texts:
I have seen quite a few times now where someone creates a simple circuit and when describing the configuration of the components they say that it is either in parallel or serial.

I have only ever heard of parallel and series, is the word serial a mistake or are components in series also called serial ?


texts: Why can't this circuit amplify the oscillator signal?

texts:
In the first image, the left part is a Colpitts oscillator. It works at 40 MHz, output 300mV maximum.  The right part is a common emitter amplifier. Its gain is 10. The two transistor are s9018 - bandwidth is 400 MHz,hfe is 130.
I used a 100MHz bandwidth oscilloscope to measure its output. It does not get amplified at all - the output is lower.
I don't understand why does the oscillator output decreases when the frequency increases.


texts: Low and high impedance of low pass stepped impedance filter

texts:
I'm designing a low pass chebyshev filter using stepped impedance.

I'm using the book 'Microstrip Filters for RF/Microwave Applications' as a reference.

I have difficulty understanding how low and high impedances are defined. The book uses \$Z_{0L} = 93\,\Omega\$ and \$Z_{0C} = 24\,\Omega\$. I could not find an explanation for these values, I searched several articles but all uses an impedance between 20 and 120 Ω but does not explain how to calculate.

How can I get to this definition?


texts:
During a long-term, almost six month long, data acquisition in a proximity of scanning electron microscope I have found a significant source of magnetic field noise, which is altering the results. I have used the Spicer SC11 Magnetic Field Analysis system and focused on narrow-filtered RMS readings at 50 Hz. The readings are about 5 mG RMS, when the power was down the readings dropped to 0.3 mG RMS.

The problem is that the power line supplying the breaker panel is in the ceiling on the corridor next to the microscope and powers three precious devices drawing >5 kW each. Each consists of High voltage units, electromagnetic optics and supporting compressors and chillers.

The idea is to relocate the power line different way, which should reduce the EMF reading at the microscope. The microscope is supposed to be in a Farraday cage and the active EMF shielding is also installed in the lab.

Are there other options how to reduce 3 x 230 V @ 50Hz power line (IR) radiation to alter the results? Shieldings covering the cables, proper cable management, special cable arrangements, actual Farraday cage,etc.

So far I have found strategies how to protect wires and devices from the field outside. And some weirdos with aluminum hats. My target is to keep the field inside protecting the outside.


texts:
The Light Dependent Resistor (LDR) that I use in MintyTime, Excelitas Tech VT93N2, has been discontinued by the manufacturer. I'm having trouble finding a comparably priced (e.g. < $0.50 @ 100+) replacement part. It's been suggested to me that I should consider/investigate using a photo-diode (photo-detector), like this one, as a replacement part. Here is a snippet from my schematics where the LDR is used:

The LDR plugs into the SENSE_IN and SENSE_OUT nets. The SENSE_IN and SENSE_OUT nets then go to I/O pins on my ATTiny2313 micro-controller. SENSE_IN goes to an Analog Comparator input and SENSE_OUT goes to a digital I/O pin that I use to "turn on" the voltage divider formed by the LDR and fixed 22kOhm resistor when I want to take a reading (to save some power by not driving the divider constantly). I'm only trying to detect two ambient light states anyway "dark" and "normal" so that I can dim the LEDs when it's dark.

On to the question(s). If I use a photo-diode (like the one I've linked to) by plug in the anode into SENSE_OUT and the cathode into SENSE_IN should it be software / hardware compatible with an LDR as I've described its use in my application? My gut says yes, but I haven't used photo-diode before, and I thought I remembered something about them only responding to intentional signaling (like IR) rather than light levels... Or can you recommend a different one that is more appropriate / cheaper for my needs?

Alternatively, are there actually more widely available low-cost LDRs and I've just managed to overlook them in my searches at the major suppliers (e.g. Mouser, Digikey, and Newark)?

Whatever I do, I'll obviously have to buy a few and try it out, but any advice from the community would be appreciated!


texts: What is the name of contractors designing high power supplies with relay logic?

texts:
I have been designing a 3 phase power supply with distribution strip and redundant contactors with failure detection (I posted a question not long ago related to that, it's based on relay logic), and since we do not have related experience in my company I would like to hire a contractor to check and approve the design - perhaps finish it off and manufacture the units.

I have contacted various "electrical contractors" in the area, and they all responded saying it was beyond their expertise therefore I am starting to wonder if I have the right keywords.

Who would generally design such systems? It's basically just a very safe switchable 3 phase supply, what's so unique about that?

P.S: We are located in Oxfordshire, UK


texts:
My circuit has 5v and 3.3v supplies.  They share a ground.  A component that uses the 3.3v supply says it needs a .01uF bypass capacitor across its power and ground pins.

Questions:

Does it have to literally be on the pins, or can the capacitor be on any wire connected directly to those pins?
Is there any issue with the ground being shared between the two power supplies with respect to the cap, which is only connected to the +3.3v supply?


texts: PIC16F684 Timer 2 interrupts occurring much more quickly than expected

texts:
TL;DR: Timer 2 interrupts (1:4 postscaler, PR2=0x3F) occurring at about 139 kHz instead of expected 19.5 kHz. Changing postscaler to 1:1 has no effect.

I am using a PIC16F684 microcontroller for a project and have been struggling to get it to work. In order to debug, I have stripped my code down to almost nothing: using the interrupt of Timer 2 to toggle a pin.

I am using no prescaler (1:1), a 1:4 postscaler, and a period value of PR2=0x3F. I am also using a 20 MHz crystal. Therefore, I would expected the interrupt frequency to be:

(FOSC/4) / (PR2+1) / postscaler = (20 MHz / 4) ÷ (0x3F + 1) ÷ 4 = 19.5 kHz

Also, the period would be the inverse of that, or 51.2 us.

In my ISR, I set a pin high, add in some delay time (by setting some variable equal to zero), and clear the pin. So, I would expect to see these pulses every 51.2 us.

Instead, my oscilloscope shows pulses every 7.2 us. Taking the inverse, that corresponds to a frequency of about 139 kHz.

Another interesting fact is that if I change T2CON such that the postscaler is 1:1 (i.e., T2CON=0b00000000) instead of 1:4, the result is exactly the same: pulses every 7.2 us. Redoing my above calculation, I would expect a frequency of 78.125 kHz, or a period of 12.8 us.

Just to eliminate this possibility, I have run other programs on this PIC chip, and they have behaved as expected, with correct timing. But none of those other programs used Timer 2. So, the chip itself and the crystal probably aren't the problem.

Any suggestions would be appreciated. I'm afraid it's going to be something embarrassingly obvious, but I've looked over the data sheet several times and can't seem to find any obvious problems.

Here's my code:

#include <xc.h>

#pragma config FOSC = HS        //oscillator selection; external crystal on pins 15 and 16
#pragma config WDTE = OFF       //disable watchdog Timer
#pragma config PWRTE = OFF      //power-up timer disabled
#pragma config MCLRE = OFF      //use MCLR pin (internally tied to Vdd) as a digital input
#pragma config CP = OFF         //code protection disabled
#pragma config CPD = OFF        //data code protection disabled
#pragma config BOREN = OFF      //disable Brown-Out Reset
#pragma config IESO = OFF       //disable Internal External Switchover
#pragma config FCMEN = OFF      //disable Fail-safe Clock Monitor

#define TestPin RA0
char k;

void main (void)
{
    //ground unused pins (as outputs)
    TRISC=0b00000000;
    PORTC=0b00000000;
    TRISA=0b00111000;       //RA3 always reads HI; RA4 and RA5 read HI in HS mode
    PORTA=0b00111000;

    PR2=0x3F;               //Timer 2 period
    T2CON=0b00011000;       //Timer 2 off; 1:1 prescaler, 1:4 postscaler

    PIR1bits.TMR2IF=0;      //clear Timer 2 interrupt flag
    INTCONbits.PEIE=1;      //enable peripheral interrupts (e.g., PWM)
    PIE1bits.T2IE=1;        //enable Timer 2 interrupt
    T2CONbits.TMR2ON=1;     //turn on Timer 2
    INTCONbits.GIE=1;       //turn on all interrupts
    while(1);               //hang up, wait for interrupts
}

void interrupt ISR()
{
    if (PIR1bits.TMR2IF==1)
    {
        PIR1bits.TMR2IF==0;     //clear interrupt flag

        TestPin=1;              //toggle pin
        k=0;
        k=0;
        k=0;
        k=0;
        k=0;
        TestPin=0;
    }
}

Equipment used:
 - PIC16F684 w/PICkit 3
 - MPLAB X IDE v3.00, XC8 compiler
 - Dell Inspiron 6400 laptop, Linux Mint 17 Xfce


texts: bipolar junction current basic operation

texts:
I have seen this thread and I have a question about the picture describing the movement of electrons and holes.
Basic operation of a bipolar junction transistor

Consider this picture

Here is my step by step way of thinking.  B-E is forward biased and B-C is reverse-biased. Because B-E is forward biased, electrons move to the right from the emitter region to the collector region (because p is so narrow).  Holes try to "meet" with the electrons at the left pn junction, \$i_{B1}\$.

Isn't \$i_{B2}\$ exactly doing what \$i_{B1}\$ is doing: combining its holes with the electrons at the pn junction?


texts: X5R capacitor derating and highpass filters

texts:
X5R capacitors derate to about roughly 85% when DC voltage is applied, from what I have been told.

Does this have an effect on high pass filters, even though HF filters off DC (0Hz)?
If I wanted to test voltage derating on capacitors and its effect on an AC signal, how would I do so?

edit:1

edit: 2

edit: 3

I tried with different frequency and tried adding a Voltage offset, and these were the results i got. When I simulated it didn't show any change. When i tried to run a test on a small HF circuit with a 100nF X5R capacitor and a 1k, the amplitude of my output reduced.
At higher frequencies the changes in amplitude were wayy smaller compared the frequencies at and under the cutoff frequency((1446Hz).


texts: Statistically, which embedded system is the most used in Cryptography/Security?

texts:
I am considering to buy an embedded system development platform (electronic board + software) for Cryptography and Computer Security.

Statistically, which embedded system is the most used in Cryptography/Security in Industry and personal learning purposes?

I would use them for hardware implementation of Cryptography.


texts: physically deinstall/access phone/tablet internal memory

texts:
i've never seen the circuits inside of a smartphone or a tablet . please tell me how the memory chip is installed ? Here by "memory" i mean the non-volatile storage aka. rom .

i guess that we can remove the memory chip and connect it to the computer as mtd or mass storage .

even if chip is soldered on the board , maybe it is still possible to attach wires to the solder joints and access data when the power is off ?

i want to know how to do it or why it is impossible .


texts: Can RFID readers submit scanned data to one location?

texts:
Let's assume that I have lots of RFID readers, is there a way, either a specific product or peripheral that allows the reader to send data about the tag it scanned over a distance of about 500m - 650m to one central location?

I have searched everywhere on the Internet and all the results give me information about readers scanning RFID tags at long range, not the reader being able to communicate long range with a central point.

Here is a similar stack overflow question that went unanswered

Please ask for clarification if this doesn't make sense.


texts:
I am into RF design and I have some queries related to impedance matching and trace. We had an RF module and the module was connected to an antenna through a single trace with  no LC components in between for additional matching.
But the trace width was set such that its characteristic impedance was set to 50 ohm. But in real time testing it was seen that the antenna feed impedance when measured from the RF module it was only 19 ohm, and after additional tuning I could achieve only up to 40 ohm.

Even thought the RF trace impedance was set to 50 ohm why did the impedance vary?

So is there any way in which the impedance can be improved by varying the RF trace impedance alone such that we can improve the 19 ohm to a value such that after additional tuning we can make it 50 ohm.

Also if we can set the trace impedance to the characteristic impedance why do we do we provide additional LC tuning and how is the matching done using the LC tuning?


texts: Does Arduino board have CMOS or TTL gates?

texts: Arduino board has a microcontroller called Atmega328. I wonder if it is CMOS or TTL. I dont know how to understand it from the datasheet. Second question is on the Arduino board there are other chips. Are they all TTL or CMOS? How can I know?


texts:
I'm currently tuning the termination resistors in the clock circuit.

The resistor here is 330 ohms, I got a rippled clock signal like this:

I increased both resistors value to 430 ohms and I got:

The ripples decreased but it became less of a square wave and more of a sine wave. Should I increase the resistor value to 530 ohms or do I decrease it to...?


texts: Two potentiometers to control the range limits of a voltage source

texts:
I would like to control the range of an input voltage source using two potentiometers to establish the limits of the signal. First pot determines limit 1 and second pot determines limit 2.

Lets say, when I have the first pot at 0% and the second pot at 100%, the input signal of 5 volts remains 5v at the output, input signal of 2.5v remains 2.5v and input signal of 0v remains 0v. When the first pot is at 0% and the second pot at 50%, the signal of 5v becomes 2.5v and the input signal of 2.5v becomes 1.25v and the input signal of 0v stays at 0v. If the first pot is at 100% and the second at 0%, the input signal is now inverted, the input of 5v becomes 0v, input signal of 0v becomes 5v, input of 4v becomes 1v and 1v becomes 4v.

I’m trying to control the output voltage range of a synthesizer’s control voltage signal that goes from 5v to 0v. I have a signal that goes linearly and continuously from 5v to 0v in any given span of time, and I would like to change the range of it, to go, from say, 0v to 3.5v or 4.1v to 1.5, etc., by changing the position of the pots relatively to their start and end positions. First pot determines the starting position of the signal, and second pot the end of it. So for example, if first pot is at 75% and second pot at 25%, the 5v to 0v signal sweep would go from  3.75v to 1.25v, since 3.75v is 75% of 5v and 25% is 1.25 of 5v.

What approach should I take to solve this problem?

Thanks in advance for any help you are able to provide.


texts: Unknown small pitch wire to board connector

texts:
Anyone know what series of connector this is?

Have tried to look at TE/AMP, Molex, Amphenol etc, but no luck.
Pitch about 1.5mm, but could be 1.25mm, 1.27mm or 0.05" (didn't have a calliper at hand).

On these boards the connector is SMT, no TH pins at all.


texts: Powering an RFID Reader + ESP8266 + Servomotor

texts:
I am looking for the most efficient way to power an ESP8266 along with an Rfid Reader and a servomotor using batteries.
In the past i used 2x18650 batteries in series along with a 3.3V linear regulator(ESP8266 + RFID Reader) and a 6v linear regulator (Servo) but the energy wasted and the bulkiness of two of these batteries made the project i had in mind non-viable.
So is there a way to power all of these components using only one 18650 battery or some other type of battery?


texts: Why does current only choose path of least resistance sometimes

texts:
Say we have the following setup

simulate this circuit – Schematic created using CircuitLab

Input is pulled high and current flows through it as long as the switch is open. As soon as it closes current switches to the path of least resistance and goes through the switch to ground.

Imagine a similar setup with two paths with different resistances

simulate this circuit

In this case current will flow through both paths, and will not simply go through the path of least resistance.


texts:
I have be trying to research how I would go about powering 3 Raspberry Pi devices using only 1 outlet. The raspberry pi require 5v and a max of 2a. I think I know just enough about electronics in general to apply any answers I find here. I am capable of diy what I need to.

Could I purchase a simple 9v ~1a wall wart power supply and split the dc 9v dc power over 3 buck converters that will step down to 5v? Place a diode in before the buck converter for protection?

Any and all advise os greatly appreciated.
Thanks.


texts: Decoupling Capacitor Loop Length vs Loop Area

texts:
When considering inductance reduction, what is considered more important? Reducing the loop length or the loop area? Below are two examples for visualisation, I am ignoring a lot of ways to reduce inductance (e.g. groundplanes, via teadrops):

Assuming both loop lengths are the same, why would loop area impact inductance?


texts: How to make your own EL Wire (electroluminescent wire) inverter

texts:
I would like to make an EL wire (electroluminescent wire) inverter because I can't seem to find a commercial inverter that can drive the right length of wire from the batteries I would like to use: all inverters that run on AA/AAA that I can find can only officially drive up to 9ft or so.

According to the Wikipedia article, EL wire runs on 90-120 volts at about 1000 Hz. There are some relay-based designs for EL Wire inverters out there, and I have seen some transformer-based designs, but it seems like there have to be a better way. There is also the SP4425 inverter driver chip, but it is hard to get in the US.  Any suggestions on how to go about this?  I am looking to drive between 9 and 15 feet of wire, but I was assuming [incorrectly?] that there is a general solution.

EDIT: I would also like to know what it means when we say that inverter A can drive 3 feet of EL wire, and inverter B can drive 30 feet.  Is the difference how much current an inverter can source?


texts: im trying to use a 0-7V control signal to switch an NPN controlling a LED but then using collector of the NPN to switch a PNP. So when control V is low NPN LED is on and PNP LED is off and when control V is High NPN LED is off and PNP LED is on. Is the below circuit a good way of doing this? i have imagined this circuit in my head and cant find anything similar, maybe for good reason?


texts: pic bitbang SPI library with variable frame lenght

texts:
Im trying to send an SPI frame that is 12 bits long using a pic 16F1455.

Im afraid i cant do this using the hardware SPI module , which has a fixed lenght of 8 bits.

I think i can do this with software SPI or bitbang SPI.

Are there libraries that for this with variable lenght ?? (hopefully for cx8)


texts: Does the choice of diode for an AM radio matter, so long as its sufficiently biased? For example, will a 4001 work? Or maybe a high Vz Zener?


texts: Why is my simple relay circuit only half working?

texts:
I am new to electronics and I am following the book "Make: Electronics" by Charles Platt.

I have built a circuit with a 12V DC power supply, a 1K resistor, a relay, two LEDs, and a momentary-on switch.

When I turn on the power supply, one of the LEDs lights up. However, when I press the switch down (and hold it down) that LED goes out but the other one does not light up at all.

I have made sure all connections are good, and I have replaced every single component in the circuit, but it just doesn't seem to be working.

The only thing I can think of is that I was mis-sold a relay by Maplin. I asked for a "DPDT non-latching 12V DC relay" as it says in the book. The one I have has "1A 125V AC" and "2A 24V DC" written on it.

Any suggestions? Cheers.


texts: serial driver for full 3.3v uC to back-of-computer

texts:
I'm looking for an integrated circuit that can connect a lpc17xx (microcontroller) to the serial port on the back of a standard computer. The lpc17xx has a UART controller with 8 pins.
RXD
TXD
CTS
DCD
DSR
DTR
RI
RTS
I'd like to use them all. I figure if NXP decided to implement all those pins, not just RX and TX then they should be useful...anybody know why? Flow control?

The microcontroller runs at 3.3v volts and I wasn't able to find a max232 type part that has 8 channels at 3.3v.

I suppose I could just use RX and TX if there is really no difference, but if nothing else my circuit could look way cooler with more wires :P

thanks.

EDIT:
Are they called drivers or transceivers?


texts: I want to control the gate or base of a transistor by either a MCU gpio or push button. Can link gate to both the push button and MCU so I can choose which to use. What is best way to do this?


texts: DO USA 3V DC 3A have a standard plug size?

texts:
I need a replacement 12 VDC 3A power supply. Not sure of plug size. All the ones I've seen online are 5.5mm x 2.1mm

And the one I have (12 VDC but 1 A) is the right size and looks (ha ha!) like the 3A ones.


texts: Lead-Acid Battery Desulfation Circuit Design:

texts:
I'm seeking ideas for making a pulsing lead-acid desulfation circuit design.  Several circuit designs are available via Google image search, however, I'm hoping to get some help here to design a circuit with the following characteristics that is reliable & inexpensive:

Input:  120V AC @ 60 Hz
Output Pulses:  22-28 kHz, 250mA peak amplitude, pulse rise time < 1 µS

Note:  The output pulsed waveform should be like this:


texts: If I have 12V of power, and wanted to power LEDs with a forward voltage of 2V, could I only power 6 of them?  Would I connect the cathode of one to the anode of the next, creating a kind of serial connection?  Or is there a way to have each LED be it's own loop?  Thank you.


texts: Frequency of a MCU is higher than frequency of a quartz

texts:
How is it possible that in a LPC3141 MCU the MCU has frequency 270MHz while the 12MHz quartz crystal is used in oscilator (inside the clock generation unit)? Makes no sense to me...

Could anyone please explain.


texts: I am modifying a small cooler (mini fridge) that uses a Peltier cell. The cold side of the Peltier cell is in contact with the inside surface of the mini fridge. My question is: will gluing (with thermal paste) a heatsink on the mini fridge internal surface increase the cooling power of the mini fridge? Thanks


texts: Amplifying 40ns pulses that come at unknown times (for single photon detector)

texts:
I have a single photon detector produces a 40ns signal when a photon enters the detector, like the image below:

I would like to take this electrical signal and hook it up to this device which simply time-tags these pulses based on the rising edge of the pulse. The time-tagging device requires inputs that are in the range of 2.4V to 5V, and my detector (as shown in the picture) produces pulses with a height of 0.5V.
Therefore, I would like to amplify the output of my detector (by about 5-10x) so that it is compatible with my time-tagging device. As you can see in the picture, the ramp-up of my signal is quite sharp, and I am particularly interested in getting accurate time-tags of my pulses location.
Looking at the rise-time of my pulse, it seems to be about 5ns. So am I correct in thinking I need an amplifier that can amplify signals at a speed of 1/(5ns) = .2*10^9 Hz = 200 MHz?
Any recommendations for what I should buy or build so that I can amplify the signal accurately?
EDIT:
Going into a bit more of the details of my attempt:
Right now I've tried using a ZPUL-30P to do the job (it's something that we have around the lab). And this doesn't seem to be ideal:

As you can see the voltage produces a long tail of 400ns which I fear will interfere other pulses that are arriving close in time with this pulse. Additionally, looking at the pulse it seems as though some of the individual shots aren't triggered properly (maybe around 1/500).  Additionally, I have 4 separate output channels that come out of the detector, so I will need to either buy 4 amplifiers or one device that can amplify all 4 - and in a perfect world they will not produce different delays.