Showing posts with label Electronics. Show all posts
Showing posts with label Electronics. Show all posts

Friday, 7 July 2017

Introduction to Static Timing Analysis

For any design, let it be Analog or digital, timing is one of the specification that has to be met.

Timing arcs like Combinational delay, setup & hold are measured for a block generally by simulating them, i.e stimulate the block with dynamic signal and measure the output (Dynamic Timing Analysis). This would get cumbersome if the block is huge like SOC, because 

1. it involves manual identification of combinational path, Data path, Clock Path, Clock gating path & Asynchronous path and measure corresponding timings between the Pin & Related Pin for each of the path.
2. Simulating the huge block will be a burden and time consuming for simulator.
3. Requires more memory for simulation.  
4. Time to market factor will be affected tremendously.

How do we automate the identifying and measuring the timing arcs for Large blocks?

 Automation industry has employed conventional Module technique, module a top SOC into simpler blocks whose timings are very easy to interpret and measure. Yes, our instinct says Gates are that lower modules. Once the timings for Gates are measured, we integrate those timings in the top level. Integration of timings of Gates are Automated, it requires each lower module's timing information in a particular syntax, this gave rise to library generation or Characterization.  

And delay modle for the routings between modules are taken from Unified routing modle.

How does lower modules behave with different load?

We know that timing measurements change with change in loads. How do we account for that in the library generation? .lib files incorporate input capacitance for each input pin, and timing arcs are measured by sweeping the output load from lower to upper defined value (it's usually decided with smallest & largest input load that can possibly connect).

How modules are integrated and timings are measured in the top level ?

Now we know that .lib files are written for modules. It has pin information, input capacitance for all input pins, all timing arcs between Pin & Related Pin. Netlist gives the connectivity information between these modules in the top level. So, a netlist (preferred is verilog) with stop level to Gates should be generated. .lib files are used as look-up table and connectivity is established using netlist generated. Algorithms are written now to dump timing information for the Top block.

Tools like Prime Time of Synopsys and Encounter timing system of Cadence are preferred in industry for this.

 How should analog blocks be handled?

Unfortunately since Analog blocks are comprised of complex different topology with transistors, it has to be treated just like Gates, where manual computation of timings has to be done. However there are automation emerging for bringing down the manual computation in these cases also like Liberate/MX/AMS from Cadence.





Monday, 1 May 2017

Save internal net's voltages from a DSPF netlist in Spectre

Most often i come across people saying that voltages of internal nets can't be saved from the dspf netlist or layout generated netlist. Extracted view is the solution to save internal nets, because they can go click on the net in GUI to instruct tool to save it, they believe.

While i agree they have found a solution to save an internal net for a layout generated solution, but the downside of generating and using an extracted view are given below:
1> Extraction runs (like QRC, Starrc etc.,) take longer to dump the extracted view since the tool has to map the extracted components to the PDK component and retain the connectivity and to restructure the layout looks out of it.
2>Consumes more disk space.
3>Simulation time is longer since simulator has to regenerate netlist from the extracted view.

Also i have come across people saying, a pin has to be brought out from the desired net to be probed. I would say it's pretty simple to save internal nets form the layout generated netlist. Before heading to give to the solution please do " spectre -h save" in your terminal. That would give you some idea about saving an internal nets.

In this blog i am taking DSPF as an example, because that's what people find most difficult to deal with. To know the DSPF format please refer to this DSPF link.
Find for "|NET" in the shared link. In the shared link "BF" is an internal net. Just add below given code in your spectre netlist, DSPF netlist has to be included in it, if |NET BF voltage has to be saved.

save BF

If there is a test bench about it and it's instance is, let's say, I45 then add below line in your netlist.

save I45.BF

If the DSPF netlist having internal net deep-down hierarchy like "|NET XAnatop/XSwitchedcap/out" and there is a testbench,I45, for it. Below is the line to save that net to be put in spectre netlist

save I45.XAnatop/XSwitchedcap/out

I hope i was helpful. Please drop comments if you need any further help :)





Friday, 7 August 2015

BASICS OF ELECTROSTATIC DISCHARGE (ESD) CELL DESIGN

CMOS chips are susceptible to the ESD strikes. EDS strikes produce huge current through the pins that can damage the gate oxide of the transistors, this will affect the functionality of the chip.

It’s essential to protect the chips form the ESD strikes to make it durable. Firstly, the fundamental idea here is to create conduit to the huge currents of ESD strikes. The conduit circuit should not be the factor for the leakage power in normal case. ESD strikes can happen in many ways, these strikes are modeled for the testing of the ESD cells. You can refer to the below mentioned link to know about different ESD models:


Now let’s have a look at the circuit given in the right.

When the signal is varied from minus infinity to plus infinity in voltage, can you plot the current
through the MOSFET versus the signal voltage?

Well, if you were thinking the NMOS will be off all the time, you are wrong! Have a look at the Cross-sectional view of the same circuit. And focus on the diode formed between the drain and the substrate.


               



With the graph of IB versus VDB variation. This above structure can be considered for ESD protection circuit design.

