Tuesday, June 29, 2010

How to create a custom page in Prestashop?

Log in your Prestashop and click tools at the top right.

 
 

In the next line click CMS there you can edit the static pages in your site.

How to create an user in MediaWiki?

Log in your MediaWiki and click Special Pages at the bottom left of the screen.

 
 

Then click Log in / create an account and create a new MediaWiki account.

Using Functions as Arrays

This is a C code for using functions as arrays.

We use array of function pointers. Here is sample code



  // array of functions
  #include

  // -- FUNCTION PROTOTYPES --
  void func1();
  void func2();
  void func3();
  void func4();
  void func5();
  // -- ENDS --

  void main()
  {
   // notice the prototype
   void (*ptr[5])();

   // arrays are made to point
   // at the respective functions
   ptr[0]=func1;
   ptr[1]=func2;
   ptr[2]=func3;
   ptr[3]=func4;
   ptr[4]=func5;

   // now the array elements
   // point to different functions
   // which are called just like
   // we access the elements of
   // an array
   for(int i=0;i<5;i++)
     (*ptr[i])();
  }

  // -- FUNCTIONS DEFINITION --
  void func1()
  {
   cout<<"Called Func1!\n";
  }

  void func2()
  {
   cout<<"Called Func2!\n";
  }

  void func3()
  {
   cout<<"Called Func3!\n";
  }

  void func4()
  {
   cout<<"Called Func4!\n";
  }

  void func5()
  {
   cout<<"Called Func5!\n";
  }
  // -- ENDS --

Monday, June 28, 2010

74HC595







IC PACKAGING :

FOOTPRINT:

Footprint refers to the physical layout that is required on the printed circuit board in order to mount a component or physical attachment.


SOCKET:

Socket is nothing but attachment the printed circuit board 


PACKAGING:


Final stage in semiconductor device fabrication or simply device assembly.


 

TYPES OF PACKAGES:

  • Surface mount package.
  • Through hole package.
  • Contactless Packages.        

                            

Surface Mount Package:

Surface mount package is the IC packaging technique, in which the compounds are mounted on the Printed Circuit Board(PCB).Devices mounted on this technique are called Surface Mounted Devices(SMD).Technique is called Surface Mount Technique(SMT).


TYPES OF SMT:

There are different types SMD packagings, but in this we are seeing only few. Based on the materials

  • Ceramic
  • Plastic
  • Metal


 


 


 

QFP (Quad Flat Package) is a type of SMT having leads on the four sides.


 


Many versions of QFP are there, in this LQFP and TQFP are very special.LQFP stands for low profile QFP with leads on four sides ,numbering can done from anti clockwise from the point on the IC with pin spacing range from 0.4mm to 0.8mm.TQFP stands for Thin Quad Flat Package same as that of the QFP,with thin body(1.0mm)and have a standard lead footprint(2.0mm).


 

                LQFP                            TQFP            

SOIC(Small-Outline Integrated Circuit) is type of surface mount package with space requirement and thickness less than DIP(Dual In-line Package).                                                                        


 



 

THROUGH HOLE PACKAGE:

Through Hole is mounting scheme for electronic component that involves the use leads in the component.It provide a stronge mechanical bond when compared to surface mount.


 


 



 

There are different kinds of through hole package. DIP(Dual In-line Package) is a through hole package in which circuits can be packed densely compared to round packages.

Amplifier circuit for microphone


This is the circuit diagram for mic amplifier










Saturday, June 26, 2010

INTREFACING SHIFT REGISTER WITH ARDUINO

This document gives some detail about how to interface shift register with Arduino, and connecting 7 segment display with it.

SCHEMATIC:


The schematic above shows shift register IC74HC595.It has 16pins. Vcc=5V.1 Micro Farad Capacitor is used. In this one shift register is used, we have to use at least two shift register and two 7 segment display.

                            
 


PINS 1-7, 15

Q0 " Q7

Output Pins

PIN 8

GND

Ground, Vss

PIN 9

Q7"

Serial Out

PIN 10

MR

Master Reclear, active low

PIN 11

SH_CP

Shift register clock pin

PIN 12

ST_CP

Storage register clock pin (latch pin)

PIN 13

OE

Output enable, active low

PIN 14

DS

Serial data input

PIN 16

Vcc

Positive supply voltage


 


 


 


 


 


 


 


 


 


 


The schematic above shows 7 segment display either common Anode or common Cathode (here it is common Anode).

Program:


 

//Pin connected to ST_CP of 74HC595


 

int latchPin = 8;


 

