ZVS: In a quasi-resonant zero-current/zero-voltage switch (ZCS/ZVS) “each switch cycle delivers a quantized ‘packet’ of energy to the converter output, and switch turn-on and turn-off occurs at zero current and voltage, resulting in an essentially lossless switch.”[32] Quasi-resonant switching, also known as valley switching, reduces EMI in the power supply.

TBU: Its a tradename of Transient Blocking Unit (TBU™) Electronic Current Limiter designed by bournes. TBU technology is designed to block a transient through a current disconnecting mechanism rather than diverting or shunting the surge to ground. This blocking technology virtually eliminates latency in the circuit protection design which results in surge protection for sensitive electronic equipment within nanoseconds.

AFE: Analog Front End

AMR: Automatic meter reading

APD: Avalanche Photo Diodes

BIST: Built-in self-test.

Baseline: The electrical signal from a sensor when no measured variable is present. Often referred to the output at no-load condition.

Beyond-the-Rails: Beyond-the-Rails™ Maxim’s name for a feature of an IC that can process inputs and provide output voltages that exceed the supply rails. The feature is achieved through on-chip integration of necessary supply rails.

I have been using avr microcontrollers for last 1 year but never faced this problem. Yesterday I was trying to connect a Arduino mini pro with a USB-Serial interface(supplied by Decagon, DevName DecagonUCA, Chip:Silabs CP2024).  I have used this same device in same configuration several times in last 3/4 months.

But only change in code yesterday was that i was throwing some data continuously as the chip powers up. The Operating System (Win7) detects a new device Microsoft serial ballpoint. Now this makes two problems.

  1. The new device uses the serial port you are using. Makes it busy so you can’t use it.
  2. The device assumes the sensor readings you are sending as mouse pointer positions, so it moves the pointer randomly(assuming your data is random) and creates mouse clicks. Now you can’t uninstall the device as your mouse pointer is not in your control.

I removed the USBSerial cable and searched the name of the driver installed, google displayed a number of forum users complaining about this problem. https://www.google.co.in/search?q=microsoft+serial+ballpoint Most of the users are using USB GPS device. I guess any device which continously sends alpha numeric data confused as serial ballpoint. Anyway i want to know what is the actual serial ballpoint protocol

———————————–Serial BallPoint Protocol Start——————————————————–

The old MicroSoft serial mouse, while no longer in general use, can be employed to provide a low cost input device, for example, coupling the internal mechanism to other moving objects. The serial protocol for the mouse is 1200 baud, 7 bit, 1 stop bit, no parity. Every time the mouse changes state (moved or button pressed) a three byte “packet” is sent to the serial interface. For reasons known only to the engineers, the data is arranged as follows, most notably the two high order bits for the x and y coordinates share the first byte with the button status.
D6 D5 D4 D3 D2 D1 D0
1st   byte  1  LB  RB  Y7  Y6 X7 X6
2nd byte  0  X5  X4  X3 X2 X1 X0
3rd  byte  0  Y5  Y4  Y3  Y2 Y1 Y0
LB is the state of the left button, 1 = pressed, 0 = released.
RB is the state of the right button, 1 = pressed, 0 = released
X0-7 is movement of the mouse in the X direction since the last packet. Positive movement is toward the right.
Y0-7 is movement of the mouse in the Y direction since the last packet. Positive movement is back, toward the user.
Sample C code to decode three bytes from the mouse passed in “s”, the button and position (x,y) are returned.

s should consist of 3 bytes from the mouse
void DecodeMouse(unsigned char *s,int *button,int *x,int *y)
*button = ‘n’; /* No button – should only happen on an error */
if ((s[0] & 0x20) != 0)
*button = ‘l’;
else if ((s[0] & 0x10) != 0)
*button = ‘r’;
*x = (s[0] & 0x03) * 64 + (s[1] & 0x3F);
if (*x > 127)
*x = *x – 256;
*y = (s[0] & 0x0C) * 16 + (s[2] & 0x3F);
if (*y > 127)
*y = *y – 256;


  • http://paulbourke.net/dataformats/serialmouse/
  • Alternative: https://www.kryslix.com/nsfaq/Q.12.html

