Wednesday, 18 December 2013

DDR memory interfacing - Part 1

DDR memory short form for Dual Data Rate memory is a type of RAM. As we know, RAM is a volatile memory. There are several types of random access memories like SRAM, DRAM, SDRAM. DDR comes under SDRAM category. The main difference between other types of RAM and DDR is that data is transmitted on rising and falling edge of clock and hence it's name. There are several types of DDR namely DDR, DDR2, DDR3, LPDDR2, LPDDR3, DDR3L, DDR3U. We shall go into details of each types of memory later. We shall have a look into the differences also in later parts. For now, let us discuss some of the terminologies used in DDR and techniques used in DDR interfacing which helps to achieve throughput, bandwidth, power consumption, etc.


Memory interleaving:

DRAM is arranged as banks internally and each bank is selectable using a BANK ADDRESS signal. Each bank in turn is accessed as rows and columns. Option is that memory address can be assigned bank after another which is the normal way of doing. While accessing a memory bank, it takes time to respond and this effects the throughput of DDR. One way of increasing throughput is to assign addresses to banks in an alternate manner. This is nothing but addressing memory in a interleaved manner. For example, for a byte addressable memory, 0-7 address will be assigned to first bank, 8-15 to second bank and so on. This helps to increase throughput of RAM. But one question arises for a designer and he wants to where he should use this type of interleaving. Interleaving is used when there is a slow DRAM interfaced to core.

Channel count:

We generally see datasheets of processors mentioning support for single channel, dual channel. This means that it can support up to two independent DRAM parts. For example let us assume that a processor supports 64-bit DDR memory. In this case, dual channel means a 64-bit DDR can be connected to one channel and another 64-bit DDR to another channel. Or as per design needs user can use only one channel and connect 4 16-bit or 2 32-bit devices to one channel. This again depends on support from processor and for this you have to refer processor datasheet. But one may raise a question, why should i use 4 16-bit devices instead of 1 64-bit device? As cost wise also, it doesn't help. The main reason is that my throughput is much higher in the case of 4 devices compared to 1 device. It is almost x4 times. So, it is always the case of trade-off between speed and cost. Make your choice!!!

Monday, 9 December 2013

Validation Devices - Oscillioscope

One of the most important validation devices is Oscilloscope. Raging from graduate to hobbyist and technical guy everyone must have oscilloscope. Oscilloscopes basically are analog or digital type. The age old CRT based scopes mostly used in educational institutions are analog type. The modern scopes are all digital type. The main difference between analog and digital scope is that in a analog oscilloscope measured analog signal is directly applied against a time base where as digital oscilloscopes sample the signal and process before displaying them. An analog  and it has vertical, horizontal amplifier and other circuitry where as digital oscilloscope has sampling circuitry, signal processor and advanced displays with good resolutions. Before going further let us define what an oscilloscope is, in few words. A oscilloscope is nothing but a measuring instrument which gives a visual representation of electrical signal. This visual representation helps in debugging the circuit. An oscilloscope measures signal in a graph of voltage vs time.

Want to buy a oscilloscope from market for your debugging purposes? then you have to consider following criteria:

1. Bandwidth
2. Channel count
3. Sampling Rate
4. Memory Depth
5. Triggering capability
6. Probes and their types
7. Resolution of display screen
8. Connectivity of scope like USB, GPIB, serial port, Ethernet, Etc
9. Analysis of signals
10. Memory Depth
11. Pricing
12. Oscilloscope type
13. Accuracy of measurement
14. Vendor ratings
15. Test suits available

Let us assume you want to measure a 1 MHz signal with scope then you must a scope of 5 MHz min. band-width. the rule of thumb is that bandwidth of the scope must be 5 times of the signal to be measured. The reason for this is that the energy of signal is distributed among it's harmonics and it needs minimum of 5 harmonics for the signal to be reconstructed properly. 

Sampling rate is inverse of the signal to be measured. If we want to measure the 1ns signal over a scope the sampling rate of that scope must be minimum 1Msps.

Channel count defines the number of signals that can be captured in parallel. Based on your requirement choose the scope. Note that if you are using a scope at maximum sampling rate, the rate will be divided as per the number of channels used.

Memory depth measured in Kpts, Mpts defines the amount of storage capability of oscilloscope.

You might have seen x1, x10 marking on the probes. this represents the attenuation. If you take a signal of 1 volt and measure with x1 setting, then the attenuation is 0 and you see a exact representation of 1 volt an the screen. If you use the same scope with x10 setting, then you see 0.1 volt on the screen.

Before buying a scope check the support for communication interfaces like USB, GPIB, ETHERNET, serial ports. Pricing always as per the interfaces available.

Vendors like Agilent, Tektronix, Lecroy, Fluke, Instek are leaders in market and choose a vendor as per your choice. Check the support and servicing facilities of these vendors before making a decision.

Sometimes, you may need special test suites for signal integrity analysis of high speed interfaces like USB, PCIe, etc. These are additions to the scope and if miss them on a buy, you may may have to shell out additional amount later. Also, check out if the vendor is providing free add on boards or on discounted price which are used for these analysis purposes.

Saturday, 7 December 2013

Selecting a microcontroller