//Pin connected to SH_CP of 74HC595


 

int clockPin = 12;


 

////Pin connected to DS of 74HC595


 

int dataPin = 11;


 

//Initializing the output pins


 

int k=B11111111;


 

int a;


 


 

void setup()

{


 

//set pins to output so you can control the shift register


 

pinMode(latchPin, OUTPUT);


 


 

pinMode(clockPin, OUTPUT);


 


 

pinMode(dataPin, OUTPUT);


 


 

Serial.begin(9600);


 


 

}


 


 

void loop()


 

{


 

// setting the output pins to show 1


 

k=B11111010;

\

// making latch pin low to shift


 

digitalWrite(latchPin, LOW);


 

// shift out the bits:


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 

// making latch pin high to store


 

digitalWrite(latchPin, HIGH);


 


 

delay(1000);


 

// print the value


 

Serial.print(k);


 

// setting the output pins to show 2


 

k=B10100100;


 

// making latch pin low to shift


 


 

digitalWrite(latchPin, LOW);


 

// shift out the bits: 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 

// making latch pin high to store


 


 

digitalWrite(latchPin, HIGH);


 

delay(1000);


 

// print the value


 

Serial.print(k);


 

// setting the output pins to show 3


 


 

k=B10110000;


 

// making latch pin low to shift


 


 

digitalWrite(latchPin, LOW);


 

// shift out the bits:


 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 

// making latch pin high to store


 

digitalWrite(latchPin, HIGH);


 

delay(1000);


 

// print the value


 


 

Serial.print(k);


 

// setting the output pins to show 4


 


 


 

k=B10011010;


 

// making latch pin low to shift


 


 

digitalWrite(latchPin, LOW);


 

// shift out the bits:


 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 

// making latch pin high to store


 


 

digitalWrite(latchPin, HIGH);


 


 

delay(1000);


 


 

// print the value


 


 

Serial.print(k);


 


 


 

// setting the output pins to show 5


 


 

k=B10010001;


 


 

// making latch pin low to shift


 

digitalWrite(latchPin, LOW);


 

// shift out the bits:


 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 

// making latch pin high to store


 


 

digitalWrite(latchPin, HIGH);


 


 

delay(1000);


 

// print the value


 


 

Serial.print(k);


 

// setting the output pins to show 6


 

k=B10000001;


 

// making latch pin low to shift


 


 

digitalWrite(latchPin, LOW);


 

// shift out the bits:


 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 


 

// making latch pin high to store


 


 

digitalWrite(latchPin, HIGH);


 


 

delay(1000);


 


 

// print the value


 


 

Serial.print(k);


 

// setting the output pins to show 7


 

k=B11111000;


 

// making latch pin low to shift


 

digitalWrite(latchPin, LOW);


 


 

// shift out the bits:


 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 


 

// making latch pin high to store


 


 

digitalWrite(latchPin, HIGH);


 


 

delay(1000);


 

// print the value


 


 

Serial.print(k);


 

// setting the output pins to show 8


 

k=B10000000;


 

// making latch pin low to shift


 

digitalWrite(latchPin, LOW);


 

// shift out the bits:


 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 

// making latch pin high to store


 

digitalWrite(latchPin, HIGH);


 


 

delay(1000);


 

// print the value


 


 

Serial.print(k);


 

// setting the output pins to show 9


 

k=B10010000;


 

// making latch pin low to shift


 

digitalWrite(latchPin, LOW);


 


 

// shift out the bits:


 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 

// making latch pin high to store


 


 

digitalWrite(latchPin, HIGH);


 


 

delay(1000);


 


 

// print the value


 


 

Serial.print(k);


 


 

// setting the output pins to show 0


 


 

k=B11000000;


 


 

// making latch pin low to shift


 


 

digitalWrite(latchPin, LOW);


 


 

// shift out the bits:


 


 


 

shiftOut(dataPin, clockPin, MSBFIRST, k);


 


 

// making latch pin high to store


 


 

digitalWrite(latchPin, HIGH);


 


 

delay(1000);


 


 

// print the value


 


 

Serial.print(k);


 


 


 


 


 

}


 


 


 


 


 

CONNECTING SHIFT REGISTER WITH ARDUINO:




 


 


 


 


 

If we want to use more than one shift register, we have to connect the Q7" (PIN 9) of the first shift register to the serial input pin (PIN 14) of the next shift register. If we want to connect more shift register the same (i.e. connecting the PIN 14 of the shift register with the PIN 9 of the previous shift register) procedure must be followed. connecting two shift register is shown below