———————————–Serial BallPoint Protocol End——————————————–

Solution 1, (NoSerialMice):

  1. To disable the detection of devices on COM ports in Windows NT/2000/XP: Go to: My Computer – Right Click – Properties | Advanced tab | Startup and Recovery – Settings | Edit. Make a backup copy of the Boot.ini file, (copy and paste in another location)
  2. Remove the hidden, system, and read-only attributes from the Boot.ini file. (Use Windows Explorer and right click on file, then properties.)
  3. Using a text editor (such as Notepad) open the Boot.ini file.(Double click on file, or right click and choose Notepad from the “Open With” option.)
  4. Add “/NoSerialMice” to the end of each entry in the [operating systems] section of Boot.ini. See the example below for more information
  5. Save Boot.ini and quit Notepad
  6. Shutdown and restart Windows

NOTE: The /NoSerialMice option is not case sensitive.

Solution  2: Disable serial mouse

You can disable serial mouse when its connected, but mostly in this type problem the mouse pointer keeps oscillating randomly so you can’t choose the device manager or disable the device.

Drivers in desktop operating systems are not so simple as the embedded drivers, some times it take hours to solve the driver issues specially with the USB Debuggers.

Few Days back i was using arduino for low power applications, so excluded all the supporting components like programmers, UART link and used AVR ISP MkII for programming. But  arduino(open source program) use libusb(opensource) where as avrstudio(copyrighted) use jungo(propietory) for usb interface. And this needs the mkII driver to be changed to libusb. mkii will be a libusb device and in device manager it will show under libusb class. Here is some supporting link




Now if i want to revert back to old driver, i tried to uninstall and delete the mkII driver(libusb), then reinstalled avrstudio again. But nothing happened. No driver found for mkII.

Now i found this blog with similar issue, they were using a debugger from freescale using jungo based usb driver changed to libusb. The part i was missing is jungo deiver install. In device manager there should be component “Jungo driver” permanently in the list whether any debugger attached to port or not. I got the location of the driver in “C:\Program Files (x86)\Atmel\AVR Tools\usb64” mine is 64 bit OS it may be usb for x86

Now another trick about how to install the driver, right click computer name in device manger then choose “add legacy hardware”. Select manually find the driver select all driver(dont srelect any specific) now choose “have a disk” . Now show the path to the folder containing windrv6.sys now it will install Jungo windriver. Now if you have avr studio installed plugin the programmer mkII, it will automatically install the mkII driver.


These diodes are not like normal Light Emitting diodes (LEDS), these diodes can use all the available power if not controlled. So it need to be attached to a current controlled DC source.

The Laser Diode(LD) module contains an Photo diode inbuilt, which monitors the output light intensity and used as a feedback for the control circuits. The terminals from laser diode are

  1. Laser Diode Cathode (LDA)
  2. Photo diode Anode (PDA)
  3. COMMON Positive


This is a simple description of cheapKeyChain Lasers that are sold for 5 bucks or so.The laser diode head has three pins labeled: LDC (Laser Diode Cathode), PDA (Photo Diode Anode) and COM+ (common Positive Terminal).Inside the laser diode head we find the laser diode itself and a photodiode, used to regulate the laser diode current with an external feedback loop.


A Schematic from MAXIM










With increasing popularity of battery powered portable devices microcontroller manufacturers started making the controllers more efficient for the specific purpose. For battery powered devices the most important and common parameter is the power consumption. There are some applications like remote weather loggers which run for years with a set of AA batteries, which needs average power consumption to be in nano amps.

To accomplish these power consumption levels the manufacturers introduced a new feature with different names, Microchips Nanowatt, Texas Instruments MSP430 series and from my favourite atmel its Picopower. All these techniques may work differently but the objective is same.

Atmels AVR 8bit has the following 6 Modes

  • Idle
  • ADC Noise Reduction
  • Power save
  • Power Down
  • StandBy
  • Extended Standby



sleep modes in 8 bit AVR


For the New controllers with PINChange interrupt the following table(Pinchange added as a wake up source)

for the controllers with pinchange interrupt

