Sunday 30 September 2018

layout - How do components on a ground plane of monopole pcb antenna effect radiation/efficiency?


I am trying to design a 2 layer PCB including two transceivers (GSM module + Zigbee IC) with internal PCB monopole antennas. I managed to have a solid ground plane on non-component side as recommended in general. Now I would like to insert a touch screen display which covers the most of that solid ground plane. Here's a screenshot (GSM only)


image



I read a ground plane completing a monopole antenna would behave as dipole antenna. Since this ground is covered with a lcd display, the performance would be affected, right?


How do cell phones manage this issue?


Also if a monopole antenna radiates in one direction opposed to ground plane, why no ground plane under antenna is a must?




relay - Integrate residential hardwired alarm zone with modern wireless sensor


I have an old alarm system in my house that I would like to integrate with a modern system. The old system has hardwired circuits where multiple reed sensors in series monitor a zone with as many windows (A). The modern system has wireless contact sensors that use a reed switch to detect open/closed state (of a door or window). I thought if I could bypass the reed switch in the wireless sensor with the hardwired circuit, the wireless sensor would monitor the hardwired zone (B).


Some have tried this and results are inconsistent. One person states that the wireless sensor must be within 10 ft of the reed sensor in the house's circuit.


The circuit in my house is at least 100 feet long, has around 20 reed switches and I measured ~30 Ohm on it. The setup (B) does not work. I measured resistance on the reed switch in my wireless sensor (it is a Ring "alarm contact sensor") when it's closed and that's about 1 Ohm. The wireless sensor won’t detect open/close state changes of the house’s circuit, although upon wiring it up as in (B) it detects the initial state correctly.


Could I solve this situation by using the houses circuit as a low voltage control circuit for a relay that would open/close a circuit for the wireless sensor like in (C)?


enter image description here



Answer



The problem was caused by induced voltage on the circuit. This can be seen by measuring voltage on the closed circuit. It is not much but it varies wildly and it is enough to confuse the wireless sensor.


The solution for me was to employ a pull-up resistor so the interference would not matter anymore. I implemented this with an Arduino and it is documented at this Instructable.


For your information, there is a DIY-alarm company that is offering a device to integrate existing hardwired alarm circuits with their solution.



Measuring surface and volume resistance of a cylinder with a multimeter


I'm trying to measure the surface and volumetric resistance of a cylinder shaped object using a multimeter.


At what points should I place the probes, and what formulas should I be using to calculate the above values respectively?


I have looked at "Standard Test Methods for DC Resistance or Conductance of Insulating Materials" (ASTM-D257) but it does not cover electrodes which are pointed (like those in a multimeter) nor does it cover cylindrical shaped objects (like an oil drum)


The cylinder I'm trying to measure is plastic, so it is likely to be in the insulating range.



Answer



If the object is uncoated plastic, then you will have difficulty separating the volume and the surface conductivities.


I would try to place the electrodes symmetrically, to avoid having to use calculus to work out what's going on.


For a 55 gallon cylinder of plastic, the obvious place for electrodes is the top and bottom planes. This yields a nicely defined length and area of conductive volume, or equivalently a nicely defined height and width of conductive surface.


The bottom electrode is fairly simple, stand the cylinder upright in a shallow pan of water, or salt solution. Water should be adequate as its conductivity should be orders of magnitude larger than that of the plastic.



The top electrode is trickier, needing to make contact with the whole top plane. I suggest a paper cloth, carefully cut in a circle no larger than the top, soaked in salt solution, possibly backed with a metal tray, or disc of alli foil, or something to make good contact. If any solution runs down the side of the cylinder, wipe it off with a dry cloth to keep the surface dry.


Connect a capacitor across the top and bottom electrode, charge it to a known voltage, and see how long it takes for the voltage to decay. Buffer the top electrode with a pA leakage amplifier, TL074 or better. Adjust the size of the capacitor until it decays in a nicely measurable time.


However, there is a trick to make pA leakage measurements with a conventional DMM with a 10Mohm input resistance. Charge the capacitor, disconnect the DMM, disconnect the supply and start a timer. After a certain time, connect the DMM and quickly measure the voltage left on the capacitor. The DMM will discharge the capacitor faster, but it should be possible with practice to estimate the voltage at the time you connected it. Do this for several different times to estimate the rate of discharge. In the 'olden days', a ballistic galvonometer would be used to measure the total charge left on the capacitor.


If it's a very non-conductive plastic, you can use lots of volts, and fA bias amplifiers are available, at a price. Alternatively, charge a gold leaf electroscope (wikipedia) and see how long that takes to discharge into your cylinder.


You can assume the conductivity is all surface, or all volume. Or assume it's mixed and put upper bounds on each. To actually separate the surface and volume components, I would suggest, in addition to top and bottom planes, band electrodes round the top and bottom circumferences, with similar foil and wet paper contacts. Use these to 'guard out' or to drive surface currents. As you chance the geometry, you would expect to find the overall conductivity change. You will need to solve the Laplace equation for assumed surface and volume conductivities for your geometry to make sense of any measurements you make in this mode.


pcb design - The best stack-up possible with a four-layer PCB?


I'm designing a 4 layer PCB and I know that the standard stack-up is



  1. Signals

  2. GND


  3. VCC

  4. Singals


(GND and VCC can be switched depending on the layer with more signals)


The problem is, I don't really want to connect all ground pins through vias, there are just too many of them ! maybe because I'm not used to 4 layer PCBs, anyway, I've read a tip by Henry W. Ott about a different stack-up



  1. GND

  2. Signals

  3. Signals

  4. GND



(Where the power is being routed with wide traces on the signal planes)


According to him, this is the best stack-up possible with a four-layer PCB, for the following reasons:


1.Signal layers are adjacent to ground planes.


2.Signal layers are tightly coupled (close) to their adjacent planes.


3.The ground planes can act as shields for the inner signal layers. (I think this requires stitching ??)


4.Multiple ground planes lower the ground (reference plane) impedance of the board and reduce the common-mode radiation. (don't really understand this one)


One problem is cross-talk, but I really don't have any signals in the third layer, so I don't think that corss-talk will be an issue with this stack-up,am I correct in my assumption ?


Note: The highest frequency is 48MHz, there's a wifi module on the board too.



Answer




You will hate yourself if you do stack up number two ;) Maybe that's harsh but it's a going to be a PITA reworking a board with all internal signals. Don't be afraid of vias either.


Let's address some of your questions:



1.Signal layers are adjacent to ground planes.



Stop thinking about ground planes, and think more about reference planes. A signal running over a reference plane, whose voltage happens to be at VCC will still return over that reference plane. So the argument that somehow having your signal run over GND and not VCC is better is basically invalid.



2.Signal layers are tightly coupled (close) to their adjacent planes.



See number one I think the misunderstanding about only GND planes offering a return path leads to this misconception. What you want to do is keep your signals close to their reference planes, and at a constant correct impedance...




3.The ground planes can act as shields for the inner signal layers. (I think this requires stitching ??)



Yeah you could try to make a cage like this I guess, for your board you'll get better results keeping your trace to plane height as low as possible.



4.Multiple ground planes lower the ground (reference plane) impedance of the board and reduce the common-mode radiation. (don't really understand this one)



I think you've taken this to mean the more gnd planes I have the better, which is not really the case. This sounds like a broken rule of thumb to me.


My recommendation for your board based only on what you've told me is to do the following:




Signal Layer
(thin maybe 4-5mil FR4)
GND
(main FR-4 thickness, maybe 52 mil more or less depending on your final thickness)
VCC
(thin maybe 4-5mil FR4)
Signal Layer

Make sure you decouple properly.


Then if you really want to get into this go to amazon and buy either Dr Johnson's Highspeed digital design a handbook of black magic, or maybe Eric Bogatin's Signal and Power integrity Simplified. Read it love, live it :) Their websites have great information as well.



Good Luck!


Saturday 29 September 2018

surface mount - SMD ceramic capacitors producing ticking sound?


I've soldered a couple of SMD capacitors to pads which were not intended to host them. As a result there's a bit of space between the PCB and the capacitors. I have a signal on the capacitors as shown in this question on the output of the circuit and if my sound-card is right, the capacitors are producing sound of same frequency as the signal.


My question is: Is that a reason for concern and if yes, how would I solve that problem?



Answer



Most ceramic capacitor dielectrics show piezo-electric effect, which causes them to vibrate with the applied voltage. If that voltage has an audio frequency the vibrations may be audible.


That's no reason for concern, hundreds of billions ceramic capacitors are produced each year which show this effect, and which perform fine on the PCB.


The sound can be reduced by using smaller packages. In larger packages stretching/shrinking the PCB may act as a soundboard. With smaller packages this effect is smaller.


Note that there are no measurable piezoelectric effects in Class 1 capacitors, such as C0G or NP0 - neither of which is considered ferroelectric.



Further reading
Piezoelectric effect in ceramic chip capacitors


transfer function - What is the general form of a first and second order dynamic system, in laplace and time space?


I have some of the information, but a lot of it is missing and I cant find a clear answer on the web.


The general form of a second order dynamic system is:


$$\frac{d^2x(t)}{dt^2}+2\zeta\omega_n\frac{dx(t)}{dt}+\omega_n^2x(t)=f(t)\:\:\:\:\:\:\:[1]$$


