texts: RTC DS1307 3.3V I2C and Oscilloscope impedance

texts:
I'm working on a library for STM32 to learn I2C protocol (Software I2C, not hardware).
I connect my DS1307 (Sparkfun BOB-12708) : (Here is the module schematic) :

I remove welding on the SJ2 jumper to dont use 4.7K embedded module pullup resistors.
I supply 5v power to the module
My STM32 board already has 4.7K pullup resistors to 3.3V
I connect module SDA and SCL to my STM32 3.3V GPIO with 15 cm cables.
I connect my two way oscilloscope to SDA and SCL.

I can produce a nice SCL (100KHz) and SDA signal except for the I2C "START CONDITION", SDA take time to fall down, the falling edge is not straightforward.
When I increase timing in my code I can get the DS1307 address ACK. So I suspected the resistors values not be appropriate.
I used two different GPIO without pullup resistors and I use my own 1K pullup resistors to 3.3V and this work very well. Signal is nice I can read and write successfully to DS1307 and get date/time.
So I disconnect my oscilloscope, but after that, I could not read or write to the device :(. My oscilloscope impedance is 1M. If I leave 1K pullup resistor to 3.3V AND put a 1M resistor to ground this work.
I also try with bi-directional logic level converter (BOB-12009) and this work well but I want to use DS1307 directly without converter.

Can someone help me to understand why I need this 1M resistor ?
What 3.3V pullup resistors value can I use to only use pullup ?

Edit:

STM32 board is an Olimex STM32F103STK
Ground is connected between STM32, DS1307 (and oscilloscope when i plug it)

Edit 2:
My cable got bad ground wire connector, i replace the connector and now all work fine with or without oscilloscope and with 4.7K or 1K pullup resistors to 3.3V. Empirically 2.2K seem to be a good trade-off between current and clean signal edges.


texts:
Someone can tell me the name of theese type of connectors? I need a standard name.
3.5mm diameter.


texts: error when trying to program the chip on stm32 f44re nucleo board

texts:
17:24:45 **** Programming project STM32_HelloWorld on chip ****

"C:\\Ac6\\SystemWorkbench\\plugins\\fr.ac6.mcu.externaltools.openocd.win32_1.23.0.201904120827\\tools\\openocd\\bin\\openocd.exe" -f stm32.flash.6462756934245305845.cfg -s "C:\\Users\\nvenk\\Workspace\\RTOS_workspace\\STM32_HelloWorld" -s "C:\\Ac6\\SystemWorkbench\\plugins\\fr.ac6.mcu.debug_2.5.0.201904120827\\resources\\openocd\\st_scripts" -c "program Debug/STM32_HelloWorld.elf verify reset " -c shutdown

Open On-Chip Debugger 0.10.0+dev-00021-g524e8c8 (2019-04-12-08:48)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 8000 kHz

adapter_nsrst_delay: 100

Info : clock speed 8000 kHz

Error: libusb_open() failed with LIBUSB_ERROR_ACCESS

Error: open failed (no matching adapter found)

in procedure 'program'

in procedure 'init' called at file "embedded:startup.tcl", line 495

in procedure 'ocd_bouncer'

** OpenOCD init failed **

shutdown command invoked

17:24:46 Build Finished (took 201ms)

Also I do have drivers installed for stm32 board. copy pasted screen shot of my device manager below. Please help me.


texts: Read data from strain-gauge Labjack, Arduino

texts: I am working on a project where we have to record breathing data. For that we ordered a LabJack U3-LV along a with an amplifier (datasheet) and a belt which is some kind of strain gauge I think. We have no background in electronics so having a hard time extracting data from the setup.  There are certain dip switches on the amplifier. We just connected the belt / strain gauge to the equipment as shown in the figure but we just get some random spikes (we are using Labjacks' LJStream UD) and not continuous data as shown in this video.Can somebody please help as to how we can use the setup?


texts: Could you drain a battery with only one terminal connection?

texts:
There's two statements I have learned from school that seem to contradict each other with obvious examples.
These are
1."A current must always return to its source"
2."Current will flow if there is a difference in electric potential (a voltage difference)"
The first statement statement doesn't make sense in regard to lightning or ground faults. This leads me to my question of the second statement. If I had a battery suspended, and took a conductor from the positive terminal (conventional current) and dug it into the ground, would current flow? I would think so as a potential difference has been created with a clear conductive path.


texts: Does the size of switch-mode adapters affect their efficiency?

texts:
I know that a rule of thumb to judge the efficiency of a traditional iron core transformer is to look at its size: the larger it is, the higher the number of windings, the larger the core, the ticker the wires... All factors that in the end lead to lower energy losses and higher efficiency. (Or maybe I should say the other way around: a requirement for a transformer to be efficient is to be large.)

But what about modern switch-mode adapters? Empirically, I can feel that small adapters heat up very easily, even with low loads, while larger adapters don't heat up much (if at all) even with high loads. This could be because larger adapters disperse heat more easily, but it could also be because they're truly wasting less energy.

Hence the question: assuming the same load, same input wattage and same output voltage, would a larger switch-mode adapter be more efficient than a smaller equivalent?


texts: What is the significance of a coupling capacitor in a common-emitter amplifier? What would happen if it is removed? What will be  the effect on AC amplifier gain on removing it?


texts: Using somesort of a switch between 230V AC and 24V DC

texts:
This is a vary basic question which will probably be answered in a blink of an eye by some of you.

I have a few hardware devices which have the same wiring schemes. The only difference is some of these devices use 230V AC and the others use 24DC.

I'd like to unify the test machine wiring and implement some sort of a switch, which I could use to switch between the mentioned two power supplies.

I was wondering how I could achieve this most elegantly? I am a comp. sci. by profession, so I'm in the dark here.

Thanks in advance.


texts: AVR ATmega breakpoints and BREAK instruction

texts:
I use AVR Studio 4, JTAGIce MkII-CN, gcc for debugging. It works generally OK but sometimes happens after some unspecific interruption (reset, power cycle, etc.) that AVR Studio breakpoint remains transformed into BREAK instruction and it causes the program always breaks at this instruction and cannot go over any way (visible in Disassembler window).

I cannot investigate where the instruction is written because it survives even reboot of MCU, AVR Studio and JTAGICE debugger, the BREAK still persist there. Only reflashing MCU helps and I can go on.

Does on-chip-debugging-engine modifies flash and remembers original instruction? I'm not sure if it works beyond debugging because BREAK is probably ignored and missing original instruction is hardly detectable.

Note: I'm not sure just now what was result of reading flash and verifying against original.


texts: Connecting Optical Fignerprint Scanner with Raspberry Pi?

texts:
I am new to electronics.
I bought Rasberry Pi and a Fingerprint scanner for some project. Now I can't seem to find any details/Specification about the Fingerprint Scanner, and there is nothing mentioned in it which can help me find it, I have been told that I can find it quickly, but I am unable to find any help.

Images of Sensor

Back

Side Bar Code

Help!


texts: How to build an interesting XOR circuit with my child's electronics kit

texts:
When I got home today, my child was proudly telling me how they had managed to make AND, OR, and NOT logic from his snap circuits electronic kit and was asking me how they could make exclusive or.

Has anyone any suggestions for a simple (and hpefully educational/entertaining) circuit that would do this?

The kit only has simple push switches (i.e. no SPDT switches) and the usual variety of basic electronic components.  It does have PNP and NPN transistors but I would prefer something simpler (they haven't used transistors so far).  Diodes would be okay as they are easier to understand and more familiar.

One idea I had was something like this:

but it is not ideal as it uses two battery packs and ends up driving the lamp through a potential divider that has to be matched to the current battery voltages.  Any better suggestions?

EDIT:

To clarify, they want to make a circuit which has two push buttons, and the lamp will light if either (but not both) switch is pressed.

In particular, there is no requirement that the circuit has digital inputs and a digital output (the way we would normally think about digital logic).


texts: What is this symbol? A circle with an arrow joining two connections and another arrow pointing to it

texts:
The symbol is a circle with an arrow joining the two connections and another arrow in right angle pointing to it.

What is this symbol? I see this symbol in scheme of sensor ZK24-2 from Altpro.


texts: Wearing "conductive shoes" instead of heel grounders?

texts:
I've been looking into alternatives to heel grounders since they're kind of cumbersome to put on and take off often (not to mention being uncomfortable) and I'm considering buying a pair of "conductive shoes."

The most widely sold brand seems to be Crocs ESD Lites. I've found them on a number of legit websites, such as these:

http://www.all-spec.com/products/ESD-Safe_Garments%7CGarment_Accessories_and_Cloth%7CGAR-06/C1001-010.html

http://www.stanleysupplyservices.com/crocs-esd-lites-clean-room-shoes/g/23595

Does anyone have any experience with shoes such as these? Can they really replace heel grounders?

Also, I can't seem to find any information about the usage of the shoes and I'm wondering whether wearing socks with shoes such as these would prevent them from working?

Sorry if a footwear question is inappropriate, but I couldn't think of any other place where people would actually understand what I was talking about :-)


texts:
I'm finishing a small PCB that has too many traces in order to realize a good ground plane. The circuit doesn't need particular layout precautions, so this is not a problem.

Since the ground plane option is excluded, is it better to leave an unconnected copper pour or remove all the unused copper?

I will have the PCB manufactured, so I have no etching problems.


texts: Protection of BeagleBone Black from eMMC corruption on power loss

texts:
I'm considering an application where a BeagleBone Black, preferably running one of the recommended Debian images loaded in eMMC, is powered by a 5V source that can be removed at any moment. I want to prevent catastrophic data loss in this event, including if a write to file is underway. At least, I want the BBB to still be able to reboot from eMMC on return of power, repair the (probably ext4) file system, and run my application. If I can have the insurance that any file that was properly flushed is consistent, that's ideal.

The problem I fear is that, when power is lost while a write in underway in the eMMC, there could be data loss in an unpredictable sector, because a recent sector write handled by the eMMC triggered a Flash page erase, and the other sectors in that page are lost, and (because of wear leveling and sector reallocation internal to the eMMC) they belong to files or volumes that have not been written recently, including perhaps in read-only file systems or files. That problem is mentioned here:

  a power cycle at the wrong time can destroy data anywhere on the (SD or eMMC) card, no matter where you THINK you're writing

and that could justify the warning in the BBB manual and here that

  [powering down using the power button] will also help prevent contamination of the SD card or the eMMC.

as well at the terse warning made by what seems to be the primary eMMC source for the BBB

  Avoid power-down during WRITE and ERASE operations.

To what degree can such data loss occur? What is the duration of the vulnerability window, if any?

Are there standard solutions? Recommendations?

Is there any built-in software mechanism against this, and how does it work? In particular, is the TPS65217C PMIC programmed to generate an NMI on loss of VDD_5V, aka AC, as the hardware allows, and is it handled in a way that stops ongoing eMMC write activity? If not, how can I at least add that?

Is stopping any eMMC-related activity good enough for the eMMC to enter a safe state by itself after some delay? Which delay?

What about a capacitor or Supercap (like Murata DMT3N4R2U224M3DTA0: 0.22F, 4.2V, 0.3Ω) on the battery connector to provide some power reserve?

Are there modes/settings in the eMMC to configure a write performance/safety compromise? What are the defaults, are they adjustable?

Important update: I have located authoritative information in the March 2010 eMMC specification about reliability when power is lost during write:

  In general, an interruption to a write process should not cause corruption in existing data at any other address. However, the risk of power being removed during a write operation is different in different applications. Also, for some technologies used to implement eMMC, there is a tradeoff between protecting existing data (e.g., data written by the previous completed write operations), during a power failure, and write performance.

Lots of valuable information follows in that source, including description of how the eMMC declares that it promises (or not) to protect previously written data from haphazard erasure in case of power loss, and what seems to be truly write-protected areas.

Addition: a comment mentions that mobile phones use read-only file systems in eMMC, and are not known to experience corruption of that. However, mobile phones have a large battery, and that practically ensures they do not experience abrupt power loss in normal operation, thus are not concerned by the eMMC corruption mechanism that I fear.


texts: What impedances do graphics cards expect on H-Sync and V-Sync for VGA monitors?

texts:
I have a graphics card for a laptop whose driver kills itself if it runs for longer than two minutes with no external monitor attached. To solve that, I decided to make a sort of dummy plug that would be detected as a monitor by PC.

I have managed to find out what impedances video card  expects for most of the pins, but for H-Sync and V-Sync, Google brought up numerous conflicting answers, mostly from people who are guessing.


texts: Setting up STM32 timer for UART IDLE detection

texts:
I am trying to implement IDLE detection described in AN3109. The idea is simple:

Run timer in slave reset mode with maximum possible period;
Configure CH2 for input capture on rising edge, however do not use it for capture. Instead mux the edge detection signal TI2FP2 as slave reset trigger. Connect this input to UART Rx wire;
Configure CH1 for output compare with period equal to desired IDLE time.

Without intervention timer will simply count up, rolling over infrequently. However every rising edge on UART Rx will reset count back to 0. When Rx pulses stop coming counter is allowed to grow and eventually reach CCR value, at which point IDLE interrupt is generated.

For testing purposes I configured timer for 5s period and 1s CCR pulse. The expected behavior is to see update event every 5s and output compare 1s after that. What I see, however, is both events coming simultaneously every 5s.

Here is timer initialization generated by Cube:

  TIM_SlaveConfigTypeDef sSlaveConfig = {0};
  TIM_MasterConfigTypeDef sMasterConfig = {0};
  TIM_OC_InitTypeDef sConfigOC = {0};
  TIM_IC_InitTypeDef sConfigIC = {0};
  TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0};

  htim1.Instance = TIM1;
  htim1.Init.Prescaler = 5493;
  htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim1.Init.Period = 65535;
  htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  htim1.Init.RepetitionCounter = 0;
  htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
  if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
  {
    Error_Handler();
  }
  if (HAL_TIM_OC_Init(&htim1) != HAL_OK)
  {
    Error_Handler();
  }
  if (HAL_TIM_IC_Init(&htim1) != HAL_OK)
  {
    Error_Handler();
  }
  sSlaveConfig.SlaveMode = TIM_SLAVEMODE_RESET;
  sSlaveConfig.InputTrigger = TIM_TS_TI2FP2;
  sSlaveConfig.TriggerPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
  sSlaveConfig.TriggerFilter = 0;
  if (HAL_TIM_SlaveConfigSynchro(&htim1, &sSlaveConfig) != HAL_OK)
  {
    Error_Handler();
  }
  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
  {
    Error_Handler();
  }
  sConfigOC.OCMode = TIM_OCMODE_TIMING;
  sConfigOC.Pulse = 13107;
  sConfigOC.OCPolarity = TIM_OCPOLARITY_LOW;
  sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
  sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
  sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET;
  sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET;
  if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
  {
    Error_Handler();
  }
  sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
  sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI;
  sConfigIC.ICPrescaler = TIM_ICPSC_DIV1;
  sConfigIC.ICFilter = 0;
  if (HAL_TIM_IC_ConfigChannel(&htim1, &sConfigIC, TIM_CHANNEL_2) != HAL_OK)
  {
    Error_Handler();
  }
  sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
  sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE;
  sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF;
  sBreakDeadTimeConfig.DeadTime = 0;
  sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE;
  sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH;
  sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE;
  if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK)
  {
    Error_Handler();
  }

This is how I start timers:

HAL_TIM_OC_Start_IT(&htim1, TIM_CHANNEL_1);
HAL_TIM_Base_Start_IT(&htim1);

And here are event handlers:

void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim)
{
    printf("OC %lu\r\n", HAL_GetTick());
}

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
    printf("UEV %lu\r\n", HAL_GetTick());
}