Ask a beginner in embedded systems, he might probably have worked on microcontroller for sure if not an any other. Microcontroller is like a heart for any low end embedded system. Yes, high end systems are for sure dominated by microprocessor or FPGA whether it be because of high performance of microprocessor/FPGA or any other factors. 

So, while choosing a microcontroller, it is always important to know the selection criteria. From the project point of view, we do get the requirements based on which selection is done. Microcontrollers are available from various vendors and selecting the best one among them is the toughest decision for a designer.Here are the list of factors based on which we will be selecting a microcontroller.
  • Flash memory size
  • RAM size
  • GPIO availability
  • Package of microcontroller
  • Board size occupied by microcontroller/pin count
  • 8/16/32-bit 
  • Frequency of operation (DMIPS, DMIPS/MHz)
  • Power consumption (sleep current, standby current, peripheral consumption)
  • If pin compatibility among controllers from same vendor
  • Pricing of microcontroller
  • Development environment (IDE) availability
  • Debugging tools
  • Design support from microcontroller vendor
  • Functions available (UART, SPI, I2C, ADC, PWM, etc)
  • Availability Safety functions like Internal temperature sensor, watchdog timer, etc
While selecting a microcontroller, we make a list of microcontrollers and compare the controllers with the above features. some give ratings based on the differences and some based on visual inspection of differences tend to make a decision.

Thursday, 28 November 2013

Metal Oxide Varistor (MOV)

Was checking about transient suppressors, whether it be spikes or surges and one device that came to mind was TVS diode. The other alternatives are spark gaps and MOV. Before going other let us get clarified what basically a transient is. A transient is nothing but a high voltage compared to normal operating voltage of a circuit which can be termed spike or surge based on the time period it is present. Termed spike if it is for lesser time. A surge if it exists for a long duration.

When a transient hits a circuit, it may lead to catastrophic events like electronics component damage and in some cases burning. So, as a designer it is must to take care in design phase itself to include protection for transients. Protection can be done either by using MOV, spark gap or a TVS diode.

What is the basic difference between TVS diode, MOV and spark gap? 

TVS diode has low clamping voltages. So, it is suitable for a circuit and helps circuit not to get damaged by over voltages. MOV has higher clamping voltage and is able to carry more current than a TVS diode. We have discussed about spark gaps previously in the blog. Just reminding again, a spark gap has very high breakdown voltage compared to MOV and TVS diode.


What is MOV?

MOV, short form for Metal oxide varistor is a nonlinear, voltage dependent device. Varistor sounds like a variation of resistance but in reality it is non ohmic variable resistor which is different from potentiometer (ohmic variation). MOV acts as transient voltage suppressor and is connected in parallel in a circuit at the input. Under normal input voltage conditions, MOV does not conduct. When transient occurs and input voltage reaches above breakdown voltage of MOV, it clamps voltage to safe level and shunts down the current. The power dissipated as heat in the device. MOV provides high resistance at a low voltage and low resistance at high voltage.


Symbol of Varistor:


MOV view:




How to increase the power handling capability of MOV?

MOVs must be connected in parallel to increase the power handling capacity. To increase the voltage handling capability, MOV must be connected in series. 

What is the internal configuration of MOV?

The configuration is like metal oxides between electrodes. These metal oxides from a back-to-back diodes and internally there are number of back-to-back diodes in parallel. 

Ratings of MOV:
  • Energy measured in Joules
  • Breakdown/Clamping Voltage
  • Capacitance Response time

Disadvantages of MOV:
  • Cannot handle high energies like lightning
  • Too much energy burns MOVs
  • Too many spikes degrades the MOV operation
  • Cannot control over current condition in a circuit
  • Higher clamping voltage, so, because of this lower over voltage conditions cannot be protected. For this, separate protection mechanism must be used which proves costly

Selection of MOV:

Take the case of a power line operating at 230 V AC. In this case, if you want to use a MOV, the best value if to use MOV which has breakdown between 260-275 V. Keep in mind that a power lines sometimes can have spike in the range of kV.


Advantages of MOV:
  • Cheap solution for protection
  • Easy integration to circuit
  • Can conduct more current compared to TVS diodes
  • Higher clamping voltage
  • Response time is less compared to Spark Gap

Tuesday, 26 November 2013

Validation devices - Smart Tweezer

It is common to use a tweezer in our applications. we generally use it as a assistant for soldering components. What if such a tweezer has LCR measurement option. In such a case,  it will be such a handy device to have. Basically, it also can identify the type of component. What if you have a soldered complex board and you are debugging one. Validating or debugging such a board becomes easy if you have smart tweezer kind of device.

Smart tweezers are basically hand-held, which help in measurement and identification of components. this helps to improve your debug time. Select a smart tweezer as per the precision required. But if you take a LCR meter separately, it will have more accuracy than smart tweezer. Keeping aside that disadvantage, if you are starting on a board debug, make sure you have a smart tweezer in hand.

Friday, 22 November 2013

Insulated Gate Bipolar Transistor (IGBT) - Part 1

Everyone of us sometime or the other might have used a switching device in our application. Whether it be diode, power diode, bipolar transistor, mosfet, thyristor, when our application demanded ON/OFF condition we have used either of these devices. We tend to select either of them based on the application need. Application need meant current capability, switching frequency, reverse voltage rating, etc. But when and where to use what, is another point of discussion.