where


x(t) - is the output, e.g current
f(t) - is the input, e.g a voltage signal

zeta - is the damping coefficient
wn - is the natural frequency

An example of a second order dynamic system is a RLC circuit. If a resistor, capacitor, and inductor are connected to a power source with voltage at time t equal to f(t), the summed voltage across the three components always equals f(t) at any time t.


$$Ri(t)+\frac{1}{C}\int_0^ti(t)dt+L\frac{d\,i(t)}{d\,t}=f(t)\:\:\:\:\:\:\:[2]$$


So for example if f(t) is a step input from 0 to 6V, the equation will be:


$$Ri(t)+\frac{1}{C}\int_0^ti(t)dt+L\frac{d\,i(t)}{d\,t}=6\:\:\:\:\:\:\:[3]$$


If this equation is rearranged so that it is in the general form shown in equation [1], then you will be able to find out the natural frequency of the system (omega_n) and the damping coefficient of the system (zeta).


The general form of a first order dynamic system in laplace space is:


$$G(s)=\frac{k(s+a)}{s+b}\:\:\:\:\:\:\:[4]$$



where


G(s) - is the transfer function (output/input)
k - is the "gain" of the system
a - is the zero of the system, which partially determines transient behavior
b - is the pole of the system, which determines stability and settling time

An example of a first order dynamic system is a RC circuit. The voltage across the resistor plus the voltage across the capacitor equal the voltage of the source f(t) at any time t.


$$Ri(t)+\int_0^ti(t)dt=f(t)\:\:\:\:\:\:\:[5]$$


So again, for a step input from 0 to 6V, the equation will be:


$$Ri(t)+\int_0^ti(t)dt=6\:\:\:\:\:\:\:[6]$$



In laplace space this is


$$RI(s)+\frac{1}{Cs}I(s)=\frac{6}{s}\:\:\:\:\:\:\:[7]$$


rearrange to general form:


$$I(s)*(Rs+\frac{1}{c})=6\:\:\:\:\:\:\:[8]$$


$$I(s) =\frac{6}{Rs+\frac{1}{c}}\:\:\:\:\:\:\:[9]$$


$$I(s) =\frac{\frac{6}{R}}{s+\frac{1}{Rc}}\:\:\:\:\:\:\:[10]$$


Since the input was the step input 6, you can see that the steady state gain is equal to 6/R, the pole is equal to 1/RC, and there are no zeros. You could do the inverse laplace transform of this equation to find out the instantaneous current i(t) at any time t.


Now my questions:





  • I have shown the general form of a first order dynamic system in laplace space, and the general form of a second order dynamic system in time space, but what is the general form of a first order system in time space, and a second order system in laplace space? I have definitely seen these written somewhere but I can't find them in my notes or online.




  • How would you go from equation [3], to the general form (time space) as shown in equation [1]?




Any answer is much appreciated, even if it only answers one of the questions, or partially answers a question. Thanks for reading!



Answer



You want to use the following property of Laplace transform: $$\mathscr{L}\left({\frac{dx(t)}{dt}}\right)(s) = s\mathscr{L}\left(x(t)\right)-x(0)$$


This allows you to easily move between differential equations and polynomial equations.



Time domain to frequency domain: Take your first equation for example $$\frac{d^2 x(t)}{dt^2} + 2 \zeta \omega_n \frac{dx(t)}{dt} + \omega_n^2 x(t) = f(t).$$


If we denote the Laplace transform of \$x(t)\$ by \$X(s)\$ and \$f(t)\$ by \$F(s)\$ and apply Laplace transform to this equation then this property implies $$s^2 X(s) + 2 \zeta \omega_n sX(s) + \omega_n^2 X(s) = F(s)$$ where for simplicity I assume that \$x(0) = f(0) = 0\$.


The transfer function is defined as the ratio: $$\frac{X(s)}{F(s)} = \frac{1}{s^2+2 \zeta \omega_n s + \omega_n^2}$$


Frequency domain to time domain: Lets try the example \$G(s)=\frac{1}{s^3+1}\$ then we have by definition that $$G(s)F(s) = X(s)$$ which implies $$F(s) = s^3X(s)+ X(s).$$


Taking inverse Laplace transform we find that $$f(t) = \frac{d^3 x(t)}{dt^3} + x(t).$$


Hopefully this allows you to see the pattern in general.


microcontroller - CAN Initialization Timeout Error in STM32F4


I am using an STM32F446ZET6U Nucleo Board (programmed with CubeMx and Keil uVision 5) and I try to use some of the ST's examples in order to learn about its peripherals. I am stuck with the CAN peripheral. The problem is that when the code enters the


HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef* hcan)

it returns a HAL_TIMEOUT so the CAN can't be initialized. I want to use CAN in the LOOPBACK mode (without an external transceiver connected) in order to test the functions. As I traced the bug of the program with the KEIL Debugger the code seems to be stuck in the


/* Wait the acknowledge */
while((hcan->Instance->MSR & CAN_MSR_INAK) == CAN_MSR_INAK)

{
if((HAL_GetTick() - tickstart ) > CAN_TIMEOUT_VALUE)
{
hcan->State= HAL_CAN_STATE_TIMEOUT;
/* Process unlocked */
__HAL_UNLOCK(hcan);
return HAL_TIMEOUT;
}
}


Which is in the stm32f4xx_hal_can.c file.


So I searched the datasheet and I found this



30.4.1 Initialization mode The software initialization can be done while the hardware is in Initialization mode. To enter this mode the software sets the INRQ bit in the CAN_MCR register and waits until the hardware has confirmed the request by setting the INAK bit in the CAN_MSR register. To leave Initialization mode, the software clears the INQR bit. bxCAN has left Initialization mode once the INAK bit has been cleared by hardware.



and also because it is the 0 bit of the CAN_MSR register it also states



Bit 0 INRQ: Initialization request The software clears this bit to switch the hardware into normal mode. Once 11 consecutive recessive bits have been monitored on the Rx signal the CAN hardware is synchronized and ready for transmission and reception. Hardware signals this event by clearing the INAK bit in the CAN_MSR register. Software sets this bit to request the CAN hardware to enter initialization mode. Once the software has set the INRQ bit, the CAN hardware waits until the current CAN activity (transmission or reception) is completed before entering the initialization mode. Hardware signals this event by setting the INAK bit in the CAN_MSR register.



So after this, I can understand that the problem is that the CAN_RX doesn't receive the 11 recessive bits so the Hardware does not clear the INAK Bit in the CAN_MSR Register so the CAN cannot be initialized. I feel that the problem might be the fact that I don't use a transceiver so somehow the CAN_RX can't receive the 11 recessive bits that it needs but if it is not this then I don't know how to fix it. (I have already ordered some transceivers and I am going to test it when they arrive.)This is also the code implementation:



The clock is set to the internal HSI at 16 MHz and APB1 Prescaler to 1 so the CAN gets 16MHz clock.


void SystemClock_Config(void)
{

RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;

/**Configure the main internal regulator output voltage
*/
__HAL_RCC_PWR_CLK_ENABLE();


__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);

/**Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

{
_Error_Handler(__FILE__, __LINE__);
}

/**Initializes the CPU, AHB and APB busses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;

RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}

/**Configure the Systick interrupt time
*/

HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);

/**Configure the Systick
*/
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);

/* SysTick_IRQn interrupt configuration */
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}


Here is the CAN Initialization Procedure. With 16MHz clock and a prescaler of 2 then the SJW = 1, BS1 = 11, BS2 = 4 gives you a baudrate of 500kbps with the sample point in 75%.


static void MX_CAN1_Init(void)
{
CAN_FilterConfTypeDef sFilterConfig;
static CanTxMsgTypeDef TxMessage;
static CanRxMsgTypeDef RxMessage;

hcan1.Instance = CAN1;
hcan1.pTxMsg = &TxMessage;
hcan1.pRxMsg = &RxMessage;


hcan1.Init.Prescaler = 2;
hcan1.Init.Mode = CAN_MODE_LOOPBACK;
hcan1.Init.SJW = CAN_SJW_1TQ;
hcan1.Init.BS1 = CAN_BS1_11TQ;
hcan1.Init.BS2 = CAN_BS2_4TQ;
hcan1.Init.TTCM = DISABLE;
hcan1.Init.ABOM = DISABLE;
hcan1.Init.AWUM = DISABLE;
hcan1.Init.NART = DISABLE;

hcan1.Init.RFLM = DISABLE;
hcan1.Init.TXFP = DISABLE;
if (HAL_CAN_Init(&hcan1) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}

/*##-2- Configure the CAN Filter ###########################################*/
sFilterConfig.FilterNumber = 0;
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;

sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.FilterIdHigh = 0x0000;
sFilterConfig.FilterIdLow = 0x0000;
sFilterConfig.FilterMaskIdHigh = 0x0000;
sFilterConfig.FilterMaskIdLow = 0x0000;
sFilterConfig.FilterFIFOAssignment = 0;
sFilterConfig.FilterActivation = ENABLE;
sFilterConfig.BankNumber = 14;

if(HAL_CAN_ConfigFilter(&hcan1, &sFilterConfig) != HAL_OK)

{
/* Filter configuration Error */
Error_Handler();
}

}

So, can the problem be the fact that I don't have an external transceiver or is it something else?