Any suggestions on what I am doing wrong? I suspect it could be some tiny detail in the configuration, but HAL documentation is not very helpful in this regard.


texts:
Where I live, in central Italy, the signal of DCF77 (the German longwave time signal and standard-frequency radio station, which operates at a frequency of 77.5 kHz) is so weak when it arrives, that it cannot enter the house. So my three DCF77 clocks and the weather station can almost never synchronize automatically. This is obviously very depressing.
So I searched on the Internet for a project that could simulate the DCF77 signal, and I found it on Github.
In the original project, a Raspberry Pi Zero is used for the signal generation and its amplitude modulation via a square wave carrier.
Unfortunately a simple copper coil is used as an antenna, so the range of the signal generated is very limited, so much so that it is necessary literally to "immerse" the clock to be synchronized into the coil / antenna.
Since my goal was to extend the range of the signal up to about ten meters, I decided to modify the project.
In particular, I thought of replacing the loop with a ferrite rod antenna and powering it through a simple discrete class AB amplifier.
The following figure shows the schematic of my simple amplifier, which works perfectly without load.

I thought of a class AB amplifier because its gain is unitary and I do not need to amplify the modulated signal voltage, which is worth about 2.2 volts peak, but only to give power, i.e. current, to the load.
I bought an antenna that is tuned at the frequency of 77.5 kHz, and consists (data provided by the manufacturer) of a copper winding of about 1.3 mH of inductance with a 3.3 nF capacitor in parallel. The minimum Q merit factor is greater than 110.
The resistance of the winding (which I measured) is about 2.5 ohms.
I'm not an expert on antennas, especially of this type, and unfortunately there is little information on the internet about their functioning, especially if used in transmission.
I found an article from which I took this figure.

In the article it is explained that at the resonance frequency, this antenna behaves as a purely resistive load, consisting of the value of the series of three resistances, that of the winding, that of radiation and that of loss of the ferrite, multiplied by the square of the Q factor quality.
The article also reports the following formula that links the Q quality factor with the winding inductance, the resonance frequency and the series of the three resistors.

If I invert it to calculate the value of the series of resistors, I get about 5.75 ohms, which multiplied by the square of 110, gives a value at the resonance frequency slightly less than 70 kilo ohms, which I think is very high as a load of a power amplifier like that the AB class I intended to use.
So I would like to know from you:

if my calculations are correct;
if it is correct to use a class AB amplifier to drive such a high load, to give it some power;
if somehow the load, that is the antenna, needs to be adapted.

Thanks for your attention and patience.


texts: How is a USB-C OTG with only 2.0 support adapter wired? Here is an example of such an adapter. The VBUS, GND, D+ and D- pass to the USB-A receptacle but what happens to the CC pin? What ID resistors (if any) are used on the data lines?


texts: How to print several Project parameters combined on PCB in Altium Designer?

texts:
Acording to questions

Can I combine Comment field from other Parameters in Altium Designer? and
How to print value of variable on PCB into String feature in Altium Designer?

I want to print values of Project Parameter Parameter1 and Parameter2 on String feature on PCB, how to do this?

I firstly tried '.Parameter1+.Parameter2' and didn't work.


texts: Creating an mini electronic ignititer that can ignite lighter fluid possible?

texts:
Hello i'm new to electronics but I have a project where I want to create a mini electronic igniting device that will be able to light wicks that are soaked in naphtha (lighter fluid) safely, reliably and almost instantly (like a flint would).

I need the device to be activated with a slide switch, and be small enough to fit in a 4" wide x 2.5" high x 1/8"~1/4" thick.

I would prefer the battery to last as long as possible, in other words not just several uses. Would button cell batteries be sufficient for this space/power-wise?

I mostly want to know if creating something like this is possible/feasible myself, or if the space is not sufficient enough to light something like lighter fluid electronically.

Essentially I want to create my own version of something like this: https://www.youtube.com/watch?v=2UlXeJKQOGE
Its a fire wallet that also seems to be able to light business cards on fire as you take them out leaving them unharmed, it seems lighter fluid at some point is used on the business cards as well, and possibly a secondary device for lighting them. Unfortunately they're not for sale anywhere anymore though.

I've wanted to create my own wallet for a while, and own a flint fire wallet, but wanted to see if i could incorporate a fire feature in my wallet electronically.


texts: What is variation in potential in diode w.r.t. to distance from centre of pn junction?

texts: Why is potential 0 at centre of pn junction? What is potential at nornal p side or normal n side


texts: What's the maximum size of a USB descriptor?

texts: I would imagine it has some theoretical limit right? I'm just curious so I can gauge how many endpoints a device can have based on the space used for all the other configurations. Or is it limited only by the hardware (i.e. the size of a microcontroller's flash memory)?


texts: I need to detect a Logic high / Low (at my MCU). This input will come from an external circuit (having common ground with my circuit). My MCU support max 2.8V at the GPIOs. I have designed the below schematic. Am I on the right direction? The Input can go upto 30V.


texts: putting 15 vct transformer in series to get 30 vct output

texts:
i have this 15 vct transformer.

as you can see, it's 15v 0v 15v center tapped transformer.

I want to make these two transformer behave as a 30 vct transformer.
then, in this picture, is A 30V and B 0V(center tap) and C 30V, if you see this as a single transformer? and the current should be same as one of them.