Among such devices, Insulated Gate Bipolar Transistor (IGBT) is one. IGBT is basically a power semiconductor device used in medium to high power applications. IGBT has 4 layers (P-N-P-N) which reminds of SCR configuration. The power .handling capability of IGBT can be increased by connecting several IGBTs in parallel. It is a minority carrier device which uses majority as well as minority carriers.

As discussed, IGBT is used as a switch in many applications. Switching operation meant device will be operating in saturation and cut-off state and not in linear region. IGBT switches at a faster rate and also has higher efficiency. We have to note that the switching frequency is always less than a power MOSFET.

IGBT combines the high input impedance characteristic of mosfet with current carrying capability of bipolar transistor. When we talk in terms of power handling capability, IGBT is preferred to Diode, BJT and FET and has less power handling capacity then thyristor.

How to allow reverse current in IGBT?

IGBT does not allow reverse conduction. In case, a reverse current is desired a freewheeling diode is used in parallel to IGBT.

What is the differentiating point in terms of forward drop when compared to Power FET?

As we all know, MOSFET behaves as a resistor. The voltage drop is proportional to current. Where as IGBT voltage drop behavior is on a logarithmic scale to current. So, while choosing either mosfet or IGBT, consideration must be given to current capability and blocking voltage specifications.

Operation of IGBT:

IGBT has 4 alternating layers.

Equivalent circuit of IGBT:


Structure of IGBT:

Advantages of IGBT:

  • High power dissipation
  • High reverse breakdown voltage
  • Simple gate drive
  • High current
  • Low saturation voltage
  • Combination of MOSFET and bipolar transistor in single device
  • Rugged and tolerant to heavy loads

Disadvantages of IGBT:

  • High voltage drop (but lower than mosfet)
  • Low operating frequency because of current tail
Applications of IGBT:
  • Switched mode power supply, UPS
  • Traction motor circuit (Trains)
  • induction heating
  • Solar inverters

Wednesday, 6 November 2013

Using crystals in embedded applications - Part 2

In the previous section, we have seen how to select external capacitors of a crystal based on parasitic and load capacitance of crystal. The selection of these capacitors, determine the frequency of operation. In this section let us see what the individual parts of crystal section are going to contribute to oscillation.




  • Inverter inside the processor/micro controller acts as Class AB amplifier
  • Inverter provides 180 degrees phase-shift
  • For oscillation to be stable, the phase-shift must be 360 degrees 
  • Additional 180 degrees phase-shift is provided by C1, C2
  • As per oscillation theory, closed loop gain must be greater >= 1 for oscillation to be maintained
  • Loop gain gets reduced by ESR, shunt capacitance and load capacitance
  • Select a crystal with load capacitance <= 12pF
  • More the load capacitance of the crystal, more the power dissipated
  • If frequency of oscillation is higher than desired, increase load capacitance to reduce it to desired level
  • If frequency of oscillation is lower than the desired, reduce the load capacitance value to get desired frequency

Serial ATA (SATA) interface - Part 1

SATA short form for Serial Advanced attachment interface is a serial bus interface for interconnection of storage devices to processor. If you know desktop ingredients, you must be familiar with names like PATA, SCSI, SAS interfaces. PATA short form for Parallel advanced attachment interface has been used in personal computers for connecting hard disk drive to processor. PATA is a parallel interface with up to 40-60 wires (16-bit wide data interface). As we all know the disadvantage with parallel interface is mainly the length of transmission. even though we can achieve higher data rates with parallel interface, the main disadvantage is the length of transmission. with PATA we can achieve only 45-90 cm distance. Also, PATA can work only up to 133 MHz rate and uses +5V for signalling (TTL). The same PATA interface can be shared by many drives but due to bulkiness of connector, sharing not recommended. PATA is also knows as IDE or ATA. Hard disk drives available in the market are of sizes 2.5", 3.5" and 1.8". 3.5" drives are used in desktops and 2.5" drives in net book.

The below figures show PATA connectors, PATA HDD, PATA pin out.






Considering above points, a new interface came into existence which added serial features to SCSI (small computer system interface). It was called SAS short form for Serial attached SCSI. This basically can operate up to 1.5 GB/s and can have cables up to 8 meters long. this was used mainly for servers.

Now-a-days in desktops you don't see SCSI, PATA and SAS. A serial interface standard called SATA is seen. It differs from PATA in many ways and is not compatible in any ways. SATA is basically a serial interface standard which uses LVDS signalling for data transmission. There are various versions of SATA existing now like SATA 1.0, SATA 2.0, SATA 3.0 and SATA 4.0.

Electrical characteristics of SATA interface:
  • AC coupling capacitance of SATA is 12 pF
  • 100 ohm differential impedance
  • NRZ encoding
  • 8b/10b encoding
  • Transmit Rise/Fall time - 67-273 ps
  • 250mV differential LVDS signalling
Mechanical considerations of SATA interface:
  • SATA uses 7-pin data connector with appropriate grounding between differential lines
  • Uses 15-pin power connector, with staggered spin-up pin support
  • Uses +3.3V, +5V, +12V on the connector
  • Each pin in the connector carries 1.5 A current
  • Six standard ground pins on power connector
  • 1.27mm pitch connectors used
  • 1 meter length cable supported for SATA