Answer



I couldn't try your solution because I didn't have other CAN devices but I tried to just use a jumper between the pins and it really worked! I can't understand why because the datasheet states that the TX pin is connected to the RX internally!



arduino - My Atmega328 seems to be overkill, what should I use instead?



I'm using an Atmega328 chip with the arduino bootloader in a very small circuit. The sketch simply plays a tune using the tone() function to play a melody through a piezo speaker on a single pin.


Clearly using this chip is overkill, but the programming environment is so simple for arduino, and easy for me to use. Can I use a Attiny with the arduino bootloader or something similar? What would be the right way to miniaturise this project, so I don't feel like I'm wasting components. If it's a case of using a different chip/environment entirely, where do I start?


(for clarity, I am not using an arduino in the circuit, just the Atmega328 chip)



Answer



Using Atmel chips in the Arduino IDE


For the ATtiny45 and ATtiny85 you can use this library that you put in the same directory as your sketches (make a "hardware" directory, then unzip this in there).


I found lots of things just work, but not everything. These chips are pretty tiny. You only get 4 input/outputs (or 5 if you have a high voltage programming device), and you have to be careful which ones can produce the type of output needed by tone (probably only 2 of the pins). These guys are in the $1.25 to $2.25 range.


You can also use ATtiny2313's, but I've not tried using the Arduino IDE with them. I switched to using AVR style GCC, as its not much harder and if something breaks I know its my fault. The 2313 has a ton more pins (not as many as the ATmega), hardware serial support, etc. It is in the $1.50 to $2.50 range.


The ATmega328p is more in the $3.00 to $4.50 range (and currently is often out of stock).


You can think of the Arduino IDE as consisting of 3 main parts:




  • a nice, reduced programming language for AVR style chips (mostly by providing you with simple to use functions like tone)

  • a nice, easy to use upload mechanism for ATmega and larger ATtiny chips (the bootloader)

  • a nice GUI interface that makes it easy to use the right part when you need it


When you work with the ATtinyX5 chips, the bootloader doesn't work, but you can use an Arduino to program the ATtiny's very easily. The library I linked to makes the first and third parts of the IDE available to you.


If you want something cheaper, but mostly the same as the ATmega328p, I would go with the ATtiny2313. If you want something smaller, then the 8-pin ATtiny85 is nice, but it is not too much cheaper and lacks a lot of the nice features of the ATtiny2313 and the ATmega328p.


I haven't tried the other Atmel AVR product lines, but they definitely have others. Luminet (mentioned in another answer) uses the ATtinyX4 line and has a modified IDE to work with them. They appear to be in the $1.80 to $3.00 range.


batteries - Replacing 5 V pin with battery not working


I have a small breadboard that has a L293D motor controller and 2 DC motors. The board is hooked up to a Nordic DK and everything on the PWM side is fine. The breadboard is powered by the development board's 5 V pin but I am ready to move to the next step of a PCB so I will need a battery.


I have two 2032 coin cells that were taped together and have jumpers for positive and negative but whenever I try to use it as the power source on the breadboard it fails to work. I checked it with a multimeter and it's throwing out at least 5.6 V.


Is there something I am missing? Are lithium batteries not applicable for this? Can I still make a PCB with what I have now?



Answer



Your coin cells have far too little peak current capacity to run anything but the tiniest sort of motor. As a result the voltage is probably much lower under load. Your L293D being a bipolar bridge will also have very high loss - probably in excess of a 1-volt drop by the time you count both top and bottom switches.


Further, your develoment board may not be designed to handle the (lightly loaded) voltage of two coins cells in series, so you may have already damaged it.


If you want an "easy" way to replace a 5v supply with a battery, you might consider using a USB powerbank, though they can have various sorts of turn-on behavior and some may turn themselves off below a minimum current draw. Doing it yourself is likely to either require a number of AA cells to get well above the target voltage even at end-of life, followed by a linear regulator. Or better your can use switching regulator or potentially a boost converter from a lower battery voltage (which incidentally is what a USB power bank is - some buck regulate from 2 lithium cells, others boost from 1, both typically cells good for well over an amp).



Friday 28 September 2018

High-stability oscillators (non-crystal)


Are there any high-stability oscilators, which are not crystal based, given that temperature is stable down to 0.01 C and voltage down to 0.001V?



Will LC-based oscillator be able to show performance comparable to crystals in such conditions (probably in wierd variants like LC-opamp-LC-opamp-LC-opamp... so that any energy loss on each stage is recovered and we are getting narrower bandwidth)?


Price is not limited here, to a some degree (so brand new atomic clocks are above the budget, but 100$ for peltier/oven & parts is ok).


From my (naive) point it seems that it should be possible to achieve better short & long-term stability than with crystals...



Answer



Superb mechanical construction of the inductor is a major factor. See Czech Tesla report cited below for specific advice.


If you can track down this 1941 [!!!] original and/or the many derivatives based on it using both "valves" and 'solid state" circuits you will probably find circuits with performance about as good as you can get.


"E. O. Seiler, "A Low-C Electron-Coupled Oscillator," QST, Nov 1941."


A circuit based on Seiler's work was published in QST with , I think, a title like "A synthetic rock" or "The synthetic rock. (Rock == crystal).


One reference noted that the oscillator output was designed to be plugged into a crystal socket and when used at eg 12 MHz to provide the reference fquency for a 2 m,etre band (144-148 Mhz) transmitter, produced a signal which was zero beat stable for hours ata time when compared with a crystal controlled test unit. Zero beat stable means drift is within a few Hz at most as otherwise you hear "rumbling" as the two signals heterodyne.





I don't speak or read Croatian and gargoyle was having a bad day but I believe the circuits below are based on Seiler's ideas. See pages 147-148 here. Translation to English (unless you read Croatian) looks worthwhile. Many other related circuits there too. These may come from US "hams' W8PK & W3EB.


Note that these two circuits do NOT look overly special. I think a significant part of the "trick" is in the relative (lack of) loading of the tuned circuit.


enter image description here


This mentions the Synthetic Rock in passing, with approval.




Valuable albeit old !!!


Resources for Understanding Oscillators {2003} - with references to MUCH older material.


Look for Seiler references.


The following are from the above reference -


E. O. Seiler, "A Low-C Electron-Coupled Oscillator," QST, Nov 1941.




  • Describes the circuit that D. Stockton, ARRL Handbook, 1995+, p. 14.14, mistakenly calls "the original Colpitts circuit ... now often referred to as the parallel-tuned Colpitts..."


W. B. Bernard, "Let's Increase V.F.O. Stability," QST, Oct 1957.



  • Suggests using grounded-cathode triode with separate buffer instead of the electron-coupled pentode circuit. Also suggests using the Seiler or Colpitts circuit with the largest available value of tuning variable capacitor instead of the Clapp circuit with a low value of tuning capacitor.


J. Vackar, "LC Oscillators and their frequency stability," Tesla Tech. Reports, Czechoslovakia, Dec 1949.



  • He discusses mechanical design of tuning circuits, presents general analysis of oscillator circuits and their sensitivity to changes of internal capacities of valves (vacuum tubes). He reviews existing circuits, including Gouriet-Clapp, Seiler, and Lampkin, comparing their amplitude dependence on frequency and hence useful tuning range. He describes in detail the design process for circuit we commonly refer to as the Vackar oscillator, which has greater tuning range. He then goes on to describe a slight variation with still greater tuning range. This last circuit, which I have never seen elsewhere, he describes as a compromise between the first-mentioned Vackar circuit and that due to Seiler.