for the controllers with pinchange interrupt

Now what about the coding,

There are inbuilt functions for all the related job in WinAVR, so you can use the same in AVR Studio or Arduino. There are few arduino libraries e.g.  jeelib (github.com/jcw/jeelib)  for arduino based on the winavr functions, but i think the base winavr functions are best.

just include <avr/power.h> and <avr/sleep.h>

avr/sleep.h includes macros set_sleep_mode(MODE), sleep_enable(), sleep_disable(), sleep_cpu().

#define sleep_enable() \
do { \
} while(0)
#define sleep_disable() \
do { \
} while(0)
#define sleep_cpu() \
do { \
__asm__ __volatile__ ( sleep \n\t :: ); \
} while(0)


#define sleep_mode() \
do { \
sleep_enable(); \
sleep_cpu(); \
sleep_disable(); \
} while (0)


and avr/power.h includes functions for disabling peripherals. function to enable each peripheral,  function to disable each peripheral, function for disabling all, function to enable all.

in simple codes


#include <avr/sleep.h>

….code lines…




these above two lines are enough to make a device sleep.

but before going to sleep you must enable interrupt and a method for wake-up from sleep mode, additionally you can disable the brownout detector (for least power consumption) in run time from the codes, but this functionality is available for some specific chips in pico series although you can disable it outside of the code by setting the fuse bits.

Example code

#include <avr/interrupt.h>
#include <avr/sleep.h>
if (some_condition)
However arduino people found a bug in the above code, if u r planning to wake up through a interrupt, and normal case we dettach the interrupt in the ISR, so if the interrupt is triggered before the system goes to sleep, the system will sleep without a wakeup hook. So modified the code as below. They modified the sequence and added disable_sleep in ISR which will inhibit the previous case.
attachInterrupt(0, pin2_isr, LOW);
/* 0, 1, or many lines of code here */
/* wake up here */
void pin2_isr()
pin2_interrupt_flag = 1;


Interrupt is neither same  for all hardware’s nor for the compilers. Some hardwares support multi level interrupt or nested interrupt and some chips use single interrupt flag. The Atmel architecture interrupt works as following

1. As Interrupt triggered processor finishes pending instruction

2. Stops fetching further instruction

3. Clear Global interrupt enable bit(This is why arduino denies nested interrupt, but you can use)

4.  Push PC(program counter) on stack

5. Jump to interrupt vector(specific address where the corresponding interrupt handler expected to be)

6. Next is the ISR code in case of C compiler do a lot job for you and if you are using assembly all that have to do youself.

Push the status register to stack and also any other register that you may use in this ISR block

Execute the actual ISR handler code i.e. whatever you want to do when the specific interrupt occours

When the actual task is done, rollback the things you changed i.e. POP the stack to status register and other register you had pussed

7. Now last assembly code RETI which rollback the PC from stack and Reenables Global Interrupt

So in the whole process all except the step 6 and 7 are automatic user need not worry about the steps.


ISR in C

use variables with volatile type modifier other compiler optimiser may think the varible is static(assuming not changed in main())

  • Keep the ISR code as short possible in execution time not in length.
  • Don’t activate or deactivate interrupt inside ISR
  • Don’t call another function that uses interrupt

Now the above rules are for the ideal people, you can do it if u know what the hardware and the compiler does. Suppose you have to do some of the banned things immediately after the interrupt triggered, i have to methods one is the method being ideal another is to break the rules.

A.If your main loop contains things that only run when a interrupt is triggered and interrupt are not overlapping, in this case u can set special flag to activate a part of main code (code u want to run in ISR), the flag need to set in the original ISR and cleared in main loop part of ISR.


B. Next method is really complicated. You need to mess with the hardware and the compiler, you know when interrupt occurs global interrupt enable is cleared ,PC pushed to stack by hardware and Status register and other registers moved to stack by compiler, So here

if you want to get another interrupt you have to set GIE and if interrupt occours it will again push pc and but the compiler part is complex.

Some people make multilevel interrupt with software. The main interrupt handler acts as the first interrupt handler which catches the interrupt event and stores necessary data and exit ISR(the basic isr) and start the secondary interrupt handler. exiting the fast interrupt handler triggers RETI so all interrupts resumed.