In reality MOS SNAPBACK will occur.  As voltage VD increases, the drain to body leakage will increase. This leakage current passing through P+ will introduce voltage drop across RPSUB. At critical VD=Vt1VPSUB is huge enough to turn the NPN transistor on. As transistor turns on most of the current directs to INPN (shown in the figure) bringing down the voltage VPSUB snapping the voltage VD back to holding voltage VHVD and  INPN increases and breaks-down beyond a point.


Being over precaution below mentioned circuit is generally employed for ESD protection.

As length of transistors getting reduced with the node technology. If this structure is used to protect the gate of a MOSFET, the Vt1 will be equal to VGB  for the thin oxide MOSFET making it less reliable to protect the gates of MOSFET. It is also found that thin oxide MOSFET breaks-down as soon as it enters snapback region. However, thick oxide MOS can be in snapback region for some time before breakdown .





Thursday, 12 April 2012

DC MOTOR DRIVER CIRCUIT (H-bridge circuit)


For the rotation of DC motor it requires current of about 11amps under load, 1.25amps under no load. This high current cannot be supplied by the microcontroller we use (ports of microcontroller deals with micro currents).

How do we arrange for that much of current?                                                                                        Well the obvious answer to this is to use transistors.
 

 Control of the directions,break and coast of Dc-motor:

We can control the direction of rotation by using classical H-bridge circuit it is depicted below

 

  • Q1, Q2: These are NPN transistors. They connect the motor to ground (negative terminal of the battery).
  • Q3, Q4: These are PNP transistors. They connect the motor to +12V.
  • R1-R4: These resistors prevent too much current from passing through the base (labeled B) control pin of the transistor. A higher resistance would waste more power, and  might cause the motor to receive less power. A lower resistance would waste less power, but wouldn’t likely provide better performance for motors running on consumer batteries.
  • D1-D4:  Schottky diodes are used to prevent the transistors from dying due to high reverse flow of current through the it. This high current is generated by the back emf of the motor, while changing the direction or slowing the speed.
DC motor: This is a direct-current (DC) motor. These are very common. You can find them in surplus stores online or in salvaged toys. The motor should have only two wires. Measure the resistance of the two motor wires using a multimeter. If it is much less than 5 ohms, then the transistor parts listed in this article are too weak to power the motor

The below table gives the control command :

                A    B      DIR
                0     0      stop

                0     1      ccw
                1     0      cw
                1     1     stop


Wednesday, 19 October 2011

Interfacing 16x2 LCD to 8051 core mcu

How would you interface devices to a microcontroller?
The most important thing is "Data sheet" of the device.And it is not mandatory to read each and every part of data sheet,reading data sheet is also an art form.You must know your expectation of  devices specifications, read through data sheet of the device and make sure it satisfies that to some extend.Electrical specification will matter a lot when you are interfacing a device.You must know the power rating,input voltage supply,input current etc.,
We know that lot of  16x2 LCDs are available in the market so it is your job to find out the data sheet of the LCD your interfacing.But the instruction sets for almost all LCD are same,so below i've put instruction set.



Here is a program for interfacing t JHD162A LCD to 8051 core mcu:

 HEADER FILE


 #ifndef __LCD_H__
#define __LCD_H__

void lcd_init();
void lcd_printc(char a_char);  //print a character
void lcd_prints(char *string);  //print a string
void lcd_clear_row(char row);
void lcd_clear(void);
void lcd_cursor_on(void);
void lcd_cursor_off(void);
void lcd_move_cursor(unsigned char row, unsigned char column);
void lcd_move_cursor_left(void);
void lcd_move_cursor_right(void);


#endif

LIBRARY FILE
#include <reg51.h>
#define LCD_RS P2_4
#define LCD_WR P2_5
#define LCD_EN P2_6

#define LCD_MAX_ROWS    2
#define LCD_MAX_COLS    16

#define LCD_CMD_CLEAR        0x01
#define LCD_CMD_CURSOR_HOME    0x02
#define LCD_CMD_CURSOR_LEFT    0x10
#define LCD_CMD_CURSOR_RIGHT     0x14
#define LCD_CMD_CURSOR_ON    0x0D
#define LCD_CMD_CURSOR_OFF    0x0C

static void lcd_write_data(unsigned char val);
static void lcd_write_cmd(unsigned char cmd);
static char lcd_is_busy();



void lcd_init(void)
{
    delay(15);        // LCD Power on delay
    lcd_write_cmd(0x38);    // 8BIT, 2 LINE , 5x7 DOT Format font
    delay(5);        // Small dealy
    lcd_write_cmd(0x38);
    lcd_write_cmd(0x06);
    lcd_write_cmd(0x0c);
    lcd_write_cmd(0x0E);
    lcd_clear();        // Display ON, Cursor ON, Blink OFF

    lcd_cursor_off();
    lcd_clear();
}

void lcd_printc(char a_char)
{
    lcd_write_data(a_char);
}

void lcd_prints(char *string)
{
    while (*string)
        lcd_printc(*string++);
}

void lcd_clear(void)
{
    lcd_write_cmd(LCD_CMD_CLEAR);
}