The following figures show pin-outs for SATA power and Data connector



Some of the important points about SATA interface:
  • Capacitors on SATA line which are used for DC biasing are placed near to transmitter section
  • Hot plug supported in SATA interface
  • SATA supports data rates of 1.5 Gbps, 3 Gbps, 6 Gbps and 16 Gbps.
  • SATA uses I/O queuing protocol for efficient data transfer
  • In the evolution of any standard, to increase reuse of interface level hardware elated to ASIC, PHY, firmware same command will be used from previous versions of that standard. In SATA case also, command set from PATA has been retained.
  • If one wants to connect SATA device to a processor which doesn't have native SATA support, adapters are available. For example, if processor supports PATA, adapters can be used to connect SATA drive to processor
  • SATA Express is the latest standard of STA which supports up to 16 Gbps, this is done using native PCIe interface of the processor. A Mini PCIe support is enough on the board to connect a SATA express drive to board.
  • Observe the pins on SATA connector, you see them arranged in staggered manner. This helps to support hot plugging and improved mating
  • Wafer based connectors are used for SATA connectivity
  • A pin is reserved on power connector for SATA. This pin named as staggered spin up/activity is used to control drive spin on power up of unit. when staggered pin is pulled down by default, the drive spins as soon as the power is applied. This is little power consuming. Another case where staggered pin is pulled up. In this case, drive starts spinning, only when it is communicated to.
  • The mating count of these SATA connectors are restricted to less than 50.
  • SATA is half duplex interface
  • When SATA is not used, transmit pins float to the common mode voltage level

Monday, 4 November 2013

Wireless charging - Part 1

Wireless charging is one of the recent innovations which involves charging without a direct connectivity. A charging mat or a sleeve kind of thing will be available which enables charging. The principle involves magnetic coupling between two coils. When a magnetic coil carrying current is placed near another magnetic coil, due to electro-magnetic induction, current will be induced in another coil. The current will be regulated to charge a battery using power management circuit. The following manufacturers produces chips for power management:

  • IDT
  • Texas Instruments
  • ON semiconductor
  • Freescale semiconductor
  • Qualcomm
  • NXP semiconductor
  • Panasonic


Several standards for wireless charging are in existence. the following are the list of these standards:
  • Qi
  • Power 2.0 by PMAT
  • A4WP
The main disadvantage of all these standards is the coupling factor. As the distance of the receiver gets separated more from transmitter, the coupling gets reduced and hence efficiency. This implies that distance from the coil should not exceed coil size. Another disadvantage is that receiver coil must be properly aligned with transmitter coil to get maximum transfer. A new standard by PMAT named Witricity enables the distance from coil exceeding more compared to coil size. This is like charging anywhere in the room.

Standards like A4WP are supported by companies like Intel which can be used in it's smartphone, laptops and net book. Considering the standard, Qi operates in the range 100-205 KHz and Power2.0 operates in the range 277-357 KHz.



Some of the existing products with wireless charging capability:
  • Nokia Lumina 920 (uses TI chipset)
  • Samsung Galaxy S4
  • iPhone 4S
  • HTC devices
  • Google Nexus 4
  • Charging pads by JBL (this also serves up as speaker)
  • Charging pads for mobile phones by LG, Nokia, Samsung
  • Charging sleeves by Energizer, Duracell

Friday, 1 November 2013

Understanding Mini-PCIe

Mini PCIe is a scaled down version of PCIe which uses 1 lane for connecting to an external card. This interface mainly used in notebooks, tablets, laptops is used for connecting Wi-Fi, Bluetooth, Cellular broadband, Ethernet cards to the processor.

The following figures show the Mini PCIe connectors and cards available in the market:




The following are the signals in mini PCIe connector:
  • PCIe x1
  • Reference Clock
  • USB2.0
  • SMBus
  • LED's for diagnosis and signalling
  • SIM card connectivity
  • 1.5V/3.3V power (1 pin for 3.3 V Aux, 2 pins for +3.3 V main, 3 pins for +1.5 V main, 12 GND pins)
  • Some slots for future PCIe lane expansion
What may not be possible with Mini PCIe slot?
  • Graphics cards 
  • Video cards
This is because with the existing lanes in Mini PCIe band-width will not be enough for handling graphics content.

Mini PCIe Connector specifications:
  • 52-pin edge connector used
  • Staggered with 2 rows
  • 0.8mm pitch
  • Dimensions: 30 x 50.95 mm
Other important considerations in Mini PCIe:
  • Mini PCIe uses a differential clock of 100 MHz
  • Wake mechanism (in band) which helps module to be in stand-by mode during idle states
  • With the 52-pin staggered edge connector used, angled insertion and removal of add-in cards is done
  • Some add-in card connectivity can be screwed for mechanical support
  • Maximum power supported is 2.3 W
  • With +3.3 V power lane, peak current supported is 1 A 
  • With +1.5 V power lane, peak current supported is 1.5 V
  • +3.3 V is mainly used for I/O requirements, +1.5 V is only to avoid any on-board regulation
  • LED's used in Mini PCIe must be 9 mA sink capable
  • If you have Mini PCIe card and on board PCIe connectivity is only available, then, adapters are available for use in the market