First of all the question is why IAR why not CCS or GCC, here is my answer

You are learning all these not just for fun, if it is then you may with gcc also. but if you are learning both for fun and career then you should prefer one which is used by industry, and both TI’s CCS and IAR EW costs same, so why not choose the one with multiple compilers in the Same IDE design although they sold all of them individually.

Download the installer from IAR Systems page . Now you can install this with two different modes One is code size limited version Second is full Version Time limited Licences validity. Now click Project-> Create New Project, Now you can choose the language C, C++ or assembly and for c and C++ you can choose template or project with main().

Anyway all these things are useless for geeks  like you. The real question is the headers and the libraries, where are the standard functions and MACROs, how is the C C++ standard differ from other C standards(although embedded C is always a NonStandard C).

Step 1 should be to download The Family User Guide, like if i am using MSP430F149, i should read MSP430x1xx Family User Guide i.e. www.ti.com/lit/ug/slau049f/slau049f.pdf

Default UI based project adds io430.h this includes it need you to define your chip name in define statement i.e. #define MSP430F149

But i will prefer to add the specific header file instead of these chains i.e. msp430f149.h with hardware description of the specific chip.

For delay you may use __delay_cycles(x), which gives delay of x instruction cycles, and one instruction cycles duration=(1/MCLK frequency in Hz)Seconds

Variety of capacitors available in market, some times I discover alien components on PCBs from Big companies. Some are don’t look like capacitors. Some are specific to some unique job, if u replace with another one it may not work at all like the low ESR capacitors in DC DC converters.



A ceramic capacitor is a two-terminal non-polar device. The classical ceramic capacitor is the “disc capacitor”. This device pre-dates the transistor and was used extensively in vacuum-tube equipment (e.g., radio receivers) from about 1930 through the 1950s, and in discrete transistor equipment from the 1950s through the 1980s. As of 2007, ceramic disc capacitors are in widespread use in electronic equipment, providing high capacity and small size at low price compared to other low value capacitor types.

Multilayer ceramic capacitors are increasingly used to replace tantalum and low capacitance aluminium electrolytic capacitors in applications such as bypass or high frequency switched-mode power supplies as their cost, reliability and size becomes competitive. In many applications, their low ESR allows the use of a lower nominal capacitance value



An electrolytic capacitor is a type of capacitor that uses an electrolyte (an ionic conducting liquid) as one of its plates to achieve a larger capacitance per unit volume than other types, but with performance disadvantages. All capacitors conduct alternating current (AC) and block direct current (DC) and can be used, amongst other applications, to couple circuit blocks allowing AC signals to be transferred while blocking DC power, to store energy, and to filter signals according to their frequency. The large capacitance of electrolytic capacitors makes them particularly suitable for passing or bypassing low-frequency signals and storing large amounts of energy. They are widely used in power supplies and for decoupling unwanted AC components from DC power connections.

Aluminum electrolytic capacitors are constructed from two conducting aluminum foils, one of which is coated with an insulating oxide layer, and a paper spacer soaked in electrolyte. The foil insulated by the oxide layer is the anode while the liquid electrolyte and the second foil acts as the cathode. This stack is then rolled up, fitted with pin connectors and placed in a cylindrical aluminum casing. The two most popular geometries are axial leads coming from the center of each circular face of the cylinder, or two radial leads or lugs on one of the circular faces.


Polyester film

This capacitor uses a thin polyester film as a dielectric. Not as high a tolerance as polypropylene, but cheap and handy, temperature stable, readily available, widely used. Tolerance is approx 5% to 10%. Can be quite large depending on capacity or rated voltage and so may not be suitable for all applications. Temperature stability is poorer than paper capacitors. Usable at low (AC power) frequencies, but inappropriate for RF applications due to excessive dielectric heating.







Tantalum Capacitors


