Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Why use watchdog variable timer

Most of the embedded microcontrollers contain watchdog timers. The watchdog variable timer is literally watchdog. The watchdog timer continuously inspects the program flow. Basically, if the microcontroller program hangs, then the watchdog timer resets it and brings the embedded system back to life. The idea is elementary. Let’s say, you know, that your program has to be executed during 20ms. And you know that the worst-case scenario is 30ms. Then you set the watchdog variable timer connected to the highest priority interrupt RESET. Once the Watchdog timer is triggered, the timer counts up to the time you set, and then it resets the MCU. The only way to avoid resetting is to send a command to the watchdog timer to start counting. Technically watchdog variable timer is nothing more than a retriggerable one-shot multivibrator.

Continue reading

Always read newest datasheets

Reading of datasheets is or should be an important part of designing electronic devices. Reading datasheets is necessary for writing device requirements, planning budget, and selecting suitable components. Datasheets of each component may be found in manufacturers website. Once you’ve selected a suitable component, be sure that you read the datasheet and understand everything in it. Otherwise, you may miss some critical parts that could ruin all your plans. It is better to find errors before you start designing than after. Another important issue is that always check for newest datasheets and errata – datasheet bug lists. It is not good practice to use your old datasheets from your hard drive archive or other places. These datasheets may contain bugs. Just download the newest microcontroller or other semiconductor datasheet and compare to yours downloaded let’s say a year ago. Errata’s and datasheet changes are usually listed at the end of the datasheet. You may look at this and find out what would you miss with old datasheets. The electric characteristics maybe are the same, but there may be configuration bugs or even discovered bugs in hardware and proposed workarounds to avoid them. So be critical and don’t rely blindly on…

Continue reading

How to read electronic circuits

In electronic circuit drawings, there are two types of objects: component symbols and nets. Nets represent wires connecting the components – which represent physical devices. In the example below, we see component type MAX3232. U2 is a reference label of a component. Electronic component usually has pins. Pins always have their numbers starting from 1. Pins also have their names. They are usually written inside component blocks like C1+. For this particular component, we used the U2 label. U (or IC) label applies to all semiconductors. But you know that resistors usually are labeled as R1, R3. Capacitors C1, C2, Diodes – D1, D2, Transistors Q1, Q2, Crystals – X1, X2, X3, Jumpers J1, J2, J3, Inductors L1, L2.

Continue reading

Tradeoff between DC motors and stepper motors

103-546-5342 steper motor

This is a small comparison made between three types of motors: DC motors and stepper motors. Let’s see what their cons and pros are: Stepper motors don’t require feedback to determine position. The microcontroller determines the position by sending pulses to stepper motor; When the load is too high to the stepper motor, then it may stall, and there is no way to report this to the microcontroller; DC motors with feedback can report stalls on high loads or other conditions; Stepper motor has no brushes – there is no EMI; Stepper motor may produce full torque – this enables them to hold the rotor in the desired position; DC motors deliver more torque at higher speeds than stepper motors; Stepper motors can produce low speed without loss of torque. Dc motors lose torque at low speed because of low current;

Continue reading

7805 voltage regulator for your design

This is the most common voltage regulator that is still used in embedded designs. The LM7805 voltage regulator is a linear regulator made by several manufacturers like Fairchild or ST Microelectronics. They can come in several types of packages. For output current up to 1A, there may be two types of packages: TO-220 (vertical) and D-PAK (horizontal). With a proper heat sink, these LM78xx types can handle even more than 1A current. They also have Thermal overload protection, Short circuit protection.

Continue reading

Understanding Timing diagrams of digital systems

Timing diagrams are the main key in understanding digital systems. Timing diagrams explain digital circuitry functioning during time flow. Timing diagrams help to understand how digital circuits or sub-circuits should work or fit into a larger circuit system. So learning how to read Timing diagrams may increase your work with digital systems and integrate them. Bellow is a list o most commonly used timing diagram fragments: Low level to supply voltage:

Continue reading

Control motor PWM schematic

In general, there are two ways to control DC motor speed: by varying supply voltage and pulse width modulation (PWM). The first control method is not convenient, especially in digital systems. It requires analog circuitry, and so on. The second motor speed control method is very convenient for digital systems because all control is made using only digital signals. As you already know, PWM (Pulse Width Modulation) is all about switching speed and pulse width (duty cycle). Duty cycle is the ratio of signal time ON/T. T is the period of the signal. In the above diagram, you see two signals. The first duty cycle is about t1/T=1/3, and another’s duty cycle would be about t2/T=2/3. And notice the period of signals are the same.

Continue reading

Small note on how to start LCD in 4 bit mode

When LCD is working in 4 bit mode, then data has to be sent by nibbles – portions of 4 bits. Just remember that first goes high nibble then follows lower one. Each nibble has to be strobed with control signal E separately. Following list is describing how to start LCD in 4 bit mode: Wait for 15 ms after power is switched on; Write 00000011 (0x03) to LCD; Wait for 5 ms; Write 00000011 (0x03) to LCD; Wait for 160 us; Write 00000011 (0x03) to LCD; Wait for 160 us; Write 00000010 to enable 4 bit mode (after this command start sending in nibbles); Set interface length; Turn off display (0x00 and 0x08 nibbles); Write 00000001 (0x00 and 0x01 in nibbles) to clear display; Set cursor move direction by setting cursor bits; Enable display; After initialization is complete you may write any character or command to it.

Continue reading

Power sources for AVR

Power sources for AVR microcontrollers are a crucial part. Every circuit has to be powered from some source like a battery or AC adapter 110V/220V. Using batteries is a more convenient way to power the microcontroller projects as the circuits are simpler and constructed devices become portable. There are many types of batteries in shapes and sizes or capacities. So when choosing a battery you should consider many factors: Capacity is a critical parameter measured in mA/h. This parameter defines how long your microcontroller project will be working before recharging or replacing batteries. The rule is simple – as bigger battery capacity, as long your circuit will be working. Still, on the other hand, your project may become more expensive or even heavier because of bigger batteries. The second parameter is the battery Voltage. If the battery’s voltage is too small for your circuit, you’ll have to connect several batteries in series. Another is the Expiry date. You don’t want your battery energy leakage or become obsolete because of this. Working temperature. If your project is working in more extreme temperatures – heat or cold, you should consider this. And the last parameter would be chape, size, and weight. If…

Continue reading

Consider PWM signal

When using a microcontroller and want to drive motor control or controlled intensity, you can use DAC to generate an analog output voltage. But there is an easier way of doing this. You can use a digital output to reach the same results. This technique is known as PWM -Pulse Width Modulation. In this picture, you can see a 50% duty cycle square waveform. The width of ‘0’ is equal to the ‘1’ level. This means if the signal amplitude is 5V, then the average voltage over one cycle is 2.5V. It is as though of hawing constant 2.5V voltage.

Continue reading