Also the input says' 0v, 110v, 220v'. i have a standard 220v socket, then should i put one cable(two ends) on the 0v and the other on the 220v input?

those two transformers are completely identical.


texts:
I assembled a DIY clock with surface-mounted LEDs (Geekcreit DIY 6 Digit).
There are 56 groups of LEDs (6 * 7segments + 10 up & down + 2 * colons), each group is composed by 2 LEDs that are in parallel.
The MCU is a IAP15W413AS with 28 pins.
I don't understand how it is possible to drive independently the 56 LED groups with only this MCU.
I tried to probe an LED with an oscilloscope and here is the result:

Positive is in yellow, negative in blue.
It was on an LED from a segment displaying '0'.
To the newbie that I am, it doesn't look like a regular LED...
What is it?


texts: What topologies are used for ultra-low-power CMOS DACs?

texts:
What schematics, topologies or algorithms are suitable for ultra-low-power DAC design? You can assume the following design requirements (they are flexible):

Full custom CMOS design (this is not a commercial-off-the-shelf shopping question)
10% duty rate
Up to 50 MS/s
8-bit input
Reasonably robust to mismatch, process variation and power supply noise
Noise and area requirements are flexible
Should be appropriate for sub-threshold operation due to power supply restrictions
Power optimization is the highest priority

I am currently considering a timer-based PWM DAC, but I am not certain about the suitability for ULP.

Note that its not possible to provide a full design proposal in the answer, this is a request for relevant techniques. That's why the requirements are just rough estimates to be taken with a grain of salt.


texts: register bit access using structure union combinations

texts:
I have a structure something like this in device header file:

 typedef struct {
  union {
__IOM uint32_t DR;
    struct {
      __IOM uint32_t D0      : 1;
      __IOM uint32_t D1      : 1;
      __IOM uint32_t D2      : 1;
      __IOM uint32_t D3      : 1;
    } DR_b;
  } ;
  } GPIO_PRT4_Type;

#define GPIO_PRT4                   ((GPIO_PRT4_Type*)         GPIO_PRT4_BASE)

To change bit D0 of DR register, I am using below line in application code

GPIO_PRT4->DR_b.D0 = 1;

On using the above line, MCU goes into hard fault handler.

Assembler code for above line is:

0x01a0  ldr r3, [pc, #16]   ; (0x1b4 <main+52>)
0x01a2  ldrb    r2, [r3, #0]
0x01a4  movs    r1, #1
0x01a6  orrs    r2, r1
0x01a8  strb    r2, [r3, #0]

0x01aa  b.n 0x196 <main+22>

Any idea, what is wrong here??

MCU: ARM Cortex CM0plus


texts: How to increase output power of this simple CD4047 based inverter

texts:
I am making a simple inverter using the circuit below. I am using a 3amp 12-0-12 Transformer. I am aware of the cons of the circuit. So, I never expected regulated Pure Sine Wave output from it. The circuit works fine. But I am able to lit up a 5 Watt CFL Lamp only. I was trying to lit 10 or 15 Watt CFLs, but they didn't work.

How can I increase the output power of the inverter? Should I reduce R3 and R4? I guess, 3 amp Trafo is good enough for my expectation.

And I never saw the LED to lit up. If someone could explain the purpose of the LED and what changes would lit it up, it would be great.


texts: 2-way DC motor control for greenhouse IoT application

texts:
Edit: After doing more research, it seems simply reversing the DC polarity would do the trick as explained here: https://www.precisionmicrodrives.com/content/are-dc-motors-reversible
This can be accomplished with a SPDT relay apparently, or with 2 regular relays. Thus, I see the following options:

Tasmota flashed Sonoff R3 Pro relay (https://www.itead.cc/smart-home/sonoff-4ch-r3-pro-r3.html)
Any regular 2 channel relay (http://yourduino.com/sunshop//index.php?l=product_detail&p=218)
Use an off the shelf SPDT relay (https://www.seeedstudio.com/Grove-2-Channel-SPDT-Relay.html)

I'd say option 1 is the best way to go, since I won't have to bother with supplying power to the microcontroller and I can just mount everything on a DIN rail in my central control box. Drawback is obviously an older platform with inherent security risks. Believe I can mitigate those with restricting role of Sonoff device on AWS IoT core though.
Am I on the right track here?
=================
I'm trying to build a low-cost PE-film greenhouse with as much automation as possible to reduce labor cost. Ventilation control by manually rolling up the film on the side of the greenhouse with a hand crank is one of the largest drivers of cost. Automating this seems like a low-hanging fruit, since there are tons of relatively cheap purpose-made greenhouse control motors out there on Alibaba.
Before buying though, I'd like to know what my options are when it comes to remote control. The ones I've seen are either 2 wire or 3 wire on DC24v and all of them come with 2 knobs to control maximum rollup/rolldown (under cover marked in red on schematic). There seems to be a way to control them, as some of the them come with manual control systems as in the pictures below.
Greenhouse overall will be controlled through AWS IoT cloud with ESP32-S2 units connected to sensors and control systems across the greenhouse, so an approach using an ESP32 driving the motor control is my preference, but open to any other ways too.
Any help or pointers would be greatly appreciated. Thank you!


texts: 4th order (active) filter, I want constant phase shift band

texts:
I'm needing to improve an existing fourth order active filter design.

The filter amplifies 10-100 kHz signals as desired, however the phase shift is causing problems. 10 kHz signals are phase shifted around 200 degrees, but 100 kHz signals are phase shifted around 600 degrees.

The varying phase shift for desired signals is rather unhelpful. Ideally I would want the same phase shift for the entire frequency range. The magnitude of phase shift itself is of no concern, so increasing the phase shift at 10 kHz so that it is constant up to 100 kHz wouldn't be a problem.

Is there a type of (allpass) filter that introduces a decreasing phase shift? - for instance 360 degrees for 10 kHz and 180 degrees for 100 kHz?
Where should I start, how should I work, when trying to achieve constant phase shift in filter design?


texts: Copy protect program code in PIC microcontroller

texts:
I'm trying to copy protect my code which i program in my PIC16F886 microcontroller. I've set the below CONFIG options in MPLABX and compiled it, got the output hex code. But no matter i set it, i'm able to read the program from the PIC microcontroller to a hex file.

I compared my original hex file, and the one i downloaded from the PIC microcontroller. Both have different text in it, but when i load the downloaded one to another blank device, it works exactly the same way my original compiled code works.

Am i doing something wrong? Why am i able to read the program even after setting the code protection bit. Kindly advise. Thanks.

#pragma config FOSC = HS        // Oscillator Selection bits (HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN)
#pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = ON       // RE3/MCLR pin function select bit (RE3/MCLR pin function is MCLR)
#pragma config CP = ON          // Code Protection bit (Program memory code protection is enabled)
#pragma config CPD = ON         // Data Code Protection bit (Data memory code protection is enabled)
#pragma config BOREN = ON       // Brown Out Reset Selection bits (BOR enabled)
#pragma config IESO = ON        // Internal External Switchover bit (Internal/External Switchover mode is enabled)
#pragma config FCMEN = ON       // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is enabled)
#pragma config LVP = OFF        // Low Voltage Programming Enable bit (RB3 pin has digital I/O, HV on MCLR must be used for programming)


texts: Design considerations for powering microcontrollers with a 100 m cable

texts:
I'm currently doing some research for a project where I'd have a number of microcontrollers (say 5 ATtinys or if I manage to bring power consumption down, maybe even ATmegas) which I want to power from a single category 5e cable. I don't think that I'd need more than 100 meters of cable length (and I think that as much as 50 m may be enough), but I'd like to project for the worst case. I don't think that maximum power consumption is going to be more than 100 mA for the all devices on the cable. The idea now is that the microcontroller will check optotransistor for light level and based on that turn on or off a low-power LED.

I picked the category 5e cable because it's relatively small (and the diameter of the cable is a factor here, since I'm trying to fit in with already existing infrastructure), has 4 pairs of wires (which gives me some flexibility) and is commonly available.

So here are some of my thoughts on this topic:

According to wikipedia, I calculated that I'd have resistance of  \$8.422 \mbox{ } \Omega \$ in one way on the cable. So total resistance of one pair would be \$16.844 \mbox{ } \Omega \$. This would give me a voltage drop of 1.6 V at the end of the cable, assuming 100 mA load. So I plan to use 5.5 input voltage which gives me 3.9 V at the end and is within operational range of the microcontroller family I'm planning to use. Now, since I'm using cat5e cable, I could use two pairs of wires for lower resistance and get voltage drop as low as 0.84 V. This would leave me with two free pairs.

I'm also considering adding "tank" capacitors in the \$1000 \mbox{ } \mu F\$ range near each microcontroller to provide some localized power sources in addition to standard decoupling capacitors I'd use. The size of the capacitors isn't such a problem, so I could make it even larger to somewhat mitigate the voltage drop caused by the cable.

With that, I think I covered the basics of the power problem. The part which is a bit fuzzy to me is how to deal with switching noise of the microcontrollers. I believe that the larger capacitors acting as tanks and a bit more decoupling capacitors could help here. There's also the Atmel's recommendation to put a small coil in series with the Vcc pin before first decoupling capacitor which should force the microcontroller to use more power from the capacitors and suppress a little bit the noise on the line.  What I'm not so sure here is should I look into more complicated filter designs for the power line. The environment I'll be using this is basically a residential house, so I don't expect too much outside interference.

A problem with interference could be the two other pairs. Some of the adjacent microcontrollers may need to communicate with each-other, so I plan to reserve the two pairs for that, but I don't expect the data rates to be too high since I'd probably be using 2400 b/s.

So any comments, improvement ideas or suggestions?


texts: How to increase (optical) power of arduino circuit with LED? Increasing current with fixed voltage

texts:
We have an LED that when connected to an Arduino board provides an optical power of 22.58 mW. The circuit is just the LED in the digital Pin with the Arduino powered by the computer using a USB cable. Our optical power needs to be a minimum of 226 mW, so it should be one order of magnitude greater. Since P=IV, and the Arduino has a fixed voltage of 5V, I think it would make sense to try and maximize the current through the LED. I've read that the maximum output current from one pin is 20 mA while the maximum current the Arduino can provide in total is 50 mA. Would connecting three outputs in parallel to lead into the LED in series provide 50 mA instead of 20?

I've also looked into using a transistor to drive a higher current.
With the example in this video  what would be the voltage drop and current across the resistor? Wouldn't the current be ~10 mA(5/470) to account for the 470 Ohm resistor and 5V EMF source? How would adding the transistor increase the current driven through the LED? I may have a misunderstanding of how the digitalPin relates to the circuit, but it seems to be an output of the transistor in parallel with the output to ground. Or based on what is shown at 0:52 does the digitalPin serve as the input for the current while the part of the circuit connected to ground and the part with the LED are in parallel? As I understand it, the 10k resistor is there to minimize the amount of current that travels through that part of the circuit, so my first assumption should be correct.

I found another source online with an example circuit using an LED and a transistor https://circuits.io/circuits/742344-arduino-npn-transistor-led-driver#schematic, but this seems to invert the principles of the video above. If the digitalPin is supplying PWM, then the current should be about 1.4 mA (V=IR, V=5, R= 3600) which makes it hard for me to understand why the LED would drop 1.6V.

Sorry for the amount of questions and confusion, but if anyone could help me design a circuit to maximize optical power, that's the main goal here. I would like a better understanding of the examples I provided to figure out what I modifications I could make to those circuits and my own to get the target optical power.


texts: How to measure current in very low duty cycle circuit with DMM?

texts:
My circuit has 4Hz 50% duty cycle. How do I measure the average current using a DMM?

I have a Fluke 87 DMM. It has an average setting but for 100 ms which less than one complete duty cycle.

My circuit takes abouts 13 uA in sleep and 20uA in active.


texts: Dual Supply from single 24v dc source and 12v regulator

texts: I was thinking about different ways a dual supply could be created, and I was wondering if something along the lines of what I made in this schematic would work. I don't have any kind of formal education in this stuff so excuse me if there is some blatent thing I'm missing.


texts:
I heard it is impossible to create scale which will have constant load on it. Is there any workaround, or what type of sensor should I buy?

I need to build a scale which will handle up to 100kg. Constant load on it will be around 60kg but will vary for ~1kg per day. I want to measure this variations every day without manual calibration of putting load off.


texts: I'm somewhat curious as to how to use a nylon shoulder washer with a bolt. There is an example of this here (https://electronics.stackexchange.com/a/45579/95654), but I can't figure out how it would stay attached to the board. The diagram does not imply that the washer is threaded, so the hole is large enough to fit the washer (without any teeth to hold it) and ensure that the bolt does not close any circuits, but then how does it not fall out if it was inverted/sideways? Even if there was a nut at the bottom of the bolt, I still can't see how it would be stable.


texts: How do I determine whether a sensor is a thermocouple or a thermistor?

texts:
Is there any nondestructive way to determine wether a soldering iron uses a thermocouple or a thermistor? The documentation on the iron claims it is a PTC ceramic heater. Some manufacturers mention thermistor while others mention thermocouple which adds to the confusion. Given that a thermistor has a smaller temperature range than a thermocouple, it makes me wonder if they use the term thermistor loosely.

I tried heating the tip of the iron and measured the resistance across the sensor wires and it climbed steadily. I also did the same test on a known thermocouple and had similar results, although the resistance climbed more rapidly.

I was under the impression that a thermistor (PTC) increased in resistance with temperature, whereas a thermocouple's resistance didn't increase very much. Moreover, if a thermocouple generates a voltage proportional to its temperature, then wouldn't the resistance stay the same instead of increasing?


texts: What integrated circuit has the capability to control the connection between two I/O pins for signal transmission

texts:
I am working on an educational project to play around with computer networking and communication.

I won't be using any official networking protocols and I'm fine with that.

I would like to build a sort of network switch which has the capability to route different nodes to one another.

I'd like to find a single chip solution that has 100's of I/O pins, and has the ability to connect any of these I/O pins to any other using some sort of protocol.

So, if I wanted node 4 to talk to node 20, and node 4 uses pins 20-25, and node 20 uses pins 100-105, pins 20-25 would get connected to 100-105.

At present, it would be possible to use an Atmel microcontroller with 100's of I/O's and turn on and off a pair of transistors for each data line to allow the communication to occur.

However, I would rather save myself the hassle of a thousand transistors and would rather drop hundreds on a single chip solution for the task.

So, have any of you seen the chip I'm describing? If so, what sort of chips should I be looking for, and should I pay special attention to features relevant to the signal transmission aspect of the circuit (parasitic capacitance, inductance, etc.)?

EDIT:
Although crosspoint switches would be nice, I can't find a lot of them with the hundreds of channels I'm looking for. An FPGA would be a nice solution, but I don't know if these devices would allow me to do the routing I wish to do.


texts:
My IO/peripheral requirements are extremely minimal (I2C, a timer output, 2-3 GPIO). Problem is, I'm not sure how much "compute" I need, especially since there's not a lot of straightforward metrics for "compute power" (comparing clock speed is only relevant within the same architecture from my understanding). My do-data will be doing a very light amount of DSP (basically, a simple filter and time derivative @ 120-ish hz).
I'm tempted to go with an AVR, since it's familiar territory, but I feel like the ATMega328p is overkill; but of ATMega, ATTiny, or similar PIC, STM8, MSP430, etc, I'm not sure how to narrow my search. Almost everything meets the IO requirements, but besides that I'm not sure how much memory, processing power etc I'll need.


texts: Converting signed magnitude binary to signed 2's complement

texts:
I have a simple question about converting from signed magnitude representation to signed 2's complement.

I have no difficulty converting, for example, the signed magnitude 5-bit binary number 00100 (4 in base 10) to signed 2's complement, because it is 00100. Likewise, the signed magnitude 5-bit binary number 10001 (-1 in base 10) is 11111 in signed 2's complement.

What I don't understand is how the signed binary number 10000 (this would be -0, correct?) is converted to 2's complement. Can anyone offer some insight?
Thank you.


texts: Transistor is OFF but the voltage at the emitter is the same as voltage at the collector

texts:
This is simple simulation below of an NPN transistor:

In the above transistor, without giving any base voltage, whatever voltage I give at the collector of the transistor, I am getting at the emitter. The voltage drop across the resistor is ZERO.
From my understanding, the transistor is turned OFF when there is no base-emitter voltage. From the above simulation, the base and emitter terminals of the transistor are floating. But still the voltage appears at the bottom end of the resistor. How is this possible? What is happening inside the N-P-N regions of the transistor for this behaviour to happen?
If I connect the resistor to ground, there is a very small current of 10pA, flowing through the resistor. How is this possible and how can any current flow, when the transistor is supposed to be OFF? (There is no defined base-emitter voltage applied.)
Can someone please explain?


texts: I'm drawing out a circuit using Linear's LT3750. I don't quite understand the DONE pin. What I want to do is add an LED and have it come on when charging is done. Like in a camera. Can someone suggest how I can accomplish this?


texts: Can I use a RFID reader to check if there is an physical obstacle between it and the tag?

texts:
I am trying to create a cheap system that check if there is someone sitting on a chair.

I would like to know if there is someway I can configure a RFID reader so it identifies when there are interference in the radio signal from a RFID tag caused by an obstacle - in this particular case, a human body.
So I can put a RFID on the table and a RFID tag on the chair. I read it every 10 seconds, and when there is a human body (or any phisical obstacle) it notice some interference in the radio signal and register that that chair is occupied.


texts:
ProLume makes CFLs. I can't tell a difference between them and incandescents, and I'm pretty picky about this. I'm sure there is some 2 minute window where the light produced increases, but the point is that when I hit the switch, there is light, not 200ms later.

How do they do this? Do they maintain a certain charge in the gas so the arc forms more quickly? Does this waste energy?


texts:
How much voltage does the first lm338 drop ?
How does it actually track the voltage, I thought there should be 1.25 V across adj and output?
I am not able to understand the logic of using the pre regulator, does it equally distribute power dissipation?
Can anybody explain this with an example of input voltages, current draw and output voltages on the two regulators?

I have searched hard and was not able to find an adequate answer.


texts: How current flow remains continue in a conductor when all the free electrons reach from negative terminal to positive terminal?


texts: Long range rf communication device for PCB

texts:
I am trying to create a PCB which will have a small rf device transmitter and another PCB with the receiver. I want it to be able to transmit for roughly 2km in an urban environment. Since I will be transmitting using ISM band I guess it would be at 433MHz.

I have seen modules like the Extreme Range LoRa 868 / 915MHz SX1272 LoRa module for Arduino, Raspberry Pi but I do not need to transmit over such a big distances and its kinda big. I am unfortunately not knowledgeable enough in order to create my own circuit and I do not know how compact and small it can be compared to the market's.

I have found these guys though I have not idea how they kept the size of the device that small.

So my question is whats the 'best' small rf transmitter using ISM band, able to transmit over 2km in urban area to implement at my project?

If you want me to clarify anything please tell me.


texts: 40 kHz ultrasonic transducer making an audible sound

texts:
I have a 40 kHz ultrasonic transducer that transmits a pulse. The pulse is generated by switching a phase shift oscillator on and off with a NE555 timer. For some reason the sender is making a faint audible noise. This is the first time I am noticing it. I thought the sender might be damaged but the pulse at the receiver seems  fine although there is more coupling at the receiver than before.

Any idea what might be wrong?

Update:
Using larger resistors for the oscillator solved the problem.


texts:
I am using the circuit below, which is comprised of 4 Tekscan Flexiforce sensors (https://www.tekscan.com/products-solutions/force-sensors/a301). In the circuit below, the sensors are Rs0, Rs1, Rs2, and Rs3.

The first op-amp is to dynamically control the force range of the sensors and output a signal from Vref (0.5 volts using the voltage divider 9k and 1k) to 5V.

The second op-amp subtracts the offset (Vref) and amplifies to 0-5V.

I also have MOSFET's attached to each sensor to control which one is active. I built this circuit, but noticed that the sensors that are pulled LOW using the MOSFET are still introducing some signal in the output. Basically, when I press the sensors that are supposed to be inactive, they are still outputting a small signal.

I am assuming a MOSFET was not the right choice, and there are better switch devices to pull the sensors to GND harder. What other kind of devices should I include to better isolate each force cell? Any other thoughts would be much appreciated!


texts: Regarding a statement given in my 'Electrical Machines' textbook about synchronous machines?

texts:
I was reading the introductory chapter of my textbook on machines and when the author comes to a little introduction on synchronous machines, I was stuck on a statement midway. It goes:

  "When balanced 3-phase currents are allowed to flow in the armature winding, these produce a synchronously rotating field, stationary with respect to rotor field as a result of which the machine produces torque of electromagnetic origin."

First of all, the book follows an approach  of never mentioning motor or generator it mentions just  'machine' which is fair enough cos the schematic diagrams of motor and generator are the same with reversed energy flows.

But my question here is:

That in my amateur opinion electromagnetic torque is produced when there is an interaction between two magnetic fields with a relative speed between them. If they are stationary with respect to each other, how can a torque be generated? Please clarify.

P.S: if you could also explain separately the cases of motor and generator.


texts: Determining the inital phase of a waveform

texts:
How could I determine the initial phase of the following sinusoids with these parameters only ?

from what I can see , I know that B is leading C since the crest is behind the Y axis .. Therefore , B = positive phase , C = negative phase. I also know that one cycle is 360 degree and consist of 4 divisions so 360/4 = 90 degree per division. but I still don't know how to calculate the initial phase of the waveform.

Another thing please is this the correct formula to know the normalised power basically (Power/sqrt(2))^2 and does it apply to any sinusoid ? thanks


texts:
I just added a new library (the adafruit library) in EAGLE comprised of many devices and packages.  I can place packages, but not devices (usually devices represent a few different specific packages).

I'm using EAGLE-6.2.0.  How do I get the devices onto a board?


texts: Low-pass filter step response graph doesn't make sense

texts:
Yesterday in the lab we were supposed to calculate the step response of a standart simple RC low-pass filter that looks exactly like the network above.

However, when we try to plot the step function and the step response, it looks like the following graph:

From what I have been told, the plots shouldn't look like that. The capacitator doesn't even charge until it is at 5V. The resistor is 300kΩ and capacitator is 100nF. I think the only possible explanation would be that the two elements aren't proportional to one another, which throws off the ability of the capacitator to fully charge. I don't think it could be measurement error, since it would have to be the same mistake for each period, and I don't think that is likely.


texts: Servicing Interrupt while it disabled for some period

texts: Consider there are 4 interrupt I enabled in the microcontroller. As the first interrupt is serviced, I am entering in to protected section(All other interrupt are disabled) for doing important calculation. My question is, While code is in protected section, if other interrupt is supposed to give a interrupt will disabled completely or it will be in hold, so that it will give interrupt after exiting from protected section.


texts:
I am using a 555 timer in the monostable configuration, which means that when I send a pulse to the trigger pin, the falling edge will make the 555 generate a high pulse on the output for some time. However, if the pulse on the trigger pin is held down for a time longer that the output pulse, the output will remain high until the trigger goes up again.

How can I make it to end the pulse independently of the pulse duration on the trigger input? I have found this solution:

simulate this circuit – Schematic created using CircuitLab

But it seems to not work to me because I'm not using a button, I am using a voltage directly connected.


texts: How does photodiode works when use in reverse-biased photoconductive mode?

texts: I wanted to know the basic principal behind the working of a photodiode in reverse-biased photoconductive mode. What happens at the atomic level ?


texts:
Found a circuit on the net that should do exactily what I want (control a cooling fan) but it is 'on' all the time. Not sure if there is an error with the schematic or if there is something else I've missed.

If the thermistor is 'cold' the fan should be off. As it heats the fan should come on. At the moment the fan is always on. I've double checked my wiring etc and am sure I have it as per pic. I have substituted R4 for a 10K trimmer to allow temp trigger adjustment.

Here is the circuit diagram:

Here is the article I'm working from.

UPDATE:
Made a simulation (using Qucs) to see how the circuit should behave. I used the resistor's actual values I measured with the multimeter (see discussions below). Here is a screenshot:

(note: I could not find a fan in the parts bin so I inserted a diode for effect)

Could there be a terminal problem with the op-amp that is messing up the voltage levels? It is brand new, but it is not to say it hasn't been static zapped.

ANOTHER UPDATE:
Decided to use Qucs to see what the circuit might do if the thermistor was 'heated'. Picking a value for R1 at random, it came up with this:

This simulation shows the op-amp bias changing to produce a 'low' output, however, Q1's base is still high and causing approx 2.4V drop on the fan. For those following the conversation with @vicatcu below, this suggests that there may be a design floor in the circuit. Anyone know what else could be holding Q1 in the 'ON' position?

741 OP-AMP datasheet

UPDATE #3:
Using some of the pointers given, I managed to make a working simulation of the circuit.

The top circuit is with the thermistor 'cold' and other than the leakage current, the fan is practically 'OFF'! The bottom circuit shows the thermistor 'hot' with a comfy 11.4V driving it. The trick now is how to achieve this using a single power source! I intended to use a single 12V power pack to drive the circuit. These circuits have dual supplies. I tried simulating with a voltage divider to split the voltage from a single source, however, when the thermistor drops when 'hot' it drags the voltage across the circuit to about 2V and the fan gets about 0.8V. Not exactly 'ON'. I do have some spare 9V power packs, so can use a 12V and a 9V pack to power the circuit in the above configuration, but if I can get away with a single source, that would be ideal. Especially if people in the future wish to build the circuit themselves.

UPDATE #4:
Here is a rough plot of the thermistors resistance as temperature changes (in degrees celcius)


texts: Line Voltage of a three-phase star-connected generator

texts:
"If the phase voltage of a three three-phase star-connected generator is 200 V, what will be the line voltages:

a)  when the phases are correctly connected

b)  when the connections to one of the phases are reversed?"

I understand that the line voltage is related to the phase voltage by

Line Voltage = √3*Phase Voltage

when all the phases are connected "correctly" however what will the line voltage be when the connection to one of the phases is reversed? Thanks!


texts: Signal processing of an IVQ-3005 Radar Module

texts:
I'm going to use that module for detecting range, velocity and angle, for that radar.
https://www.innosent.de/fileadmin/media/dokumente/datasheets/180222_Datenblatt_IVQ-3005.pdf

So I have read a lot of radar techniques and I'm going to use the mode FMCW, and the modulated signal will be a sawtooth (chirps).

I have 4 signals I1, Q1, I2, Q2.

I need to confirm my understanding of the signal processing algorithms

First steps.

I1, Q1, I2, Q2 to ADC
Add I1 + I2, Q2 + Q2
Multiply the result from 2 by conjguate of 2
Apply FFT on the rows of the 2D signal I/Q to get the range
Apply fft on the cols of the 2D signal I/Q to get the velocity
Apply a third FFT but don't know on which block?
Find peaks of each FFT block to get the Range, Velocity, Range.

Would someone tell me if the steps are correct or not? Would someone explain what considerations should I take care of?

According the answer, I wrote a basic algorithm, hope that's correct

    /* FFT length must be a power of 2 */
    #define FFT_LENGTH 16
    #define M 4            /* must be log2(FFT_LENGTH) */
    #define ECHO_SIZE 12

    void main()
    {
      int            i,j,k;
      float          tempflt,rin,iin,p1,p2;
      static float   mag[FFT_LENGTH];
      static COMPLEX echos[ECHO_SIZE][FFT_LENGTH];
      static COMPLEX last_echo[ECHO_SIZE];

    /* read in the first echo */
      for(i = 0 ; i < ECHO_SIZE ; i++) {
         last_echo[i].real = getinput();
         last_echo[i].imag = getinput();
      }

 // Read in the Second channgel
// Add first channel I/Q to second channel.

      for(;;) {
        for (j=0; j< FFT_LENGTH; j++){

    /* remove stationary targets by subtracting pairs (highpass filter) */
          for (k=0; k< ECHO_SIZE; k++){
            rin = getinput();
            iin = getinput();
            echos[k][j].real = rin - last_echo[k].real;
            echos[k][j].imag = iin - last_echo[k].imag;
            last_echo[k].real = rin;
            last_echo[k].imag = iin;
          }
        }
    /* do FFTs on each range sample */
        for (k=0; k< ECHO_SIZE; k++) {

          fft(echos[k],M);

          for(j = 0 ; j < FFT_LENGTH ; j++) {
            tempflt  = echos[k][j].real * echos[k][j].real;
            tempflt += echos[k][j].imag * echos[k][j].imag;
            mag[j] = tempflt;
          }
    /* find the biggest magnitude spectral bin and output */
          tempflt = mag[0];
          i=0;
          for(j = 1 ; j < FFT_LENGTH ; j++) {
            if(mag[j] > tempflt) {
              tempflt = mag[j];
              i=j;
            }
          }
    /* interpolate the peak loacation */
          p1 = mag[i] - mag[i-1];
          p2 = mag[i] - mag[i+1];
          sendout((float)i + (p1-p2)/(2*(p1+p2+1e-30)));
        }
      }
    }


texts:
I was checking in some bags at the lab looking for capacitors and found one full (a lot!) of green (ceramic?) capacitors.

The capacitors are green, round, flat, with two legs on each side, like so:

  __
 (__)
 /  \

The package image is:

The only inscription in the package is: 1/NPO

None of the multimeters on the lab has capacitance mode. Is there any way to identify what this capacitor is?


texts: Determine order in which the 3 inputs go high

texts:
Specs

Three input signals: A, B, C that are all low upon reset

Only one signal goes high at a time. Once a signal is high, it remains high until reset

Output the order in which the three signals arrived. You can encode this output however you prefer

Sort of a phase comparator, but with 3 inputs

My attempt

Create a moore FSM with 10 states: idle, a,b,c,ab,ac, ba, bc, ca, cb. The terminating 6 states each correspond to one of the 6 possible outputs.

I feel this is overkill for something as simple. Does any one have a more elegant approach to tackle this problem? A smaller fsm maybe? Your suggestion could be completely orthogonal to mine as long as it is simpler.


texts: What is the maximum length of SWD signal lines / ribbon cables? Any idea what the physical layer of SWD is?


texts: High pass filter with triangle wave output

texts:
I'm having a problem with a high pass filter, maybe someone has an idea how to fix it.

Initially I have an IC that provides a sinusoidal signal of approximately 0 to 3V positive with a frequency varying between
50KHz and 100KHz (Figure 1).

Figure 1

The purpose of my high pass filter is to remove the DC component, leaving at the end the signal varying between approximately + 1.5V and -1.5V with the same frequency range (Figure 2).

Figure 2

I am using a Basic RC circuit with an op amp (TL081) as a buffer, and with symmetrical power supply of + 5V and -5V. The cutoff frequency is 100Hz (Figure 3).

Figure 3

My problem is that on the output of my op amp (Vout) I have a triangle wave (Figure 4).

Figure 4

The signal in "Vout" in the Figure 3 is a triangle wave with Vpp ranging from 0 to + - 1.5V and with the desired frequency (50KHz to 100KHz).

An interesting detail is that before the opamp ("Vt" in the Figure 3) the signal is correct, ie in "Vt" the signal is a sine wave of 1.5Vpp with frequency from 50KHz to 100KHz.

All observations were made on a real circuit with an oscilloscope.

Anyone have any idea what happens to my Op Amp?

* UPDATE

I did some tests with a power supply of + -15V.
And the results were the same, according to the oscilloscope images below:

at "Vt" in Image 3:

at "Vout" in Image 3:


texts: In Arduino Mega, bootloader does not work when watchdog is disabled

texts:
In Arduino Mega (ATMEGA2560), when I enabled the interrupts, the watchdog got overflown, so the chip restarted each time the program counter achieved the interrupt enabling line.

So I tried to disable the watchdog, setting WDTCSR_WDCE to 1 and WDTCSR_WDE to 1, and after setting all WDTCSR to 0.

But when I did this, I realized that my reset pin does not work anymore. Now when I click on it, simply does not happen anything, and I cannot load a new .hex to the chip.

I burnt the bootloader again using ICSP, but the problem still happens.

Thus, how can I fix it?


texts:
Introduction

I'm new to Altium and trying to find the best workflow for it. The main concern for me is a library management. I found some ready to-use libraries: PcbLib from my colleague (it is the best as it was well tested and work fine for our production), SchLib from Internet (which is fit to GOST Russian standard, I don't like the SchLib from the same colleague as she uses integrated libs and there is a lot of symbols with value included which is not convenient for me).

The problem

Let's say I'd like to put BC807 transystor (PNP in SOT-23). The symbol in my SchLib (from Internet) is OK, but the footprint is wrong - TO-92. I can put it in schematic anyway and replace the footprint by editing part properties. However I see that the pin assignment is wrong.

Solutions

I assume that the footprint should have only one pin assignment. So I need to edit schematic library element.

1) I faced that in some schematic libraries such parts as BJT represented in several variants, like:

NPN-BCE
NPN-BEC
NPN-CEB...

This always seemed to be OK for me, so in this case I'd modify schematic library to add all variants.

2) I can put the part in the schematic and manually edit the part properties to fit the footprint. I don't like this idea as there will be more hand work and more errors for that reason. Moreover - I don't know how to view and change pin assignment in schematic editor yet.

3) Force my self to learn more about integrated libs and create libraries for my own. I foresee a lot of extra work but I think that it could worth it.