Tantalum capacitors are polarised and have low voltage ratings like electrolytic capacitors. They are expensive but very small so they are used where a large capacitance is needed in a small size such as mobile phones or laptop computers. These capacitors have increasingly become an important as the demand for ever smaller electronic gadgets has grown. Columbite-tantalite – coltan, for short, the ore from which tantalum is refined is mined in Australia, Egpyt. The high demand for the ore has also financed civil wars in the Democratic Republic of the Congo. A UN security council report charged that a great deal of the ore is mined illegally and smuggled over the country’s eastern borders by militas from neighbouring Uganda, Burundi and Rwanda providing the revenue to finance the military occupation of the Congo.


Metalized Polyster Film

No polarity, dielectric made of Polyester or DuPont trade name “Mylar”. Good quality, low drift, temperature stable. Because the electrodes are thin they can be made very very small. Good all-round capacitor.Care is necessary, because the component lead easily breaks off from these capacitors. Once lead has come off, there is no way to fix it. It must be discarded.





Polystyrene capacitors


No polarity, is used as a dielectric. Constructed like a coil inside so not suitable for high frequency applications. Well used in filter circuits or timing applications using a couple hundred KHz or less. Electrodes may be reddish of color because of copper leaf used or silver when aluminum foil is used for electrodes.

Excellent general purpose plastic film capacitor. Excellent stability, low moisture pick-up and a slightly negative temperature coefficient that can be used to match the positive temperature co-efficient of other components. Ideal for low power RF and precision analog applications







MICA Capacitors

This type is an extremely accurate device with very low leakage currents. It is constructed with alternate layers of metal foil and mica insulation, stacked and encapsulated. These capacitors have small capacitances and are often used in high frequency circuits (eg. : RF circuits). They are very stable under variable voltage and temperature conditions. Tolerances range from +/-0.25 to +/-5 percent. Capacitances range from 1 pf to 0.01 uF, with maximum voltage ratings from 100 V to 2.5 k

Have you ever thought about this, Unlike humans they have more options than us, they can Sleep, Standby, Hibernate, Restart and the last one Shutdown !! !

These things is available at both softaware (OS) level and hardware level. In your desktop or laptop u must have used all these options

In this article I will explain both for general computer user and the embedded developers.

In Operating Systems:

Lets first see what happens in MS Windows OS.

StandBy: This option sets the screen off and harddisk stops. All other services continues except those dedicated to the user.

Sleep: This is a bit more than standby useful for power saving. This stops the hard disk, switch off the screen, switch off most of the parts and sets the clock speed low so as to lower power consumption.

Hibernate: Hibernate its very useful if u need your system to start from the last files u r working with as it is, and quick mode. What it does is

As you click hibernate it saves all the Data in RAM into a file Hiberfile.sys (which has size same as RAM size) and write an extra line in the Master Boot Record.

Next you start your PC it starts from MBR as normal but the extra line written in the previous session tells the system that it was hibernated in the previous session. So it searches for hyberfile.sys and loads that data onto RAM, while showing a screen message System Resuming ….

N.B.:There was a similar option in RHEL linux which was very similar to hibernate but not same in bachground. It saves all the session information(which files opened what edited….) and on next start it resumes according to that data, so it is a bit slower and some processes like games videos will not supports this.


In Microcontrollers and Microprocessors:

After dinner…. wait


Wings as temperature sensor

Nanostructured Wings as temperature sensor

Many of the shimmering colors in a butterfly’s wings are produced not with pigments, like the melanin that tints our skin, but with nanostructures (pdf). The scales on their wings are patterned with nanoscale channels, ridges, and cavities made of a protein called chitin. Unlike pigments, which create color by absorbing some wavelengths of light and reflecting the rest, the nanostructures are shaped so that they physically bend and scatter light in different directions, sending particular colors back to our eyes. That scattering can also make the wing scales iridescent–meaning the color changes with the angle you see it from.

When heat, in the form of invisible infrared radiation, hits the chitin nanostructures, they expand, changing their shape and therefore the colors they display. Scientists at GE are working to harness this property to make hypersensitive thermal imaging sensors, useful for night vision. By coating the wings of a Blue Morpho butterfly with carbon nanotubes that magnify the effect, researchers there made an insect into a sensor that changes color when its temperature changes a mere 1/25th of a degree.