1949 original of the above report in Czech. Superb][(http://www.scribd.com/doc/62276627/Vackar-wholepaper)
Starts with a description of mechanical requirements for high stability.


J. K. Clapp, "Frequency Stable LC Oscillators," Proc. IRE, Aug 1954.



  • Shows that Gouriet-Clapp, Seiler, and Vackar oscillators have equivalent frequency stability given equal resonator Q. They differ only in how much the amplitude of oscillation changes when they are tuned. The three circuits are useful over frequency ranges of 1.2, 1.8, and 2.5 to one, respectively.


The above suggests that the Vackar oscillator is potentially more useful.




See refs here Discrete Oscillator design- Rhea on page 261.



microcontroller - When IO is limited on a uC, how do you move the logic away from the uC?


For instance, if you had an Arduino with 4 digital IO pins, how could you independently light > 4 LEDs, or read the state of > 4 buttons?



Answer




A shift register such as the 74595 will allow you to have many outputs with only 2 connections: a data pin and a clock pin. You set the data pin to the next value you want to move into the register, and then pulse the clock pin.


operational amplifier - How to measure line voltage (220V) with an arduino?


I'm a Electrical Engineering student and I want to sense and sample the voltage signal coming from a wall socket (110V - 220V). I came up with the following circuit using a voltage divider with high impedance and a diferential amplifier. I would like to avoid using a transformer because of weight constraints.


Is there a better way to solve this problem? Should I use a capacitor divider instead?


Circuit I came up with




Answer



Regular transformers don't have to be heavy.


enter image description here


Figure 1. Miniature transformers.


Hammond Manufacturing, for example, make 0.5 VA transformers smaller than a 25 mm / 1" cube. This provides isolation from mains (which your circuit does not).


schematic


simulate this circuit – Schematic created using CircuitLab


Figure 2. Analog interface.


To read AC with your micro you'll need to bias the transformer to mid-DC supply as shown. R1, R2 and C2 provide this function.


R3 and R4 provide a potential divider to attenuate the transformer signal into the range suitable for your ADC.



microcontroller - Sharing an oscillator between two ICs


I have a microcontroller and an FPGA on the same board. If they're both going to run at the same clock speed, can I just use one oscillator to clock them both? There seems like there is something I should watch out for here, but I can't immediately think of any problems with it if I just keep the traces short. Has anyone done this before? What would be some common pitfalls of doing this?




Answer



Yes, most likely that's fine. You have to make sure each chip is set up to expect a ready clock in, not to drive the crystal itself. You have to look at the datasheets, of course, but most likely the devices can be set up that way.


However, there may be a less expensive way. Very likely at least one (probably both) of the chips can drive a crystal directly. You can have one of them do that, and possibly use it to drive the other chip. This can get a little tricky since the crystal drive output line is more of a analog signal than a digital one, and it may not be interpreted as intended by the other chip if used directly. It may not be interpreted as intended by a ordinary digital gate either, so buffering it close to the crystal and then sending that digital signal to the other chip may not work either. This is where you have to consult the datasheets very carefully and do some experimentation.


A totally reliable way would be to have one chip drive the crystal, have that signal be buffered internally and then driven out on another pin as real guaranteed digital signal. This is more likely to work with the FPGA driving the crystal since you should be able to have the clock signal driven out to a pin. Microcontrollers sometimes have clock out pins, but in the case of PICs at least (what I am most familiar with), that is usually the oscillator/4 frequency, not the oscillator frequency directly. You probably don't want to run the FPGA and 1/4 the clock rate of the micro.


Thursday 27 September 2018

operational amplifier - Issue with RC op-amp oscillator


I'm trying to understand how oscillators work and am currently working with an RC phase shift oscillator:


RC_phase_shift_oscillator


$$R_1, R_2, R_3 = 200 \Omega$$


$$C_1, C_2, C_3 = 4.7\text{nF}$$


one of the issues I'm having is that one source states that \$R_{\text{fb}} = 29R\$ for sustained oscillation yet when I set the resistor to \$5.8\text{k}\Omega\$ I get a flat line in nV.


What am I missing out?




Answer



There are three problems.


1 - The biggest is that you have no excitation. That is, your simulator will provide a perfectly balanced set of operating points, and the circuit will have no reason to start oscillating. Try adding a circuit to provide a brief pulse into the - input just after startup. Adding a noise generator to the input to simulate real op amp noise performance will do the trick, too.


2 - Assuming you are doing transient analysis, a perfect gain (your 29) will cause an oscillation which never grows larger. Try a feedback value of 40 times, rather than 29, and you'll see the oscillation grow fairly rapidly. Start with a simulation time of at least 50 msec, then tailor as necessary. Once you see this, start reducing the gain ratio, and you'll see the startup time gradually increase.


3 - As is true of any open-loop oscillator, if you have enough gain to sustain oscillation, you almost certainly have too much gain, and the amplitude of oscillation will grow exponentially until the amp starts clipping. Real oscillators require some sort of automatic gain control in order to provide a low-distortion waveform.


bus - How do I program 2 CAN nodes to transmit continuously in succession?


Suppose I have three CAN nodes: A, B and C. We know that when two nodes transmit at the same time, the node that has the least SID will prevail over the bus and the other node will have to give the bus to the first node. What I would want to do is that node B and C will continually send CAN frame to node A in succession (e.g. node B -> node A, node C -> node A, node B -> node A). Can I just assign a lower SID to B than C and just do the following code snippet?



Node B


while(1) sendCANmsg(data, NODE_A, sizeof(data), RTR_OFF);

Node C


while(1) sendCANmsg(data, NODE_A, sizeof(data), RTR_OFF);

Inside of the sendCANmsg, here is the snippet:


TXB0CONbits.TXREQ = 1;  // Request Message Transmission
while (TXB0CONbits.TXREQ); // Wait until message is sent.


By the way, I'm using PIC18F25k80 in implementing this. I was just thinking that after node B sent the message, when node C is about to send its message. Node B will again win the bus arbitration thus giving node C no chance of transmission. So I remedy that I can only think of is to insert a small delay like:


while(1) {
sendCANmsg(data, NODE_A, sizeof(data), RTR_OFF);
delay_us(10);
}

Or am I wrong? :)



Answer



Since this method brings the bus near 100% utilization, we'll assume that these 3 nodes are the only ones on the bus. Based on your delay time of 10µs, we also assume that the bus speed is 500kbps (i.e. 5 bits of delay, or 1 bit short of the post-arbitration wait between messages).


Whether the method will work or not depends largely on the implementation details of your CAN driver. A more reliable way to accomplish this would be to have node B and C waiting to read each other's message before sending (with node B initially transmitting without waiting). I.E.:




  1. Wakeup

  2. Node C waits on message B

  3. Node B transmits

  4. Node B waits on message C

  5. Node C transmits

  6. Node C waits on message B

  7. Etc.


To account for desynchronization, each waiting period should have a timeout, after which the node transmits regardless of whether it's received the other node's message.



This will even out the bus utilization and leave each controller able to accomplish other tasks while waiting for the message (instead of continually trying to transmit in the event of an arbitration loss).


Note that this is an unconventional use of CAN. You may be better served with a simpler protocol, such as SPI (node A would have to poll B and C, but there would need to be no arbitration, and everything could be DMA and/or interrupt-driven).


design - What precautions should I take when mixing analog audio and digital on the same board?


What precautions should I take when mixing analog audio and digital (uC control) on the same board? I don't want to hear the I2C bus in my speakers. I'm thinking about





  1. Separate power supplies

  2. Separate ground planes, with each part within its own ground plane

  3. A single connection over a ferrite bead between ground planes

  4. Lots of decoupling, preferably by RC instead of simply a C

  5. Slew rate control, esp. on serial buses (lots of edges!)

  6. Physical distance between both world



The RC decoupling may or may not be overkill, but it costs only a resistor.

Other suggestions?



Answer



I've never had an issue with I2C being audible in a circuit including using I2C adjustable resistors in a 60dB gain microphone pre-amp so i doubt you'll have much issue but here are some thoughts.


Avoid using multiple ground planes unless you really need it. You can easily cause more noise problems than you solve if your not very careful to avoid routing any signal over the split in the plane. Unless your goal is very high fidelity, use a single solid ground plane. In general you will find almost every mixed signal IC will call for separate analog and digital grounds/supplies. While this is great in an ideal world, if you don't have the space to do this properly, you will cause more noise problems than you will solve. For instance your better off using a single power supply with an LC filter in front of the analog input than you are running a separate supply across the board on a 15mil trace.


Other thoughts:



  • Use an I2C clock above the audio range, 40khz or higher. Use the largest pull up resistors you can given your bus speed. This limits the current and hence noise generation. Also make sure the I2C bus isn't ringing, if it is use series termination at all devices (40-50ohm resistor should be fine). Match the I2C traces to 50ohm if you can and make 1 long run through all devices rather than T-ing off the bus.

  • A single, solid ground plane. Remember that high frequency signals will follow the path of least inductance to ground, not the path of least resistance. With this in mind lay out the PCB such that ground currents from the digital portions are not traveling under the analog portions.

  • Proper decoupling, do not use resistors. You have to calculate this for your particular design but a 0.1uF and a 10nF ceramic cap per power pin and larger, 10uF caps per major IC or section is generally a safe bet. Always place caps as close as possible to the power pin and get to ground ASAP. Don't be stingy with the vias, even using multiple vias to ground for each decoupling cap is not a bad idea if you have the space.

  • Use either a separate regulated power supply or use an LC filter to segment off an analog supply from the digital supply. If you use a split plane, you again can't cross this split on an adjacent layer with ANY traces.


  • Use protection around any sensitive analog components or pins. Ground rings around op amp inputs, etc. In fact a ground pour on the surface of the analog section is not a bad idea as long as its properly coupled to the ground plane (lots of vias) and doesn't have orphaned copper.


Tuesday 25 September 2018

lora - How to minimize degradation of physically overlapping but separately managed/owned LoRaWAN networks?


Wireless networks such as WiFi and Bluetooth are designed to work well even when many separately owned and managed networks overlap physically. For example, an apartment building full of personal WiFi routers just works, although this can lead to performance issues.


LoRaWAN is not really designed for this kind of robustness. From What is LoRaWAN?:




You may have heard that LoRaWAN isn’t a great fit for customer-deployed (aka private network) solutions, which is true today... It is a better fit for public, wide-area networks, because with LoRaWAN, all of the channels are tuned to the same frequencies, and it’s better to have only one network operating in a single area in order to avoid collision problems.



The article goes on to explain alternatives, but my question is about LoRaWAN itself. It appears that simply setting up a new LoRaWan network in proximity to, or overlapping another can degrade the performance of each. Assuming that is true, what can be done - if anything - to minimize degradation short of cooperation/coordination?


Of course I'm a strong advocate of cooperation and coordination, but sometimes it's not an easily available option. Are there features within LoRaWAN that allow for (or at least help facilitate) detection and avoidance of performance degradation due to adjacent or overlapping networks?



Answer



One of the design assumptions of LoRaWAN is that multiple gateways are all listening to the same nodes. The only way to add the type of coordination you're talking about would be to add frequency hopping.


Link Labs and Haystack are two companies providing frequency hopped versions of LoRa.


sram - What is precharge in terms of Static Ram?


In many six transistor static ram cell diagrams, it mentions a so called "precharge" that holds both bit lines at positive voltage. What is the use of this? wouldn't this constant voltage just screw up all your data? And why does it require transistors if they are always on? The transistors in question are circled in red




voltage - Is there a way to control the PWM duty cycle of a 555 timer without using a variable resistor?


I need to control the duty cycle of a Pulse Width Modulation (PWM) circuit from a DC voltage input. To do this, I've been looking into 555-timer circuits - but every circuit I've come across involves controlling the duty cycle by using a variable resistor/changing resistor values (e.g. changing the value of Rb in the diaram shown below).


I've researched and thought about it a lot, but I can't find a way to use a certain input voltage to give a certain duty cycle in a PWM cicruit with the 555-timer, so any suggestions I may not have thought of or letting me know it can/can't be done would be appreciated.


Thanks


enter image description here

As a note: The requirement of controlling a PWM circuit duty cycle with an input voltage and not by other means is necessary for what I'm doing... I'm not trying to make my life difficult



Also, I forgot to mention I'm also not allowed to use microcontrollers!



Answer



Yes – simply use your external DC voltage to bias the feedback voltage. Done! (this means connecting it, with a appropriately sized resistor, to the threshold pin).



I'm not trying to make my life difficult



Well, still you're using a NE555 to generate a PWM. I'd simply go, get a cheap microcontroller with an ADC and a PWM unit (these start well below half a Euro), write ten lines of C firmware and be done. No analog circuitry you have to tune, no uncertainty and non-linearity of duty cycle as function of control voltage, just clean software in a microcontroller that doesn't need any external components but a decoupling capacitor for its power supply. Bonus: internal oscillators of microcontrollers these days would usually be much more accurate than a NE555.


Update better late then never: you mentioned you're not allowed to use microcontrollers. I know this will probably mean some learning overhead, but a CPLD-implemented PWM generator with either a resistor-ladder-based ADC implemented with pins and external resistor networks (so you don't have to solder a lot of resistors) or a cheap ADC IC would still be what I'd use. PWM is basically a pretty digital problem, so I'd go digital.