4) Your solution?


texts: I have designed a custom library component in altium. I have done both the schematics and the footprint. Made sure that the PIN designators are matches in the schematic and footprint. Assigned that footprint to the schematic. Now when I try to import the changes to the PCB all components are added except this one. I have taken some screenshots of the component. If you need some more information, do let me know..


texts: Describing the process of pinching off of a n channel in JFET

texts:
The cross sectional diagram above shows an N-type semiconductor channel with a P-type region called the Gate diffused into the N-type channel forming a reverse biased PN-junction and it is this junction which forms the depletion region around the Gate area when no external voltages are applied. JFETs are therefore known as depletion mode devices.

This depletion region produces a potential gradient which is of varying thickness around the PN-junction and restrict the current flow through the channel by reducing its effective width and thus increasing the overall resistance of the channel itself.

Then we can see that the most-depleted portion of the depletion region is in between the Gate and the Drain, while the least-depleted area is between the Gate and the Source. Then the JFET’s channel conducts with zero bias voltage applied (ie, the depletion region has near zero width).

With no external Gate voltage ( VG = 0 ), and a small voltage ( VDS ) applied between the Drain and the Source, maximum saturation current ( IDSS ) will flow through the channel from the Drain to the Source restricted only by the small depletion region around the junctions.

If a small negative voltage ( -VGS ) is now applied to the Gate the size of the depletion region begins to increase reducing the overall effective area of the channel and thus reducing the current flowing through it, a sort of “squeezing” effect takes place. So by applying a reverse bias voltage increases the width of the depletion region which in turn reduces the conduction of the channel.