Targeted applications for Mini PCIe:
  • Wireless Personal Area network (BT, UWB cards)
  • Local Area network cards (10/100/1G/10G cards)
  • Wireless Local Area network (802.11a/b/g cards)
  • Wireless Area Network (xDSL, Cable modem)
  • Wireless Wide Area Network (GSM/GPRS/UMTS/CDMA cards)

Monday, 21 October 2013

Using crystals in embedded applications - Part 1

Generally, for most of embedded applications we tend to use external crystal. Whether it be processor, micro controller, FPGA, SoC clock source is must. The other frequencies required as per interface (like USB, PCIe, SPI, I2C, etc) are derived from the internal PLL of the controllers. Crystal to be used in a application has some load capacitance which need to be achieved using external crystals also taking parasitic capacitance into consideration.

Along with these load capacitors you might have observed resistors used in two ways:
  • Resistor in parallel to crystal
  • Resistor in series with XTALIN pin

Generally, we follow the processor or crystal datasheet and go ahead using these resistors. These datasheets generally give the values for these resistors to be used and we will be least bothered to know about the purpose of those. Before going to know the purpose of those resistors let us see the types of crystals used in applications:
  • Series resonant crystals
  • Parallel resonant crystals

The oscillator configuration inside processor or a controller  is a pierce oscillator type and we add an external crystal. For a series resonator type there are no reactive components in the feedback where as in a parallel resonator type we have reactive components in feedback. the only difference is that parallel resonant crystal is fixed to oscillate at a specific frequency for a given load capacitance.

But why do we use resistors?

As mentioned, a pierce oscillator is inside a controller. A pierce oscillator is formed by a TTL or CMOS device. The important thing to remember here is that this device (which is inverter) inside the processor or controller must be biased properly to start oscillation or to maintain oscillations.  

parallel resistor helps for DC biasing to keep the inverter in active region. The value preferred is in Kilo ohm to Mega ohm.The only problem with this resistor is that it spoils the 'Q' of crystal. Generally, in micro controllers, this resistor is inside. Check out the micro controller datasheet to know whether to include this resistor outside or if it is already present. If resistor is large, feedback will be less and oscillator tend to be slow.

A series resistor  helps to prevent overdrive of crystal and helps to increase the life time of crystal (aging of crystal). The value of resistor used is less than <500 ohm. The main disadvantage is power consumption and it reduces the gain margin of the circuit.

How does load capacitance effect oscillator?

We have to keep in mind that load capacitance is formed by external capacitors and parasitic capacitance. The sum of these capacitance must match load capacitance of crystal. If load capacitance is less than the desired value, oscillator runs fast. If load capacitance is higher than the desired value, oscillator runs slow.

Sunday, 20 October 2013

Understanding Short circuit protection in regulators - Part 1

Have you ever experienced your tracks getting burnt, ic getting damaged because of excessive current. It is because you don't have a short circuit protection for your circuit. During power on, validation engineers do check for shorts but during the course of validation improper reworks causing shorting due to lead balls falling between ground and power pins may cause over current to flow and damage your circuitry.

This kind of shorts are random and deterministic. So, care must be taken before hand. In a design, it always adds up a additional circuitry to implement such short protection mechanisms. For taking care of such cases, modern day regulators are coming up with short circuit protection within the ic itself. This causes the regulator to shutdown (or restrict the current ti Imax automatically) in case there is a short circuit. As the regulators are the main sources of current, if they are controlled first hand, then, it always provides a shield to the entire circuit. So, applying short circuit protection at the source is a common design trend. Check the old regulators, you may not find these kind of protection mechanisms. The modern day regulators have such protection and be careful to choose such regulators only in your design.

The common protection mechanisms employed in regulators are:

1. Constant current limiting circuit
2. Fold back limiting current or passive current limiting (fold back current is the terminology used to indicate maximum current condition before which protection is applied)
3. If short circuit protection not present in regulators, a high side low resistance MOSFET switch is used to control in case of short circuit. In such circuits the configuration of the circuit can be changed to control the current.

Check out the below graph which shows the variation of output voltage and current in case of current reaching fold back current:


Check out the below circuit from Linear technologies employing a high side switch (LTC1477):


The above circuit employs a control path at the output where the boost regulator connection to load can be cut-off from load using LTC1477. So, a enable pin on LTC1477 will take care of such scenario. There are scenarios where it is desirable to limit the current rather than disconnecting the power. This is from the user convenience prospective because regular switching off rather than limiting may cause annoyance to the end user. For such cases, we use a discrete circuitry.

Monday, 14 October 2013

USB HSIC interface

You have seen USB2.0/USB3.0 interfaces which are used for connecting processor to external peripherals. The USB lines extend to a connector from which you connect a key-board, mouse, printer or whatever device you want. There are these other interfaces like I2C, SPI which we use for chip-to-chip connectivity. The only disadvantage of these interfaces is speed. Compare the USB2.0 rate of 480 Mbps with I2C speed up to 3.4 MHz which is very less. So, if we want to achieve such high speeds on a board for chip-to-chip connectivity there is a need for new interface which is USB HSIC which was introduced in 2007. So, this is quite new to many hardware engineers. Design engineers working on latest high end processors, SoCs must be familiar with these interfaces.