Another easy approach would simply use a quad Opamp IC: Opamp 1 & 2 to generate a triangle wave, opamp 3 to compare the instantaneous triangle voltage to your external DC voltage. Easy PWM, and gotten rid of the NE555.


Why would one still use normal EEPROM instead of flash?


Is there any reason why people are still using (and implementing in new systems) normal EEPROMs instead of flash memory, nowadays?


From the Flash memory wikipedia:



Flash memory was developed from EEPROM (electrically erasable programmable read-only memory).



Would there be any disadvantages (power consumption, space, speed, etc.) on using flash instead of normal EEPROM?



Answer



To be pedantic, FLASH memory is merely a form of EEPROM: There is a marketing / branding aspect here. Typically, the distinction used today is that EEPROMS are single-byte (or storage word) erasable / rewritable, while FLASH is block-based for erase/write operations.


Relevant to the question:




  • EEPROMs continue to be popular due to maximum erase/write cycle ratings being an order of magnitude or two better than FLASH

  • Due to investments in design typically having been amortized over time, as with any mature technology, the cost of production and testing reduces compared to a newer technology.


Monday 24 September 2018

operational amplifier - Why do comparators generally have higher offset voltages than opamps?


I need to compare a signal to a constant voltage; the signal ranges from 0 to 30mV, and I require a response time of 50ns at 250µV difference. The signal is a triangle wave with a slew rate in the range of a few mV/µs.


When having a look at the comparators offered by TI, they start at an offset voltage of 750µV, with 10ns comparators starting at 3000µV.



When, however, looking at the list of opamps, those start at 1µV offset voltage, with 100MHz amplifiers starting at 100µV.


It's strongly encouraged to use comparators, not op-amps, for comparing signals, so the only option I'm seeing is to pre-amplify my signal with a precision, high-speed op-amp, then use a comparator. However, this sounds wrong. If this is possible, then why don't chip makers offer this as a monolithic solution?



Answer



High speed with a small difference is difficult to get.


Note that not only do comparators tend to have higher input offset voltages than opamps, but also much higher effective noise, as to get high speed they are wideband beasts.


Oliver Collins produced a paper a couple of decades ago showing that you get much better results, that is less time jitter, if you precede a fast comparator with one or more low noise, low gain opamp stages, each with single pole filtering on the output, to increase the slew rate stage by stage. For any given input slew rate and final comparator, there is an optimum number of stages, gain profile, and selection of RC time constants.


This means that the initial opamps are not used as comparators, but as slope amplifiers, and consequently they do not need the output slew rate or GBW product that would be required for the final comparator.


An example is shown here, for a two stage slope amplifier. No values are given, as the optimum depends on the input slew rate. However, compared to using the output comparator alone, almost any gain profile would be an improvement. If you used for example a gain of 10, followed by a gain of 100, that would be a very reasonable place to start experimenting.


schematic


simulate this circuit – Schematic created using CircuitLab



Obviously the amplifiers will spend a lot of their time in saturation. The key to sizing the RC filters is to choose a time constant such that the time it takes the amplifier to get from saturated to mid point, at the fastest input slew rate, is doubled by the chosen RC. The time constants obviously decrease along the amplifier chain.


The RCs are shown as real filters after the opamp, not a C placed across the feedback gain resistor. This is because this filter continues the high frequency attenuation of noise at 6dB/octave to arbitrarily high frequencies, whereas a capacitor in the feedback loop stops filtering when the frequency gets to unity gain.


Note that using RC filters increases the absolute time delay between the input crossing the threshold and the output detecting it. If you want to minimise this delay, then the RCs should be omitted. However, the noise filtering afforded by the RCs allows you to get better repeatability of the delay from input to output, which manifests itself as lower jitter.


It's only the input opamp that needs high performance in terms of noise and offset voltage, the specs of all the subsequent amplifiers can be relaxed by its gain. Conversely, the first amplifier does not need as high a high slew rate or GBW as the subsequent amplifiers.


The reason that this structure isn't provided commercially is that the performance is so rarely required, and the optimum number of stages is so dependent on the input slew rate and the specifications required, that the market would be tiny and fragmented, and not worth going after. When you need this performance, it's better to build it from the blocks you can get commerically.


Here's the front of the paper, in IEEE Transactions on Communications, Vol 44, No.5 , May 1996, starting page 601, and a summary table showing what performance you get as you change the number of stages of slope amplification, and the gain distribution of the stages. You'll see from table 3 that for the specific case of wanting 1e6 slope amplification, while the performance does continue to improve above 3 stages, the bulk of the improvement has already occurred with only 3 stages.


enter image description here enter image description here


components - Ethernet Without a Switch?



How do you wire up Ethernet electrically without a switch? An approximately equivalent phrasing of this question would be what is going on electrically inside an Ethernet Hub?


To clarify, I'm not trying to connect two computers here. I'm thinking specifically of creating a small network of microcontrollers on a single board. Can it be done without a switch or a hub through just electrical connections. This would be for 10BaseT or at most 100BaseT.



Answer



Ethernet 10baseT can work with a pure hub: just connecting all the wires together suitably, with very minimal electronics. This often also requires disabling cable autodetection and things on the communicating device side for modern cards.


Ethernet 100baseT and anything even relatively modern requires an actual switch even for "hubs" - a microcontroller and each port controlled separately.


operational amplifier - How to chose the right decoupling/bypass capacitor variant for opAmp power rails?


Many experts here recommend 100nF bypass caps to the power rails of an op-amp. I made it a tradition myself that when I use any op-amp I always use 100nF decoupling cap from +Vcc to GND and -Vcc to GND.


But I also see different variants as below examples:


enter image description here


enter image description here


As you see above examples do not just use 100nF at the power rails but either RC like lowpass filters or two caps in parallel.


Does that matter which variant I use for the power rails for decoupling? Is there a principle or rule of thumb? What should be the criteria?


Note: This is a question specifically only about bypass caps at power rails of an op-amp. I couldn't find a specific satisfactory answer at related questions.




Answer



There is a difference between op-amp decoupling and, for example, logic chips decoupling.


The purpose of bypass capacitors is to provide sufficiently low impedance on power rails in the whole frequency range of the op-amp. Different types of op-amps have very different frequency range: Gain Bandwidth Product (in fact, it typically defines the bandwidth) varies from 1 MHz to 4 GHz, at least. So - decoupling of 4 GHz op-amp by 22 uF capacitors is really weird idea. They have too high impedance in GHz range. They just do nothing for decoupling. Most likely, op-amp would not be stable with such decoupling.


Decoupling requirements of more common op-amps depend on a quality of supply rails. Low inductance and low impedance rails do not need much capacitance for decoupling. You can do perfectly with 68 nF or even 47 nF. It is a good choice on 4 (or more) layers PCB with power plains.


However, on 2 layers PCB the active and reactive impedance of supply wires may be high; it may require 100 nF in parallel with few uF capacitor.