void lcd_clear_row(char row)
{
    char i = 0;
    lcd_move_cursor(row, 0);
    while (i < LCD_MAX_COLS) {
        lcd_printc(' ');
        i++;
    }
    lcd_move_cursor(row, 0);
}

void lcd_cursor_on(void)
{
    lcd_write_cmd(LCD_CMD_CURSOR_ON);
}

void lcd_cursor_off(void)
{
    lcd_write_cmd(LCD_CMD_CURSOR_OFF);
}

void lcd_move_cursor(unsigned char row, unsigned char column)
{
    switch (row) {
    case 0:
        lcd_write_cmd(0x80 + column);
        break;
    case 1:
        lcd_write_cmd(0xc0 + column);
        break;
    default:
        break;
    }
}

void lcd_move_cursor_left(void)
{
    lcd_write_cmd(LCD_CMD_CURSOR_LEFT);
}

void lcd_move_cursor_right(void)
{
    lcd_write_cmd(LCD_CMD_CURSOR_RIGHT);
}

void lcd_move_cursor_home(void)
{
    lcd_write_cmd(LCD_CMD_CURSOR_HOME);
}

static char lcd_is_busy()
{
    unsigned char c;
    P0 = 0xFF;
    LCD_WR = 1;
    LCD_RS = 0;        // SET LCD_RS for DATA
    LCD_EN = 0;
    LCD_EN = 1;        // Pulse LCD_EN
    c = P0;
    LCD_EN = 0;
    return c & 0x80;    // return busy bit
}

static void lcd_write_cmd(unsigned char cmd)
{
    while (lcd_is_busy());
    LCD_WR = 0;
    LCD_EN = 0;
    LCD_RS = 0;        // Reset LCD_RS for Command
    P0 = cmd;
    LCD_EN = 1;        // Pulse LCD_EN
    LCD_EN = 0;
    LCD_WR = 1;
}

static void lcd_write_data(unsigned char val)
{
    while (lcd_is_busy());
    LCD_WR = 0;
    LCD_EN = 0;
    LCD_RS = 1;        // SET LCD_RS for DATA
    P0 = val;
    LCD_EN = 1;        // Pulse LCD_EN
    LCD_EN = 0;
    LCD_WR = 1;
}




Tuesday, 4 October 2011

Keil tutorials

this video helps you to create a new project and debug,if any error encounters.

Tuesday, 27 September 2011

Keil Uvision 4 on Ubuntu

Hey all,
            i'm here to help you people out with installing keil in ubuntu.

Now you people might think.Can we really install programs with .exe extensions?
Well,here's an answer to you people "yes"?.

Wine is a powerful software(free software!) that aims to allow computer programs written solely for microsoft windows to run on linux environment.

if you want to know more about it.Here is a link on its articles:




Here are few simple steps to install wine :
  1. open terminal Applications>accessories>terminal
    2. Type the following command to install wine (you must be connected to
         internet):
                sudo apt-get install wine
    3. After installing wine to make it create duplicate "c:"drive configure it by 
        typing "winecfg" in terminal.


Install keil in wine by getting into the location where installation file is located in terminal by



                 "wine file_name.exe"
if file extension is other than exe type: " wine start file_name.abc"


hurray! installation is done.

next i'll be teaching how to use keil.

Wednesday, 14 September 2011

SPI interface programs for 8051 core microcontroller

HEADER FILE
#ifndef SPI_H
#define SPI_H

#include <8052.h>


#define SPI_SS         P2_7
#define SPI_READ    0x03
#define SPI_WRITE    0x02
#define SPI_WRDI    0x04
#define SPI_WREN    0x06
#define SPI_RDSR    0x05


/* SPI Special Function Registers */

__sfr __at(0XD5) SPCR;
__sfr __at(0XAA) SPSR;
__sfr __at(0X86) SPDAT;

void spi_init();
char spi_tx_rx(char val);
void spi_write_enable();
void spi_write(char val, char addr);
char spi_read(char addr);

#endif


LIBRARY FILE



#include <8052.h>
#include "spi.h"
#include "string.h"

#define SPI_SS P2_7

void spi_init()
{
    SPI_SS = 1;
    SPSR = 0;
    SPCR = 0x5c;
}

char spi_tx_rx(char val)
{
    SPDAT = val;        /* send data out spi port */
    while (!(SPSR & 0x80));    /* wait for transfer to complete */
    SPSR = 0;
    return SPDAT;
}

void spi_write_enable()
{
    SPI_SS = 0;
    spi_tx_rx(SPI_WREN);
    SPI_SS = 1;
    delay(10);
}

void spi_write(char val, char addr)
{
    spi_write_enable();
    SPI_SS = 0;
    spi_tx_rx(SPI_WRITE);
    spi_tx_rx(addr);
    spi_tx_rx(val);
    SPI_SS = 1;
    delay(10);
}

char spi_read(char addr)
{
    char ret;
    SPI_SS = 0;
    spi_tx_rx(SPI_READ);
    spi_tx_rx(addr);
    ret = spi_tx_rx(0);
    SPI_SS = 1;
    return ret;

}