USB HSIC is basically a synchronous serial interface used for chip-to-chip connectivity. It is basically a two signal interface that uses  1.2 V LVCMOS signalling for communication. The main difference here with the USB is that USB uses a 3.3V signalling. Another difference is that USB uses analog interface externally where as HSIC uses digital signalling on board. As HSIC eliminates analog transceivers, it is low cost, low power consuming and low complexity interface. Another advantage is the low board space required for signals.  As it is a chip-to-chip connectivity interface, there is no need for external cables or connectors.It does not support plug-n-play. also, hot plug not supported.


USB HSIC is a two signal interface which uses DATA, STROBE signals for communication. USB HSIC strobe signal uses 240 MHz clock. It uses dual data rate to transmit data at 480 Mbps. A dual data rate interface is one which clocks data over both leading and falling edges of the clock. One thing to remember here is data and strobe signals are bi-directional. It uses NRZI encoding on signals.


USB HSIC uses the same software stack as USB and can be said as high speed connectivity interface between chips. The main disadvantage is that latency of USB HSIC is little high. HSIC is used mainly in battery powered applications because of low power consumption. USB HSIC can be expanded to connect external USB interfaces using HSIC hubs like USB2513, USB3503, USB4640.


Applications:

  • Smartphones
  • Desktops
  • Tablets
  • set-up boxes
  • GPS navigators
USB3.0 also has a version of chip-to-chip connectivity which is called SSIC. 

Probing USB HSIC signals:
  • We already have a set ups in place for USB measurements. The same cannot be used for USB HSIC as the PHY structure is different from USB. 
  • High Frequency passive probes cannot be used and you may need a active probes. Only problem is these active probes are too costly to buy.
  • For probing a USB HSIC signal at 480 Mbps you need a probe of band-width minimum 1.5 GHz.
  • If we probe HSIC with a passive probe, there is always a chance that the interface may get reset.
  • As per USB HSIC standard, the load cannot a capacitance of more than 14 pF. So, while choosing a probe keep this in consideration.
  • The following table indicates the state of interface as per the signal states of data, strobe:


Design Engineer considerations:
  • PCB trace length of HSIC signals should not exceed 10 cm (< 4 inches).
  • Signals must be routed with a 50 ohm impedance
  • Trace length matching must happen so that the skew will not exceed above 15 ps.
  • Trace spacing should be 3 times the dielectric thickness
Other salient features of USB HSIC:
  • Power consumed is very less when in idle state
  • HSIC uses the same tiered topology as like USB2.0, the peripheral connectivity as shown in the below figure:


  • There is no speed detection mechanism in HSIC. It defaults to USB2.0 speed.
  • Data is transferred from USB HSIC only after idle condition, then data gets stopped after idle condition is back.
Tools for HSIC probing:
  • Agilent Technologies have a HSIC compliance software which can do the following functions:
    • Rise and Fall time measurements
    • Bus state and timing measurements
    • Packet parameters
    • Data eye and mask testing
    • test report generation
  • Lecroy also has HSIC decode application for their scopes

Saturday, 12 October 2013

Spark gaps

You might have seen capacitors being used for suppressing any noise or to provide sudden surge currents. The basic types of capacitors that we use are electrolytic, ceramic and tantalum. There are several other types in common use of which spark gap capacitor is one type.

What do we use  for ESD and lightening protection in circuits?

We often use ESD or TVS diodes in such cases. Spark gap is one type of capacitor that can be used in place of these diodes.

What are the advantages of these spark gaps?

These spark gaps can be constructed on the PCB itself without any physical component which itself is a very low cost implementation. These spark gaps can handle high voltage transients (in kV) as such they an be used for ESD and lightening protection. they have a rugged construction and chances of failure are less. they can handle large surge currents.

How is a spark gap capacitor constructed?

The genuine functionality of spark gap is same as normal capacitor but they differ in construction. A spark gap is formed by separating two electrodes with a air gap. One of the electrode is connected to ground.

How does a spark gap operate?


Spark gaps when constructed have a break down rating. when a voltage transient voltage reaches that breakdown voltage value, this spark gap provides a low impedance path to ground. When electrons flow through this low impedance path they collide with the molecules in the air and their electrons get excited and jump to higher orbital levels. So, when they jump back to their normal levels, they emit light. due to which we see a spark. Sometimes, we also hear sounds in case of lightening strikes. So, once the transient voltage goes below spark gap breakdown, the operation comes to normal and the conducting path between the two plates is no more there. even in case, the current goes below a limit specified by holding current, the conductivity between plates is lost. You may observe some heat also being produced in a spark gap.

Spark gap voltage can be calculated by the formula: (3000 * atmospheric pressure * plate distance + 1350)

the only problem with spark gap, this breakdown voltage is always varying.

Symbolic representation of spark gap in a circuit:


Where do we use this spark gap?

  • As spark plug in automobiles
  • For ESD protection of interfaces in a electronic circuit
  • We see them at the input of transformer in a AC-DC circuit
  • other general uses are CRTs, X-ray machines

Friday, 11 October 2013

Why do we need external capacitors on crystal?

Take the case of micro controller where you have option of using either external and internal crystal for clocking. We in many applications use external crystals. We might have used external capacitors for a crystal used in such an application. The below figure also shows the same.


We always follow the datasheet of micro controller to find the value of external capacitor (C1, C2 in above figure). The datasheet clearly mentions value of capacitor to be used for specific crystal frequency. 