Another purpose is to filter out some AC interference or similar voltages found on supply rails. To get this effect, you need to use ferrite beads (or resistors) between the power rail and OP AMP. Resistors are not a good choice as they increase voltage drop on DC.


So the optimal bypass capacitors depend on:



  1. Gain Bandwidth Product of your OP AMP;

  2. The quality of your PCB;


  3. "Purity" of your power rails.


The basic rules are:



  1. Use small (10 nF - 68 nF) 0402 capacitors for really fast op-amps

  2. Use 68 nF - 100 nF on "normal" op-amps with reasonably good PCB design

  3. Use 68 nF - 100 nF in parallel with larger capacitors (> 2.2 uF) if the power rails are long;

  4. Use 100 nF and ferrite beads if you expect some interference from power rails;

  5. Use larger capacitors for op-amps with high output current: no less than 100 nF on 500 mA of output current.



vhdl - The timing-driven placement phase encountered an error


Could someone explain inexperienced VHDL coder what this error message trying to tell me in simple words? I found a similar question here, but here was no answer to it:


   ERROR:Place:1108 - A clock IOB / BUFGMUX clock component pair have been found
that are not placed at an optimal clock IOB / BUFGMUX site pair. The clock
IOB component is placed at site . The corresponding BUFG component
is placed at site . There is only a select set

of IOBs that can use the fast path to the Clocker buffer, and they are not
being used. You may want to analyze why this problem exists and correct it.
If this sub optimal condition is acceptable for this design, you may use the
CLOCK_DEDICATED_ROUTE constraint in the .ucf file to demote this message to a
WARNING and allow your design to continue. However, the use of this override
is highly discouraged as it may lead to very poor timing results. It is
recommended that this error condition be corrected in the design. A list of
all the COMP.PINs used in this clock placement rule is listed below. These
examples can be used directly in the .ucf file to override this clock rule.
< NET "HREF" CLOCK_DEDICATED_ROUTE = FALSE; >

ERROR:Pack:1654 - The timing-driven placement phase encountered an error.

I just want to use external HREF signal as the trigger to count lines and for some other things. Is there a better way to configure logic? Here's what I have:


ENTITY mainModule IS
PORT(
CLK160 : IN STD_LOGIC;
BUFOUT : OUT STD_LOGIC_VECTOR (11 DOWNTO 0) := (OTHERS => '0');
RESET_B : OUT STD_LOGIC := '1';
HREF : IN STD_LOGIC;
DATA_IM : IN STD_LOGIC_VECTOR (9 DOWNTO 0);

PCLK : IN STD_LOGIC;
XVCLK : OUT STD_LOGIC := '0');

END mainModule;

ARCHITECTURE BEHAVIORAL OF mainModule IS
SIGNAL CLK10 : STD_LOGIC := '0';
SIGNAL SKIP : STD_LOGIC := '0';
SIGNAL LineCounter : UNSIGNED(9 DOWNTO 0) := (OTHERS => '0');


component CLK_DIV16 is port (CLKIN : in STD_LOGIC; CLKDV : out STD_LOGIC );end component;

BEGIN
U1: CLK_DIV16 port map(CLKIN => CLK160,CLKDV => CLK10);

OUT_TEST: PROCESS(PCLK)
BEGIN
IF RISING_EDGE(PCLK) THEN
BUFOUT(9 DOWNTO 0) <= DATA_IM(9 DOWNTO 0);
ELSE NULL;

END IF;
END PROCESS OUT_TEST;

LINECOUNT: PROCESS (HREF)
BEGIN
IF RISING_EDGE(HREF) THEN
IF LineCounter > 488 THEN
LineCounter <= (OTHERS => '0');
SKIP <= NOT SKIP;
ELSE LineCounter <= LineCounter + 1;

END IF;
ELSE NULL;
END IF;
END PROCESS LINECOUNT;

BUFOUT(11) <= PCLK AND HREF AND SKIP;
XVCLK <= CLK10;

END Behavioral;

Answer




I assume from the presense of IOB and BUFGMUX and .UCF that this must be a Xilinx FPGA. Note that as I work in the industry I use Verilog, but I think I can more or less follow what's going on in the VHDL code.


Background: what is this Global Clock Distribution