Since the PN-junction is reverse biased, little current will flow into the gate connection. As the Gate voltage ( -VGS ) is made more negative, the width of the channel decreases until no more current flows between the Drain and the Source and the FET is said to be “pinched-off” (similar to the cut-off region for a BJT). The voltage at which the channel closes is called the “pinch-off voltage”, ( VP ).

Is my explanation with respect to this diagram correct or should i improvise?


texts: Ground with different power supply and microcontroller

texts:
I'am encountering problems of ground loops with the scheme presented in the attached figure. In particular, the analog output seems influenced by the analog input signal, since currents loops I believe.

How can I fix this problem? What are the correct electrical connections?
I absolutely need not coupling (influence) between AI1 and AO1.

Thank you!


texts: Is there any kit for android development?

texts: Is there any kit or board on which I can test out customized android os?


texts: guesstimate max current of a domestic appliance

texts:
The appliance is a quartz oven, 1000W @ 250V. I am trying to obtain a max transient figure for the current (no oscilloscope on my bench). Opened the oven and checked the writings on various parts - they are all around 15A @ 250V.One of them is weird; its less than perfectly legible engraved writing has two entries for 250V, one reads 10A and the other 16A. Not sure what to make of that...

Another thing is its power cord is a 0.75 mm^2 multicore cable. Looking over https://www.engineeringtoolbox.com/wire-gauges-d_419.html it looks as if this cord won't be taking anything above 9.5A (more likely half of that). Is this figure what I should be working with ?

P.S.
I need to put my controller PCB in between the mains and this oven. I am building a variation of http://andybrown.me.uk/2015/07/12/awreflow2/


texts:
I am designing a simple H bridge circuit for use with the Atmega8 microcontroller. The DC motor moves this application a lot and generates 140 mA current spikes (DC motor locked) or 60 mA with normal workload.
The working voltage ranges from 10 to 16 V, I will use the transistors BD441 / BD442 (2 A of DC current at 20 V and 4 A DC at 10 V) were the most robust that will fit in my circuit.

Q1 to Q5 will be BD441 / 442, some questions:

Q5 through R8 (shunt) limits the current (I will leave 200ma peak), it makes sense to use this transistor to limit the inductive current peaks or I could just limit the current through the base of the transistors? What would be the problem of operating the base current transistor to operate in a linear region up to 200 mA?

Q6 will be a small npn, together with a 20 V zener it makes Q5 cut and stops driving in cases of over voltage. I've seen this DC motor being operated by a transistor with 45 Vce without fail, I wanted more robustness in the circuit, does it make sense to use it or not?

Use small resistors (0R33, 0R66 etc.) in the DC motor terminals help protect the circuit against very short surge currents that the oscilloscope cannot see or does my 4 ohm rshunt resistor solve this already?


texts: Most efficient circuit for 2048 Bit multiplication, and how to effectively render it

texts:
So this isn't for a hardware application, but I still think it will be extremely relevant to those that are chip designers/EE enthusiasts.

I'm attempting to do some analysis on multiplication viewed as a boolean function. For this I want to construct a boolean function of two vectors \$X,Y\$ each of length 2048. Of course a symbolic representation of this function corresponds to an actual circuit, so implicitly what I want to do is build the smallest possible circuit (meaning fewest number of gates followed by least depth) for multiplying two 2048 bit numbers and store the result in a text file (using And and NOT and Or)

Now with this comes a couple of parts:

Choice of algorithm: I'm thinking building the circuit implementing Karatsuba's algorithm would be a good idea (is 2048 bits large enough to warrant Toom-Cook?, I know its definitely too small for Strassen's Fourier Transform techniques).
Switching between algorithms, there should exist some value N, for which multiplication of N digit numbers is faster through traditional grade-school style multiplication, than running up my costs by implementing Karatsuba style multipliers at that level.
Once I have the algorithm built out what is the best way to render it symbolically in a text file? My gut is to hack this out with a long script, but perhaps you might know of some tools that let you abstractly generate circuits and write out the results which would be faster for me to convert to my desired forms than trying to reinvent the wheel in python.


texts: Why is there a 100nF capacitor in the Arduino Severino reset line?

texts:
While looking at the Arduino Severino (Single-Sided Serial Board V3) schematics I notice it has a ceramic 100nF capacitor in the reset line (marked in red in the picture below).

My questions are:

1. What is the capacitor for?

2. Would the auto-reset line still work ok if one removed the capacitor?

The context for this question is that I'm trying to find what's wrong with an RS232-to-TTL converter board of mine (see Problems with homemade RS232-to-TTL converter board based on TI's MAX232), and was studying the reset line (which is similar to the reset line in my board) when I stumbled across this capacitor.


texts: why motor continues to rotate in same direction even after changing the polarity of both armature as well as field winding?

texts:
In order to change the direction of rotation of dc motor either the armature windings connection should be change or the field winding connections but not both.
I don't get how the motor keeps on rotating in the same direction if we change the connection to both i.e the armature as well as the field winding?


texts: What is the role of the four-pin header on this USB relay board?

texts:
This is a commonly available relay board with a USB HID-like interface.

I haven't been able to find a datasheet for it on the sites that sell it.  On its right side there's a four pin header.  I'm curious regarding its functionality.  The PCB traces from the header on the bottom of the board lead to through-holes near the IC.  I measured its connectivity and it does not appear to be a mirror of the USB port.  Any ideas?


texts: Application of Laplace Transform to Circuits containing Diodes, etc

texts:
Can I use the transform methods and treat the "approximated" diode, say Silicon, as a 0.7 Volts power source and convert it into the S - domain, 0.7/s ?
Are there any advance methods for treating circuits containing diodes?


texts: Is picking up fixed pixel rgb values from a camera pic using arduino/uC possible?

texts: Does arduino have enough processing power to pick up say 20 pixel rgb values from a small single image and find the average value?Can we do it with any other microcontroller?Are any code snippets available?


texts: I2C Shifter being used to protect against short to much higher supply rail

texts:
For a device I'm retrofitting, there is a risk that some I2C datalines could be shorted to a supply rail that can be between 12-44V, or ground
To the best of my understanding this bodge circuit per data line should protect against this condition frying the device, as long as I choose a mosfet with a source-drain voltage rating higher than my expected supply rails, but I felt I would feel out the idea here to make sure its actually going to work how I expect,
The diode is just there to protect against a negative bus rail, if I'm building it I figure may aswell cover all possibilities.


texts: Is auto generated projects for embedded system the future?

texts:
I'm using CubeMX for auto generate projects for the STM32 micro controllers. I really like CubeMX because it's fits both STM8 and STM32 micro controllers.
One thing that I'm wondering about is if CubeMX is really good if you want to program micro controllers in general?
I mean....if you are used to use CubeMX for STM32...you going to be stuck with STM32. In other hands, is there any reason to change the platform if your current plat form is suitable for you?
I have talking a lot with old school micro controller programmers and they spit on CubeMX and call it cheating. I don't know if they have the experience to say so, or if they are jealous because younger generations get it much easier to do the same thing they do, without any hard working hours in the basement every day.
So if CubeMX is the future, will not other micro controller manufactures also create software that also auto generate projects for the selected micro controller?
As I know, only Silicon Labs and STM have something called auto generate project software. Will other companies follows up?
If not? Is register programming the only way to learn program micro controllers?


texts:
I found these two batteries in a drawer while looking for batteries for my wireless mouse. I was surprised to see that they are 4500 mAh, which is much higher than any AA battery I could find on the Internet.

I don't have a way to measure the capacity, but I have a 180mA charger that I used to charge them for 25 hours (25*180 = 4500, half of 9000). Sure enough, when I put them in my wireless mouse, my computer showed that they're about 50% charged.

How is this possible? Do they mean 4500 for both batteries? Is my measuring strategy flawed? What can I use to measure their capacity accurately?


texts:
From this paper, a wideband differential LNA is proposed with structure below:

The first stage is called "cross coupled- gm boosting stage". I am wondering if there is a mistake here. As seen from the picture, how is it possible for transistor MN2 to be ON or in saturation here?
That connection is totally different with normal cross coupled below:


texts: Different combinations for ADC input protection for measurements

texts:
I want to measure 0 to 5V DC analog voltages by the ADC of a microcontroller. Lets call the input impedance of the uC as Rin.

I want to protect the ADC from possible spikes or over voltage. But in this site and elsewhere I found different combinations are used. Here below are the basic ones I encountered(I named the variations as A, B, C and D):

In my case which one from above is better/optimum to use?

If diode combinations(X or Y) is better, should the diodes be Schottky?

And how should R1 or R1 and R2 be sized quantitatively relative to Rin for a good measurement accuracy? (like R1 = R2 = N*Rin ??)


texts: What is the difference between full and partial address decoding?

texts:
Could someone please explain the difference between full address decoding and partial address decoding?

I am reading the chapter on digital logic in "Structured Computer Organization", 6th ed. by Tanenbaum, but I don't think address decoding is explained very well. The book says that the address decoding logic of figure A is full address decoding. And that of figure B is partial because "the full addresses are not used". I don't understand that. To me, it seems like full addresses are not used in figure A either?


texts: Question on Speed Control vs Torque Control

texts:
I'm controlling a Permanent Magnet DC motor with PWM for a treadmill. I'm using a reflective sensor with 6 pulses per rev to get a speed feedback. So I'm actually doing "speed control" directly, but not "torque control". So I have two specific questions:

1- Do I need direct torque control for this application by measuring the current? Or a combination of speed and torque control where a cascade PI is needed?

2- Do I strictly need to know the DC motor parameters (R, L, K, J, B) in order to do speed control?

It's okay I can vary the speed by changing the duty cycle. But, beyond a simple analogy of pulse-width-modulation, I know it should be a whole lot more complicated than that.


texts:
I am trying to establish an SPI connection using the Nucleo-F030R8 board but there's no signal coming out. How do you start the connection?
I did the configurations using STM32CUBE MX software and code it using TrueStudio. Is there any line of code apart from MX_SPI1_Init(); that is already automatically generated?
As for the pins I am sure it is not faulty as I tried to toggle each and they were visible in the logic analyzer but when I tried to send Data through SPI, even the clock doesn't get triggered.
is there a step that I missed in order for the clock to be triggered?
thanks for the help


texts: Setting up individual Bluetooth chips/modules

texts:
I have a general question about how BlueTooth chips are set up:

When you are setting up a bluetooth chip (i.e. installing the firmware which will make the chip do what it needs to) the chip is usually integrated into a board which you connect to your computer so you can install the firmware on the bluetooth chip.

My question is: does this mean when you purchase the individual bluetooth modules on their own, these have to be soldered/integrated onto a circuit with a USB interface each time you need to install firmware onto the bluetooth chip??

For example, if I want to simply have a bluetooth module connected to an LED, and all it is is the module, the battery input, and the LED, and I want to connect to this module using an app on my phone and turn on the LED using my phone. How do I go about installing the firmware onto the chip to do this?
Your help is much appreciated. Kindest regards.


texts: Setting port in main loop causes ISR to starve

texts:
The example code

initializes an asynchronous timer that is fired every second
sets two ports as outputs (PA4, PA6 - LEDs connected)
the timer ISR toggles pin PA4
permanently sets pin PA6 to 1 in the main while() loop

If pin PA6 is toggled using

PORTA |= (1 << PA6);

everything works as expected. The LED on pin PA4 is toggled exactly every second. However, if the port is set like this

PORTA |= (1 << PinNumber);

the pin PA4 is only toggled very sporadically (observed up to 22 seconds between toggles). This indicates for me that for some reason the controller is either "busy" or the overflow ISR flag isn't set at all.

EDIT: If I add some other cycle intensive code like a _delay_us(10); the situation improves in that way that les and less interrupts will be missing the longer the delay. This makes sense if we assume that the pin toggle operation is at some point somehow blocking ISR entry.

Since the ISR execution should always take precedence over the code in the main loop, I don't understand why this can happen and how exactly it makes a difference if the pin number is passed as a constant or as a variable.

I understand that the compiler can probably perform some nice optimization if a constant is used, but using a variable shouldn't result in some ISR-blocking code.

This is on GCC 4.8.1.

#include "stdlib.h"
#include "avr/interrupt.h"

uint8_t PinNumber;

// asynch ISR with external clock source, fires every second
ISR (TIMER2_OVF_vect) {
    PORTA ^= (1 << PA4);
}

int main(void) {
    DDRA |= (1 << PA6) | (1 << PA4);    // set PA6 and PA4 as output
    PinNumber = PA6;      // variable that just holds PA6 for demonstration

    cli();                      // global interrupt disable during init
    ASSR    |= (1<<AS2);        // Asynchronous Timer/Counter2 from external clock
    TCNT2   = 0x00;
    OCR2A   = 0x00;
    OCR2B   = 0x00;
    TCCR2A  = 0x00;
    TCCR2B  = 0x05;             // set divider for one second
    TIMSK2  |= (1 << TOIE2);    // enable TIMER2_OVF_vect
    sei();                      // global interrupt enable

    while(1) {
        //PORTA |= (1 << PinNumber);    // this somehow causes the interrupt to "starve"
        PORTA |= (1 << PA6);            // this works as expected
    }

}

EDIT: The practical background is, that we observed the ISR not executing correctly when repeatedly changing several output ports, where the pin number is variable at runtime.


texts: How to determine which type of coupling is this?

texts:
A new model sports car had a disconcerting problem: occasionally the dashboard lights would all illuminate simultaneously. Two services call later, replacement of a wire harness for the spark plugs solved the problem. Explain what the coupling mechanism was and how it can be reduced?

What I know?
There are 4 types of coupling.

Conductive coupling
Inductive coupling
Capacitive coupling
Electromagnetic coupling.

Conductive coupling occurs due to common impedance or conduction current.
Inductive coupling occurs due to mutual inductance.
Capacitive coupling occurs due to electric field.
Electromagnetic coupling occurs at high frequencies when length of conductor >= wavelength/20.
But I am confused to determine which type of coupling is the one given in the above question. Please help.
The question says "replacement of a wire harness for the spark plugs solved the problem". So I believe the key of the answer lies here. I genuinely have 0 idea on how I start to determine this coupling. That is why I am unable to contribute anything in this question.


texts:
I'm currently using a 5V current transducer that's connecting to an I/O device ADC input. I'm trying to protect my ADC input from going over 5V by using a zener diode . The reason this is coming about, is a current I'm trying to measure has a high inrush current on start up, and I don't want to damage the system. On the zener datasheet, it says \$I_z=5mA\$
Does this mean it will only starts clamping at 5mA or does it mean it will not work after 5mA?
And is it necessary to have a current limiting resistor? What will happened if there's no resistor?


texts: Driving a DC motor forwards and backwards with a PIC

texts:
Say I have a DC motor which runs clockwise when current flows in one direction, and counter-clockwise when the current flow is reversed.

I have 2 lines going in my circuit, +5V and ground. I have a PIC, and two motors.

I want to be able to control the direction each of the motors spin without any mechanical relays.

Say pin RA0 is motor 1 forwards, RA1 is motor 1 backwards, RA2 is motor 2 forwards, and RA3 is motor 2 backwards.

What is a good way to accomplish this? Should I build an H-bridge out of transistors?


texts: Should I perform Delta to Y before analysing the following circuit?

texts:
I am working on the following circuit:

I am asked to find the node voltages at N1, N2 and N3. This problem seems pretty straight forward to me but the challenge I'm facing is due to resistor R4. Resistors R4, R3 and R5 seem to form a delta. I have already attempted this problem by solving all the currents, however, my mesh calculations seem to be wrong as the currents I got don't give me the correct voltage drops. So my question here is, should I perform a Delta to Y transform or just solve the circuit as it is.

Here are the general mesh equations I came up with. I am writing them down generally as it is not the main issue I have with this problem but I am doing so to show what I have done so far. Oh and, on the original problem, it only gave the current directions i1 to i3. I added the current i4 which I think should be in between R2 and R4:
$$Mesh1$$
$$-12+i_1(R1)+(i_1-i_4)R2=0$$
$$Mesh2$$
$$R3(i_2)+R5(i_2-i_3)+(i_2-i_4)R4=0$$
$$Mesh3$$
$$R6i_3+R7i_3-2+(i_3-i_2)R5=0$$
$$Mesh4$$
$$(i_4-i_2)R4+(i_4-i_1)R2=0$$


texts:
Let me first say I'm new to electronics. :)
So, my question is will this circuit work? I'm trying to light up a 2 lead bipolar LED using 2 pins on a microcontroller.

My theory is when the mcu pin 1 is high Q1 is saturated giving voltage, and when pin 2 is low Q4 is saturated connecting the circuit to ground and allowing LED1 to light up. And LED2 will light when pin 1 is low and pin 2 is high.

Am I on the right track? Or am I over-complicating this even? I do that a lot :)


texts: Phase-shift a Broadband Time-Domain Function

texts:
Suppose we have an operator \$A_\phi\$ which phase-shifts a sinusoid by \$\phi\$:
$$A_\phi[\cos(\omega t)] = \cos(\omega t + \phi)$$
In phasor domain, \$A_\phi = e^{+j\phi}\$ is a complex constant.
I am having trouble understanding how \$A_\phi\$ operates on a generic (broadband) time-domain function \$f(t)\$ (whose shape is known entirely a priori):
$$A_\phi[f(t)] = \quad ?$$
I was thinking that I could Fourier-transform \$f(t)\$ to decompose it into a continuum of sinusoids, but these are not true phasors, since when you multiply the Fourier transform by \$e^{+j\phi}\$, it acts as a regular multiplication, not a phase shift. How can I phase-shift a generally broadband function in time domain?


texts: Setting up Internal Oscillator with PIC16F1829

texts:
I just started working with PIC microcontrollers and I am currently using MPLAB X IDE with a PIC KIT 3. I've been trying to get a simple LED blink code to run on a PIC16F1829 using the internal oscillator at 16 Mhz. However, the behavior of the LEDs are random. The code I'm using is given below.

#define _XTAL_FREQ 8000000

#include <stdio.h>
#include <stdlib.h>
#include <pic16f1829.h>
#include <xc.h>

// BEGIN CONFIG
#pragma config FOSC = INTOSC // Oscillator Selection bits (Internal oscillator)
#pragma config WDTE = ON // Watchdog Timer Enable bit (WDT enabled)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)
//END CONFIG

int main() {

  OSCCON = 0b01110011;
  OSCTUNE = 0b00000000;
  TRISC6 = 0;
  TRISC5 = 0;

  while(1)
  {
    RC6 = 1;  // LED ON
    __delay_ms(500); // 0.5 Second Delay
    RC6= 0;  // LED OFF
    __delay_ms(500); // 0.5 Second Delay
    RC5 = 1;
    __delay_ms(500);
    RC5 = 0;
    __delay_ms(400);
  }
  return 0;

}

I'm pretty sure the problem is with the oscillator or the way I set it up since I can switch on either LED at startup. The problem arises when I introduce delays to make the LEDs blink. Using delays of 5000 means that the first LED is turned on and then nothing happens. Using delays of 1000 make the first LED blink with a delay of around 1.5 seconds with the second LED always turned on. Using delays of 500 or less make both LED blink but at different frequencies and patterns.

Could someone help me find what I'm doing wrong?


texts: Lead Acid battery switching regulator to keep constant output

texts:
I am trying to use this ups design(below image)(max 500mA) but I want to use switching regulator instead of linear regulator to keep regulated Vout as constant possible even when battery drop below Vout.

Ex: 6V battery and 9v power supply -> Vout needs to be  4.7v ->  I would like to get Vout of 4.7v even when the battery voltage is 4.7v. (Note: D3 is reducing battery voltage by 0.7v)

what kind of switching regulator I can use and how can I design it so it can step down when the voltage is above 4.7 v and step down when below. (This ups circuit need to pass intrinsic safety requirement)


texts: Sorry for the question, I'm just starting out in robotics - as a hobby- and I was just interested in what I'll be able to actually do, please let me know,


texts:
I wanna drive TLP350 by a line receiver AM26LS32. I employed scheme 1, however, there was no signal on output.
I  found in line receiver datasheet that the current sign is negative so it is likely to be a sink output. Thus I implemented
scheme 2. Yet again there is not any output. I prepared a square wave with voltage from 0V to 2V at input of TLP350 and it works fine. The output of AM26LS32
is also correct with amplitude of 4V. Now I almost sure there is something with driving TLP350 by the line receiver for example
insufficient load current or something like this. Could you please help me what the problem is?
Pins for AM26LS32: pin 14 as B, 15 as /B, and 13 as Bout.


texts: Spawning threads in SystemVerilog with input variables

texts:
I run onto a rather confusing situation where I was writing a code for a UVM monitor. This module performs these operations in order:

Listen to channel (virtual interface) until intercepting one or many
events on the pin-level.
Fill in a data structure with any values that can be read on the input ports of the interface.
Spawn a child thread to wait for the response and go back to step 1.

Spawning is using the SystemVerilog Fork.. JOIN_NONE construct and it was meant to start a task that only waits for the response at the interface and then keep going with the parent task - WITHOUT having to wait for the spawned task to finish. Inside the FORK JOIN, there is a SystemVerilog Task with input arguments that are passed by value.
When the program starts, index=0. When the get_output(data_struct, index) is executed inside the FORK..JOIN, index is still 0. However it changes once inside the spawned task! Please look carefully to where I put my debug prints of the variable index. The first one prints index = 0 and the second one prints index = 1. It is not possible in my opinion that this can happen, because first, variables are passed by value to the task and second index increments after the task is called assuming instructions take place in a sequential order inside the task run_phase.
I want to know why does index change inside the spawned task by itself.
The tweak I found to maintain the passed value is to add a wait statement of 1ns after the spawned task has been called.

Here is the code:

task run_phase(uvm_phase phase);
            int unsigned index;
            dpu_input_str data_struct;

            //monitoring

            index = 0;

            //wait until NOT reset
            @(posedge vif.rst_n);
            forever begin
                    //listen to channel: wait for any change in the IF signals
                    fork
                            @(vif.ctrl_0);
                            @(vif.ctrl_1);
                            ...
                    join_any
                    disable fork; //kill outstanding waiting processes
                    //create intermediate struct
                    data_struct.ctrl_0        = vif.ctrl_0;
                    data_struct.ctrl_1        = vif.ctrl_1;
                    ..

                    //wait for the output
                    //spawn a task to perform that and get back to channel listening
                    //again
                    fork
                            get_output(data_struct, index);
                    join_none
                    $display("Value of index after calling the task is:  %d", index);
                    //#1;
                   index++;
                end
        endtask: run_phase

    task get_output(input dpu_input_str data_struct,
                                    input int unsigned  index);
            dpu_simple_transaction dpu_tr;
            int unsigned delay_cnt;
            int i;
            //create analysis transaction
            dpu_tr = dpu_simple_transaction::type_id::create
            (.name("dpu_tr_dut_mon"),
             .contxt(get_full_name));

            $display("Value of index inside the task is:  %d", index);

            // fill in data back into analysis transaction
            // pay attention to cast when writing numeric values to enum datatypes

            dpu_tr.ctrl_0        = dpu_control_type'(data_struct.ctrl_0);
            dpu_tr.ctrl_1        = dpu_control_type'(data_struct.ctrl_1);
            ...

            // decide about the delay
            ...
    endtask


texts: Can a microwave motor be powered by usb?

texts: Firstly, I'm not even a beginner. I'd need extensive training to become a novice!! My problem, I'm trying to build a rotating display for some decorative coins. I initially thought of servo motors and YouTubed how to connect one to a usb cable but then I heard that they "click" and I want a silent motion. A friend suggested microwave motors but wasn't sure if a 5v usb would actually be "man enough" to operate one. Can anyone tell me if it is possible, please?


texts: Trying to design a single op-amp oscillator

texts: I am trying to build this single op-amp oscillator in Multisim but I keep getting this flat transient analysis. Is this what I am supposed to get? Am I using the wrong op-amp?


texts: Calculating Fc (cutoff) of series to RC to ground on inverting input of non-inverting amplifier

texts:
Regarding the chosen answer for:  How does this OP-AMP non-inverting amplifier work?

The following circuit is given, and it says that $$F_c = \frac{1}{2\pi R_1C_1}$$

simulate this circuit – Schematic created using CircuitLab

However, this doesn't seem right to me, even though I have found the same example and formula elsewhere on the web (e.g., "Non-inverting amplifier – alternative" at http://stompville.co.uk/?p=470).

To me it doesn't take into account the value of the op amp feedback resistor (\$R_2\$ in the sketch above).

Would the cut-off frequency not be based upon (\$R_1+R_2\$)?  If not, why not?

My point is that the only way the capacitor can charge or discharge is through the output of the op-amp, so surely the feedback resistor is also critical?


texts:
I am having trouble understanding the three operation modes of a transistor. I am giving below the three operation modes (CB, CE and CC) for pnp and npn transistors.

and for npn , here it is.

Unfortunately , I couldn't get the same format of picture for both types and its strenuous to draw each circuitry in circuitlab.

in CB mode, the EB junction is forward biased and CB junction reverse biased.

in CE mode , the BE junction is F.biased and CE junction is R.biased.

in CC mode , the BC junction is F.biased and EC junction is R.biased.

I am having no trouble understanding the common base configuration for both of them. But I am having trouble understanding the other two. Consider the CE mode. The collector and Emitter both are negative (for npn) , then how can we reverse bias them? does that mean that the collector is reverse biased with respect to base and vice versa ? I want a full detailed description of how the CE and CC mode works .

Question 2 : Why is the common pin (the base , the emitter , and the collector respectively) grounded? what is the significance of grounding them?

Question 3 : How does a CE mode amplify more than a CB mode ?

Thank you.


texts: Connecting IEC C14 to Circuit Breakers/Transformer 200VA/Switches

texts:
I'm working on a project that requires AC power. It's going to be drawing around 250W DC [25V/10A], so around 200VA. I plan on using a C14 plug, with the hot lead going into a small circuit breaker, then going to an on-off switch. Neutral will be tied direct to the transformer and Earth Ground will be direct to the chassis.
Looking at the internals of some power supplies, I see that most of 120VAC connections are doing through some sort of robust connections, but I can't figure out what they are.

My original plan was just to solder onto the IEC C14 terminals with some 16AWG or 18AWG stranded wire, but it seems like these connections are probably more secure and less likely to come loose. Any advice on how to get these 120VAC-interfacing components connected?


texts:
I am working with 74HC08 (AND gate chip). I have to assemble my circuit according to following image:

Everything works fine, but I have suddenly a fancy idea to replace 1N4148 diodes with low-power LEDs. Like this, I could visualize the latching effect. However, my LEDs don't emit any light. The circuit behaves without any abberration if the lowest diode is substituted by LED (no light, as I mentioned). I was thinking that probably the voltage on the lowest gate is too low, so I put the LED on the first (the upper one) gate. No light neither, moreover, the overall output perturbed the function of the rest of my circuit (which is below the lowest gate).

What am I doing wrong?


texts: In one-way asynchronous serial communication, how does the receiver sync up its bytes?

texts: I want to make a serial system over RF to receive messages sent from a computer, so I can understand how digital radio works on the bare metal. The one part I don't understand is how a sender and a receiver sync up the start and end of their bytes. It seems like it would be really easy to lose synchronization and end up with everything shifted by a few bits. How do two serial nodes sync up the start and end of their bytes?