Following are some facts about these capacitors:
  • Ceramic caps are preferred for these capacitors as they are stable (with temperature variations)
  • Even though the capacitors look like parallel connected, they are connected in series.
  • XTAL1, XTAL2 pins in above circuit are input and output pins respectively. Some controllers/processors specify them as XTALIN and XTALOUT.
  • These capacitors along with crystal form a band pass filter and are crucial in crystal performance. This filter circuit provides 180 deg phase shift.
  • These capacitors provide protection against stray signals and helps to get stabilized crystal frequency
  • There is slight variation in frequency because of this capacitors. A crystal generates gives out a frequency slight away from the specification and adding these capacitors helps getting stabilized frequency. However, in applications, that doesn't require much stability users tend to ignore this.
  • If you use a very high value of capacitor instead of specified value, response time increases for crystal.
Below is the capacitance values mentioned in a micro controller (PIC16F777) datasheet as per frequency:


If not mentioned in data sheet, you have to manually calculate the capacitance value using the below formula:

                         Load capacitance = Stray capacitance + Pin capacitance + [(C1 * C2)/(C1+C2)]

Load capacitance - You get from the crystal data sheet
Stray capacitance - PCB capacitance
Pin Capacitance - Micro controller pin capacitance
C1, C2 are connected in series, so, the parallel formula used for calculating effective capacitance

The main problem with the above formula comes only with approximation of PCB capacitance which can't be determined accurately. So, the estimation may go wrong sometimes.

Most of these CMOS digital circuits are clocked by pierce oscillator shown in the diagram below:

Wednesday, 9 October 2013

What is ppm rating in crystals/Oscillators?

I was going through a processor datasheet where a system PLL clock output is driving USB controller. It was mentioned that the clock must be having a stability factor 480MHz ± 500ppm. This article is for those who are interested in knowing what this ppm means.

You must have seen the specifications of a oscillator in it's datasheet and it must have mentioned stability as ppm. We generally don't think much about this ppm and tend to select as per the requirements given. If one asks, ±20ppm we just select the oscillator with that stability factor. A crystal frequency may vary as per the environmental conditions and ageing. The amount of variations is indicated by the ppm value. Let us see few points about this ppm.

  • ppm is nothing but parts per million
  • A change in frequency (dF) as per ppm value is calculated using the formula, (crystal frequency * ppm)/(10^6). 
  • This dF when added to crystal frequency gives the frequency variation.
  • So, for one year period, the crystal vary by F±dF
There are other types of oscillators use instead of normal oscillators to get temperature stability. They are temperature controlled oscillators, oven controlled oscillators, atomic clocks. Oven controlled oscillators have a ppm in the range of ±1x(10^-9). Atomic clocks are much more stable than this.

What is the difference between oscillator and crystal?
  • Crystal is the basic building block of oscillator.
  • Oscillator can be constructed from either quartz crystal or ceramic resonator. Quartz crystal gives more stability.
  • A crystal included with semiconductor elements like transistor, inverter and capacitors form a oscillator
  • If you see a crystal, you need not give power but for oscillator power is required.
  • the output of oscillator is buffered to drive higher loads.
  • Oscillators are available in plastic or metla package. 

Tuesday, 8 October 2013

Zener vs Schottky vs Normal diode

Diode is a semiconductor device with P-N junction. So, when positive voltage is applied to P side of diode, it is said to be forward biased. When this voltage exceeds 0.7V, the diode is set to breakdown and the diode starts conducting and allows current to flow. When forward voltage is below 0.7V, diode doesn't conduct. There are diodes with forward breakdown up to 1.1V. The breakdown depends on the type of semiconductor material used for diode construction. There are When the same voltage is applied to N side of diode, the diode is to be reverse biased and never conducts. but when this reverse voltage is above some threshold, it starts conducting.

The voltage characteristics of a normal diode and it's symbol are shown below:




The diode symbol is as shown in the figure and you can see a strip around the cylindrical diode which actually represents the cathode. Diodes are generally available in cylindrical or glass packages. Some of the applications of diodes include power conversion, over voltage protection, reverse current protection and in other logic circuits. The general application where the normal diode is used can be seen from the below figure.


The forward drop of D1 is 1.1V in the above figure. So, the voltage seen at the resistor R1 is (12 - 1.1) = 10.9 V. If you check the data sheet of D1, the reverse voltage specification is 50 V. If the current has to flow from R1 through D1, the voltage at the load has to exceed by 50 V. This is the normal functionality of diode and it's application. Anyways in the above simple circuit we are not much bothered about the reverse voltage.

Various diode symbols can be seen in the below figure:


What happens if we replace D1 in the above with Schottky diode?

Schottky diode best suits this application. Schottky diode has low voltage power drop and not more than 0.5 V. Schottky diodes have a voltage drop in the range 0.2 - 0.45 V. So, the voltage at the first node of R1 will be measured as 12 - 0.2 = 11.8 V. This is with reference to forward drop. The main advantage we are getting here is less voltage drop and hence less power consumption.