Clock signals are special because they need to arrive at all of the flip-flops throughout the entire FPGA chip at exactly the same time. Here I mean routing in the actual silicon and metal of the FPGA chip, not routing in the sense of configurable logic. These are hard, metal, permanent routes. The only configurable part about these global clock routes is which external clock pin supplies the clock signal and which flip-flops listen to this clock. If the clock distribution was not carefully routed by the FPGA manufacturer, then the flip-flops that are closer to the clock pin would capture their inputs sooner than flip-flops that are placed farther away -- and the design would no longer be synchronous logic. So to make the FPGA support the use of synchronous logic throughout the entire chip, there are some special global clock routes that are dedicated to distributing a clock signal from one of the dedicated clock inputs, to every flip-flop on the entire FPGA, such that the clock edge arrives at exactly the same time at each flip-flop. (Even if your design doesn't configure the flip-flop to connect to that clock, the FPGA silicon still has to contain the route. FPGA configuration can only enable routes that are already built into the chip.)


These global clock routes are "expensive" because each one spans an entire layer of the FPGA chip, so typically there are very few of these routes on the chip. This is OK because clocking is a one-to-many relationship (one clock driving many flip-flops), most designs use only 1 or 2 clocks anyway. And, typical HDL designs use recognizable synchronous logic constructs, like state machines. The HDL compiler can recognize a state machine or a bunch of flip-flops that share the same clock domain.


What the error message means


Xilinx requires the use of some special primitive constructs in their RTL code to route a clock signal onto these global clock routes, this is the BUFG (global clock buffer) or BUFGMUX (global clock multiplexer) that the error message references. IOB is a generic input/output buffer associated with a pin. And -- there are only a few special dedicated clock input pins (IOB) that can drive any of the global clock distribution systems (BUFGMUX). So the error message is telling you that you can't use that pin (that the HREF is assigned to) as a clock input (as the VHDL code requires).


Why the error message?


When the HDL compiler translates your VHDL source code, the synthesis tools infer from the expression RISING_EDGE(PCLK) that the PCLK input is a clock. So far, so good. But then the synthesis tools infer from the expression RISING_EDGE(HREF) that the HREF input is another clock. This is a problem. Your design doesn't really address split clock domains, clearly you intended to use HREF as a control input not a clock. And, unlike PCLK, the HREF signal is not assigned to an input pin that can receive an external clock. It's just not physically possible. The FPGA silicon chip doesn't have a configurable pathway from that particular pin's IOB to any global clock BUFG.


As your HDL code is written now, the HREF rising edge would be detected immediately, as though it was another clock signal. But then the SKIP signal is treated as if it was in the same clock domain as PCLK.


It's good to read up on the Xilinx literature about what these clock primitives are and how to use them; I recently had a project where I needed to select between an on-board clock and an optional user-supplied clock, and use with a couple of internal DCM (digital PLL sort of clock multiplier), and for that one I did have to "manually" instantiate all of the IOB and BUFGMUX and connect them "manually" because there were several clock domains of different frequencies.



For most projects you don't have to worry about any of this. As long as the synchronous logic all uses one clock ( Verilog always @(posedge clk) or VHDL RISING_EDGE(CLK)), and the clock is assigned to one of the special dedicated clock input pins, then the HDL compiler automatically determines where it needs BUFGMUX and IOB, and it silently inserts these as part of the normal synthesis. The only reason you got this error message was because your HDL code looked like it was using a clock signal that wasn't physically capable of being a clock.


What to do about it


A better approach is to modify your LINECOUNT: process to use RISING_EDGE(PCLK) so it is in the same clock domain as the rest of the design, and detect the rising edge on the HREF control input by using a flip-flop and comparing to the current HREF value. Store the previous HREF value as HREF_PREVIOUS ( I think in VHDL you use HREF_PREVIOUS <= HREF thereby inferring a flip-flop). When HREF_PREVIOUS is 0 and HREF is 1, then you have detected the rising edge during that PCLK clock cycle -- and can trigger the LineCounter action and determine the next value of SKIP.


As a control input rather than a second clock, the HREF control input cannot be faster than PCLK, or else it will not be reliably detectable. This design assumes that the master clock PCLK is the fastest timing signal.


What if you really meant to use two clocks?


If in the future you do have a design that really does require splitting the logic across multiple clock domains, the usual technique for sending signals across the clock domain split involves a chain of 3 flip-flops (one in the source clock domain followed by two in the destination clock domain), to try to avoid metastable operation. Again, I don't think that's what you're trying to do here.


What NOT to do about it


If you really really really want the HDL compiler to route a clock signal (badly) from that HREF pin (which is physically impossible to connect to the FPGA's internal global clock distribution system), to drive a flip-flop (from some random signal instead of the usual global clock system), the error message text you posted does tell you how to override the error message. In your project's .ucf file (User Configuration File), you would add the CLOCK_DEDICATED_ROUTE attribute. (Note Xilinx .UCF is only for the older ISE and XST tool; Vivado has a different kind of constraint system.) And the performance would not be very good, so you'd have to keep everything at a slower clock speed to allow everything more time to settle. Really though that's probably a bad way to hack, unless you understand what's going on at the level of the FPGA primitive elements. (Technique would be OK if you were building a massive ripple counter using all of the flip-flops... but again, why would be trying to build a crummy ripple counter.) On balance, it's usually easier to write clean HDL code that synthesizes what you want, instead of trying to force a bad solution.


More tips


I notice this code is written as Behavioral... which is OK, but just remember that this is a Hardware Description Language, not a C compiler. If you want to successfully design code that can be synthesized, always keep in mind what the actual hardware is that you're describing. I come from a background of 25+ years as a C programmer, and it's a constant struggle for me to see the HDL code in terms of the actual hardware. Structural description (wiring connection) is closer to what will actually be synthesized. The synthesis tools can usually recognize what is intended from a behavioral description if you stick with commonly used forms, but it's very easy to confuse the synthesis tools and end up describing something that can't be built.



Get in the habit of skimming through the reams of output that the HDL compiler generates. It can be a bit overwhelming at first, but since you're starting with some small entry-level teaching circuits, it should be manageable. Xilinx ISE lets you view the RTL code post-synthesis, this is a good way to check that nothing important is left out. (I once had an error in a verilog initial block that only triggered a warning message, not an error... but it made the output of that module constant 0. And so that module was silently trimmed out because it had become a do-nothing module. And everything else that used that module got trimmed out too. Spent nearly a day trying to figure out why my custom SPI interface wasn't driving any output, then looked at RTL schematic and there was no SPI output pin. The actual output pin just wasn't being driven by any active HDL code. Almost half of my design was silently ripped out and trashed, all because of one little warning message.)


Sunday 23 September 2018

How can I detect a power outage with a microcontroller?


I have the following power supply configuration: AC MAINS -> UPS -> 24V POWER SUPPLY -> 5V VOLTAGE REGULATOR -> PCB (microcontroller). What's the best solution to detect the power outage on the mains with the microcontroller? I also need to detect the zero-crossing so that I can control the speed of an AC motor.




Answer



Since you also need the zero-crossing you'll get the power outage detection virtually for free.
Best is to use an optocoupler to detect zero-crossings. Put the mains voltage via high resistance resistors to the input of the optocoupler. Vishay's SFH6206 has two LEDs in anti-parallel, so it works over the full cycle of the mains voltage.


enter image description here


If the input voltage is high enough the output transistor is switched on, and the collector is at a low level. Around the zero crossing, however, the input voltage is too low to activate the output transistor and its collector will be pulled high. So you get a positive pulse at every zero crossing. The pulse width depends on the LEDs' current. Never mind if it's more than 10% duty cycle (1ms at 50Hz). It will be symmetrical about the actual zero-crossing, so the exact point is in the middle of the pulse.


To detect power outages you (re)start a timer on every zero-crossing, with a timeout at 2.5 half cycles. Best practice is to let the pulse generate an interrupt. As long as the power is present the timer will be restarted every half cycle and never time out. Upon a power outage however, it will timeout after a bit longer than a cycle, and you can take the appropriate action. (The timeout value is longer than 2 half cycles, so that a spike on 1 zero-crossing causing a missed pulse won't give you a false warning.)
If you create a software timer it won't cost you anything, but you can also use a retriggerable monostable multivibrator (MMV), for instance with an LM555.


note: depending on your mains voltage and the resistor type you may need to place two resistors in series for the optocoupler, because the high voltage may cause a single resistor to breakdown. For 230V AC I've used three 1206 resistors in series for this.




Q & A time! (from comments, this is extra, in case you want more)



Q: And the input LEDs of the optocoupler will work at 230V? The datasheet states that the forward voltage is 1.65V.
A: Like for a common diode the voltage over a LED is more or less constant, no matter what your supply voltage is. The mandatory series resistor will take the voltage difference between power supply and LED voltage. The answers to this question explain how to calculate the resistor's value. Extreme example: a 10 000V power supply for a 2V LED. Voltage over the resistor: 10 000V - 2V = 9 998V. You want 20mA? Then the resistor is \$\frac{9 998V}{20mA}\$ = 499.9k\$\Omega\$. That's 500k, that's even reasonable. Yet, you can't use an ordinary resistor here. Why not? Firstly, a common 1/4W PTH resistor is rated at 250V, and will definitely breakdown at 10 000V, so you'll have to use 40 resistors in series to distribute the high voltage. Secondly, and worse, the power that the resistor would have to dissipate is \$P = V \times I = 9 998V \times 20mA = 199.96W\$, a lot more than the rated 1/4W. So to cope with the power we'll even need 800 resistors. OK, 10kV is extreme, but the example shows that you can use any voltage for a LED, so 230V is also possible. It's just a matter of using enough and the right type of resistors.


Q: How does the reverse voltage affect the lifetime of the LEDs?
A: The second, anti-parallel LED takes care of that by ensuring that the reverse voltage over the other LED can't become higher than its own forward voltage. And that's a good thing, because a reverse voltage of 325V\$_P\$ would kill any LED (most likely explode), just like any signal diode, by the way. The best way to protect it is a diode in anti-parallel.


Q: Won't the resistors dissipate a lot of heat?
A: Well, let's see. If we assume 1mA through the resistors and ignore the LED voltage, we have \$P = V \times I = 230V_{RMS} \times 1mA = 230mW\$, so even a 1206 can handle that. And remember, we're using more than 1 resistor, so we're safe if we can work with 1mA (The SFH6206 has a high CTR \$-\$ Current Transfer Ratio).


resonant converter - What is the use of transformers with 3 pairs of wires?


I found a device which has a ferrite core and 3 coils on it. It looks like some type of transformer. What would be its use? I found it in a compact fluorescent lamp.



Answer



You are looking at the transformer of a very elegant and basic resonant converter (a.k.a. Royer converter).


A very basic explanation is this: There are two windings with an equal number of turns that are used to drive two transistors, and there is one winding that connects to the lamp. During each switching cycle, at a certain current, determined by the core material and the number of turns of the winding that goes to the lamp, the transformer will saturate and thereby define the power that is transferred to the lamp. Each time a saturation event occurs, one transistor will block and the other transistor will start to conduct, which keeps the circuit oscillating.


The Royer converter was invented long before switch-mode power supplies were the norm for power conversion circuits and is still very popular. Considering its age, it is amazing that efficiencies of > 85 % can be achieved easily.


A good application note with many details can be found here: http://www.nxp.com/documents/application_note/AN00048.pdf.


There is also an article on Wikipedia: http://en.wikipedia.org/wiki/CCFL_inverter


Another good App'note: http://www.diodes.com/zetex/_pdfs/3.0/appnotes/apps/an14.pdf



Here's a good manual about fixing compact flourescent lamps (CFLs). It includes many schematics: http://www.en-genius.net/includes/files/col_081307.pdf


The original reference to the circuit is here: Bright, Pittman and Royer, “Transistors As On-Off Switches in Saturable Core Circuits,” Electrical Manufacturing, December 1954.


resistance - Anti-static bags - safe to support powered circuit boards?


Is it generally safe to rest a low voltage powered up circuit board on an anti-static bag when debugging? A simple meter reading suggests it is a good insulator, but it must conduct to some extent?


Ditto on anti-static mat on the workbench




Answer



There are different bags available. Some of them are insulators (nearly, see below) and only prevent the build-up of static charge. Others are conducting (grey-metallic ones typically or black ones).


I wouldn't place any powered electronics on conducting anti-static bags or mats. Even the fairly high resistance can have a big influence on the electronics (depending on function and design).


Low powered stuff often works with fairly high resistance values, so the effect of parallel resistance there is quite profound.


I often use a sheet of paper to put my circuit boards on (note it can be charged, so make sure to wipe the charges off). Or just a holder where you clamp it from both sides so the main area has no contact at all (like when it is installed somewhere).




Update:


I'm not an expert on ESD and anti-static materials, let me try anyway:


Materials are divided into different classes depending on their sheet resistance (Ohms per square):




  • \$10^{13}\$ and greater: insulators and basic plastics

  • \$10^{9}\$-\$10^{12}\$: anti-static

  • \$10^{5}\$-\$10^{9}\$: dissipative

  • \$10^{3}\$-\$10^{5}\$: conductive


Everything below that doesn't belong in the field of ESD anymore. So the insulators and basic plastics are not able in any way to let charges move on their surface or through them. If they get charged, the charge stays there until it is dissipated in some way (discharge on you or an IC, in humid air it will decrease over time).


Anti-static materials have still a very high resistivity, so that you probably are not able to measure it with a normal multimeter. They are just a little bit conducting, so that the surface charge cannot build up. The triboelectric effect (charging through rubbing something etc.) is prevented. This gives a very basic protection. You can easily zap through a bag with a static discharge. These bags are usually pink in color, they are made of a pink polyethylene.


This is what I had in mind when I wrote "Some of them are insulators and only prevent the build-up of static charge." So it's not true. It's just that the resistance is very very high (gigaohm range) and unlikely to cause a problem, but if the resistivity is at the lower end of the range, it might.


I recommend watching the two videos from EEVblog: #247 and #250. Dave actually shows that the mats are not conductive enough to make problems with measurements.


One thing which is mentioned in the research is that the materials used do not behave as a simple Ohmic element, so the resistivity can be voltage dependent. The stuff gets usually tested at 500V to take that into account, but you never know.



transistors - What is the formal definition of Quiescent Point?





  • What is Quiescent Point?




  • Is it necessary for it to be related with any V vs I , I vs I, or any such characteristic curves intersection point?





Answer



The quiescent point is by definition a state of a circuit in which all the inputs (meaning voltage and current levels, but also component values and environmental conditions) are fixed.


It's generally used in circuit analysis to find the operating region of active components, such as transistor and Op-Amps, and then perform a time-based analysis using the small-signal linear approximation of the component models.


Take this circuit: enter image description here



Its behavior is dynamic, as it will depend on the value of the two input voltages, but if these values are fixed, it's possible to determine the status of all the nodes and then eventually perform an analysis for small perturbations of this quiescent state.


The curves you are talking about, are the representation of many quiescent points given by the variation of a parameter, which may be the value of a component, of a signal, or even an environmental parameter, such as the temperature. It will tell what to expect from the component under a specified biasing condition, and are often (if not always) found in datasheets.


Saturday 22 September 2018

switches - how can i switch sim card clock signal line betweem two sim cards?


2 simcard clk switch


My setup is as on png above, I am using sim800L gsm module, by trial and error i discovered that i can connect sim pins: (rst,gnd,io and clk) and the module detects and connect to GSM without connecting power to sim vcc pin, i also read that sim vcc is optional.


what i want to do is somehow switch clk signal so that one sim card is detected by module at a time, i can do it with manual switch but how can i do it with electrical switch?. pls help.




Doppler shift velocity sensor


Any reasonable priced (sub 20$/100) ways to directly measure indoors velocities between around 0.1 and 15m/s?


Its main purpose would be to reduce speed drift for a 9DOF device (acc/gyro,magnetometer), so I believe only 1D will do.


Now since it's for indoor use, a GPS won't help. I assume this could be done measuring RF/ultrasonic doppler shift, but I don't know how this is measured, nor have I found dedicated chips to do it.



Answer



I suspect that a Gunnplexer as used in Police RADARs and in door openers prior to PIR's taking over would do what you want. Output is Doppler difference of go + motion affected return signal.


enter image description here!


A few examples:



transistors - How to hack a walkie-talkie to light up LEDs when it receives a signal


Rookie circuit-bending question: I am trying to hack a walkie-talkie to light up some LEDs when it receives a signal. I figured the easiest thing to do would be to have the LEDs light in relation to the audio signal, but I don't want to compromise the sound quality too much.


Someone on another forum suggested the following:



circuit diagram


Some explanation: 1: This is the speaker, just hook up the transistor to one of the ends of it. If one end doesn't work, try the other.


2:The transistor will be triggered by the voltage on the speaker, and charge up the capacitor. The capacitor will retain it's charge for some time while triggering the Transistor in 3. Then you can hook up whatever you want to the transistor, like an LED. You might want to use a darlington transistor (just 2 transistors cascaded like this: http://i56.tinypic.com/5nm683.png ).


You will have to play around with the values for the capacitor and the right resistor, but something along the uF range and 1-10 kOhm should do the trick. The resistor on the transistor at 1 should be rather more than less if you don't want to impact the sound quality too much, so also something along the 10 kOhm range.




I tried this out, but no luck.


EDIT: I tested the + to - leads on the speaker. When it is making a sound, it goes up to about 30V AC.


I also tried variations on the circuit below.


enter image description here


It is not lighting up the LED.


I read on this Transistor Circuits page that transistors require .7V between B and E to switch on. As shown in the color sketch, the voltage measured is much lower than that.


I'm not sure where to go from here. I assume I just need to increase the voltage between B and E on the transistor, but how?



Answer



Longish comment:


The circuit in the first schematic won't work: none of the transistor pins is connected to a supply, so it will just connect the capacitors together, but without any appreciable effect. Also, with one wire only you are not picking any signal.



Also, instead of randomly pick wires from the speaker, if you have a multimeter you'd better measure the signals (set for AC) to understand where you get the signal; and connect the ground of the speaker to the ground of your circuit, otherwise you'll pick up only noise.


In the circuit you hooked up, the collector seems to be connected to the supply (+5), but it's quite hard to read: could you make a schematic of your connection? There are several tools available, but if you use Falstad, you can also try to simulate it and have an idea about if it can work.


Update:


Neither this circuit is likely to work: you have a too small drop over the base-emitter junction of the transistor. The most common configuration is the common emitter, where you place the speaker (eventually with a resistance to provide the right biasing current) to the base-emitter junction of the transistor, and then the LED with a limiting resistor between the 5V supply and the collector.


Something like this may work:


enter image description here


You have to set the right base resistor depending on the voltage of the speaker and the sensitivity that you want for the blinker. You may also use a potentiometer, to set it dinamically, but be sure to check the maximum ratings for the transistor.


Bypass capacitor vs low-pass filter


i'm trying to get my head round two intermingling factors relating primarily to an rc low pass filter and bypass capacitors for providing a low impedance path for high frequency AC signals, essentially filtering them out.


I was initially confused by the need of a resistor within an RC filter. But the following picture explains how the input port matches the output port. (Actually taken from another stackexchange question)



RC Filter


But then looking at bypass capacitors: bypass capacitor


I understand these can provide voltage if it dips, but i have not found a reasonable explanation as to why an rc filter requires the resistor but a bypass capacitor can take out high frequency signals without one? Essentially filtering, low pass filtering?



Answer



All filters are voltage dividers, with Zin and Zshunt. Sometimes the Zin is hidden, or just part of the wiring. In an RC LowPass, we have the R*C timeconstant; invert that to find radians/second at the 0.707 halfpower point (also the -3dB, 45 degree phaseshift point); divide that by 2*pi and you have frequency in Hertz.


Thus the RC filter gives predictable corner frequency; 1MegOhm and 1uF is 1second tau, 1 radian/second frequency, and 0.16 cycle-per-second (Hertz).


Another valuable feature of RC filters is the built-in dampening. Our circuits always have inductance; my default rule-of-thumb is 1nanoHenry/millimeter for wire or skinny PCB trace over air. If wire scotch-taped atop a metal sheet, or PCB trace over GND/VDD plane, I use 100 picoHenry/millimeter.


Our capacitors always have some inductance; any non-zero length of circuit has some inductance; hence every capacitor has the L+C to ring; we should think about dampening that ringing, with resistive losses R = sqrt(L/C).


We often place two capacitors in parallel for VDD bypassing; we have just formed a PI resonator, with peaks and nulls of filtering. Examine this simulation, with 10 milliVolts (typical ripple levels) into a CLC PI filter; C1 = 100uF; L is PCB inductance of 10nH; C2 = 0.1uF; the source includes 100nH (4" wiring) and 1milliOhm. The rightmost 3 stages show the ideal C_L_C, and are de-selected from the simulation; right after the source are the CLC used in the simulation, checked to be active. Note the horrific peaks and nulls in the bottom plot of frequency response.


How can we have such peaks and nulls? Because all resistors (in source, in each cap of value 100uF and 0.1uF, and in the top middle PCB inductance) are only 0.001 Ohm.



What does the peaking do? We have 23dB peaking at 50KHz, or 140 milliVolts of ringing. We have 26dB peaking at 3MHz, or 200 milliVolts of ringing. Unfortunately, 3MHz is near SwitchReg clocking and ringing frequencies.


enter image description here


Lets increase the resistors (in 10mV voltage source; in cap#1 100uF, in top middle PCB inductance, in cap#2) to 10 milliohm. Here is our BODE:


enter image description here


We STILL have no filtering at 3MHz. What to do? We need to dampen that 3MHz peak. Lets increase the top middle Resistance from 0.010 to 0.100 ohms;


enter image description here


Some attenuation (-10dB, or 0.316X). Can we improve this? Lets compute!


Using sqrt(L/C) as sqrt( (10+10+10nH) / 100nF) = sqrt(30/100) = sqrt(0.3) = 0.55 ohm, we increase top middle R to 0.55 Ohm:


enter image description here


What is the final circuit?



schematic


simulate this circuit – Schematic created using CircuitLab


But there is more. Lets use many 0.1UF, and place 0.55 ohm in series with some.


enter image description here


Thus the final final circuit has NO series R in VDD line, preserving VDD headroom, but does dampen.


schematic


simulate this circuit


Notice we've done nothing to improve the low frequency filtering: 60Hz, 120hz. (1) Large R and C are needed, using up the headroom of VDD and making OpAmp VDD vary as the load current varies. (2) LDOs help with 60/120 but add their own ThermalNoise (some inject a millivolt of random noise between DC and 100KHz; others inject just a microvolt but have high Iddq; LDOs also fail at high frequencies because the PSRR(1MHz) is near 0dB just like many OpAmps. (3) Use inductors, large inductors, in the VDD path. Instead of the 100nanoHenry, use 100milliHenry.


Another way to provide dampening brings Ferrite Beads into the schematic; these require low or moderate current levels to remain effective; at 3MHz or 30MHz, consider a bead. Examine the loss-level (the "resistance") and test in with your capacitor(s) of choice. Watch out for temperature effects. (This is why I suggest Resistors for dampening.)


Summary: for high-precision and high-SNR measurements, you must also design the VDD networks. For high-gain, with multiple OpAmps sharing a supply, you must now design a VDD Tree, to avoid feedback and oscillation or delayed settling.



arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...