So, in applications where reverse current need to be gated and forward drop must be very less schottky diode is preferred. Let us consider a case, where from the other end of D1 we have a voltage greater than breakdown voltage. In this case, the diode is reverse biased and current flows in other direction. In this case, let us assume the reverse voltage goes below supply voltage. In this case, the diode has to switch back to forward biased condition. This happens pretty quickly in schottky diode. A normal diode may take time to switch back to forward biased mode. So, important point here is Schottky diode has rapid turn on and turn off times. One has to consider the fact that the reverse voltage drop of Schottky diode is less than normal diode. But in this application, reverse voltage doesn't matter much.

Can we use a zener diode in the above application?

Definitely, a zener diode can be used if we consider a forward biased condition. The forward drop is same as normal diode. But it has voltage drop greater then Schottky diode. So, Schottky is always preferred in this case compared to zener.

What is the case of reverse breakdown when we consider Zener, Schottky and normal diode?

Zener - Reverse voltage varies from 1.8 V to 200 V as per the diode selected
Normal diode: Available with forward drops in the range 50-1000V
Schottky: In the range 20-45 V

So, considering above cases, when is a zener diode used?

Consider, the previous circuit and let us assume that we want a specific voltage of 3.6V at the load even though the supply is +12V. We can connect a zener diode at the load end to clamp the voltage or in other words to regulate the voltage to desired level. the same circuit with zener diode as per requirement gets modified as follows:


So, when there is a need to regulate the voltage a zener diode is used. Here, even a schottky diode can be used but the problem is in schottky diodes the breakdown voltage is less than the reverse voltage at which current flows. Where as in a Zener diode, the breakdown voltage is little greater than actual reverse voltage.

Porting RTOS on LPC2148 - Step 3

As LPC2148 is a ARM based micro controller, you require GNU ARM tool chain for compiling the code. Eclipse is one platform which has compatibility for GCC tool chains. Why GCC is preferred by many is because it is open-source. emIDE is another IDE which comes with integrated GNU tool chain

Before going to know, we have to know what a compiler does? A compiler basically translates high level language to machine language. So, when you write a code in eclipse or any other IDE it is basically the compiler in the background that that converts it to downloadable format, .hex in our case.

One more thing to understand here is about the cross compiler. To understand this, let us assume that we are porting a code to embedded system running on Linux and let us assume the code is written in eclipse installed on windows system. To generate a executable code such that it runs on linux system, you must have a cross compiler.

Some of the tool chains/compilers that you can use are:

  • Yagarto
  • MinGW
For integrating YAGARTO to ECLIPSE, download YAGARTO from the following link:

Saturday, 5 October 2013

SSD vs HDD

We are aware of different kinds of memory, classified as volatile and non-volatile. Volatile is a kind of memory which looses it's stored contents when power is removed. Non-volatile is kind of memory which retains it's contents even when power is removed. Hard drive in your system is one kind of non-volatile memory. Hard disk can be of two types, either HDD or SSD. Many of us are unaware of the primary differences between the two types.

Before going to discuss more about those types, let us first know the basic purpose of storage devices on systems:

  • Used to boot the system
  • Store your personal files
  • Store multimedia data
  • Store your applications
  • Store your operating system 

HDD (Hard Disk Drive):


Hard drives have a rotating arm with read/write header. The header moves over a metal platter with magnetic coating for read/write operation. There are several sizes available for HDDs. For example 2.5" for laptop and 3.5" for desktop. These drives moves at a speed of 5400 or 7200 or 15000 rpm. Faster the rotation speed, faster is the read or write operation. HDD used serial interface to communicate with the processor initially, then it moved to IDE, then SCSI and SATA now-a-days. These days we have HDDs with capability up to 4TB (Tera Bytes). The 2.5" inch drives are available in sizes up to 2TB and 3.5" drives up to 4TB.


SSD (Solid state drive):

A solid state drive is made from solid state devices like transistors which have charge carriers. SSD is basically a interconnected flash chip architecture which is mostly used in netbooks and ultrabooks. These SSDs can be mounted on mother board, connected as like HDD or slotted into a PCIe slot. SSD is basically a NAND flash .with read and write cycles faster as compared to a normal thumb drive. Processor reads and writes data as per the addressing and speed of operation of SSD directly gets effected by that. As like HDD, these are available in 2.5" inch size and up to size of 1TB storage capacity for that size. But it is very rare that you see that huge storage capacity with SSDs. Adding to this there is mSATA short term for mini-sata which fits into mini PCIe slot of a laptop.


The main differences between HDD ans SSD are tabulated below for quick reference:


By seeing the above table, we can tell that the choice of storage must be SSD. But SSD has to go a long way to replace HDD in environments like servers, large multimedia storage requirements.

the below figure shows the noise recording near a SSD and HDD:




Other than SSD and HDD, there are other variants like hybrid drives and multi-drives.

Hybrid drives:
  • Flash chipsets on the same HDD making a combo kind
  • Flash chips are used only for booting and application storage
  • Flash chips are not directly accessible by user for storage and programming
  • System boot speed is increased because of flash and applications can be launched quickly
Multi drives:
  • One approach is to use both HDD and SSD in  a system
  • Again SSD is only for booting and application storage
  • HDD for files storage
  • This manages cost as well as speed in one attempt
  • Only problem is to integrate both on a space constrained system
Systems with SSD:
  • HP Elite Book Revolve 810 has 128GB SSD. HP Elite Book is basically a ultra-flexible laptop.