SlideShare a Scribd company logo
1 of 20
Project name: Finger print based security system
These project utilize fingerprint recognition technology to allow access to only those
whose fingerprints you choose. It contains all the necessary electronics to allow you to
store, delete, and verify fingerprints with just the touch of a button. Stored fingerprints
are retained even in the event of complete power failure or battery drain. These
eliminates the need for keeping track of keys or remembering a combination password,
or PIN. It can only be opened when an authorized user is present, since there are no
keys or combinations to be copied or stolen, or locks that can be picked.
In this project the fingerprint module FPM10A is used. It can store up to 100 finger
prints on its own memory. It can be controlled through its serial port.
The microcontroller STC90LE58AD interacts with the module. You can add a fingerprint,
Delete a fingerprint and identify the fingerprint.
To add a fingerprint, just show the finger on the module and press the ADD key. Now
the microcontroller will send the ADD command to the module and the module will add
it into the memory.
To delete the finger follow the same as above.
To identify the finger, press the Identify button and if the finger matches then the Relay
is complemented. Also the fingerprint ID is displayed over the LCD display.
**All necessary materials and components are readily available at www.microscale-
embedded
FPM10A
1.Pin Definition
SD-FPM10A uses 1.0mm FPC socket which has 5 pins. The pin definition is as follows:
1 is VCC It’s between 3.6V and 5.5V
2 is GND
3 is TXD serial port sending
4 is RXD serial port receiving.
5 is NC floating
Components list
1. STC90LE58AD
2. 11.0592MHZ XTAL
3. FINGER PRINT MODULE (FPM10A)
4. 220V-12V TRANSFORMER
5. LM317
6. 7812 VOLTAGE REGULATOR
7. 2 K RESISTORS (X2NOS.)
8. 1K RESISTOR (1NOS.)
9. 10K RESISTOR (3 NOS.)
10.330 OHMS RESISTOR (1NOS.)
11.670 OHMS RESISTOR (1 NOS.)
12.2N2222 TRANSISTOR (2 NOS.)
13.BUZZER
14.12V DC RELAY
15.PUSH BUTTON SWITCH (3 NOS.)
*****C source codes below****
/********************************************************************************
*************************FINGER PRINT MODULE
CONTOLLER*****************************
**********************************************************************************/
#include <LIB_STC_MCU.h >
#include <stdio.h>
#include <LIB_FPM10A.h>
#include”Lib_Delay.c”
#include <lcd_4.h>
#include <Lib_Uart.h>
#include <intrins.h>
#include <string.h>
#define ON 1
#define OFF 0
sbit SAVE =P1^0; //save button
sbit DELETE =P1^1; //delete button
sbit MATCH =P1^2; //button to identify finger print
sbit BUZZER =P3^6;
sbit LOAD =P3^5;
void Store_Number_Fingerprint(void)
{
BUZZER=OFF;
FINGERPRINT_Cmd_vfypwd(); //enable pasword handshaing with module
array_ACK(11); //get
return or acknowledgement packet from module
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00) //if command successful
Lcd_Write(1,2,”VfyPwd_OK”);
else
//if command failure
{
Lcd_Write(1,2,”VfyPwd_ERROR”);
while(1);
}
Delay_ms(1000);
do{
FINGERPRINT_Cmd_Get_Img(); //get finger print features from scanner
array_ACK(12); //get return or acknowledgement packet
from module
if(receive_ACK[10]!=0×00)
{Lcd_Cmd(_LCD_CLEAR);
Lcd_Write(1,2,”No Finger”);
Lcd_Write(2,1,”Place Finger”);}
Delay_ms(1000);
}
while(receive_ACK[10]!=0×00);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Write(1,2,”Image_OK”);
Delay_ms(1000);
FINGERPRINT_Cmd_Img_To_Buffer1(); //save image features into buffer1
array_ACK(12); //get return or acknowledgement
packet from module
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00) Lcd_Write(1,2,”Img_to_Buff1_Ok”);
else Lcd_Write(1,2,”Img_to.._ERROR”);
Delay_ms(2000);
do{
FINGERPRINT_Cmd_Get_Img(); //get finger print features from scanner
array_ACK(12); //get return or acknowledgement packet
from module
if(receive_ACK[10]!=0×00)
{Lcd_Cmd(_LCD_CLEAR);
Lcd_Write(1,2,”No Finger”);
Lcd_Write(2,1,”Place Finger”);}
Delay_ms(1000);
}
while(receive_ACK[10]!=0×00);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Write(1,2,”Image_OK”);
Delay_ms(500);
Lcd_Write(1,2,”Remove Finger”);
Delay_ms(1000);
FINGERPRINT_Cmd_Img_To_Buffer2(); //save image features into buffer1
array_ACK(12); //get return or
acknowledgement packet from module
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00) Lcd_Write(1,2,”Img_to_Buff2_Ok”);
else Lcd_Write(1,2,”Img_to.._ERROR”);
Delay_ms(2000);
FINGERPRINT_Cmd_Reg_Model();
array_ACK(12);
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00)
Lcd_Write(1,2,”RegMode1_OK”);
else
Lcd_Write(1,2,”RegMode1_ERROR”);
Delay_ms(1000);
FINGERPRINT_Cmd_Get_Templete_Num(); //get template number
array_ACK(14); //get return or acknowledgement
packet from module
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00)
Lcd_Write(1,2,”TemplateNum_OK”);
else
Lcd_Write(1,2,”TemplateNum_ERROR”);
Templete_Num=(((int)receive_ACK[10]*256)+(int)receive_ACK[11]);
Lcd_Chr(2,2,Templete_Num);
Delay_ms(1000);
FINGERPRINT_Cmd_Store();
array_ACK(12);
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00)
Lcd_Write(1,2,”Reg_Store_OK “);
else
Lcd_Write(1,2,”Reg_Store_ERROR “);
FINGERPRINT_Cmd_Save_Finger(0,2);
array_ACK(12);
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00) Lcd_Write(1,2,”Save_OK “);
if(receive_ACK[10]==0×01) Lcd_Write(1,2,”Error “);
if(receive_ACK[10]==0x0b) Lcd_Write(1,2,”Out of range”);
if(receive_ACK[10]==0×18) Lcd_Write(1,2,”Flach Error”);
}
void main (void)
{
int flag,count,i=0;
BUZZER=OFF;
LOAD=OFF;
Uart_Init(57600);
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cursor(1,1);
Lcd_Write(1,1,”WELCOME”);
Delay_ms(1000);
while(1)
{
if(!SAVE)
Store_Number_Fingerprint();
if(!DELETE)
{
BUZZER=OFF;
FINGERPRINT_Cmd_Delete_All_Model(); //delete finger print
array_ACK(12) ;
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00) Lcd_Write(2,2,”Empty_Ok”);
if(receive_ACK[10]==0×01) Lcd_Write(2,2,”Empty_Error”);
if(receive_ACK[10]==0x0c) Lcd_Write(2,2,”Empty_Fail”);
}
if(!MATCH)
{
FINGERPRINT_Cmd_vfypwd(); //enable pasword handshaing with module
array_ACK(11);
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00) Lcd_Write(1,2,”VfyPwd_OK”);
else
{
Lcd_Write(1,2,”VfyPwd_ERROR”);
while(1);
}
Delay_ms(1000);
do{
FINGERPRINT_Cmd_Get_Img();
array_ACK(12);
if(receive_ACK[10]!=0×00) Lcd_Cmd(_LCD_CLEAR); {Lcd_Write(1,2,”No Finger”);
Lcd_Write(2,1,”Place Finger”);}
Delay_ms(1000);
}
while(receive_ACK[10]!=0×00);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Write(1,2,”Please Wait…”); Delay_ms(1000);
FINGERPRINT_Cmd_Img_To_Buffer1();
Delay_ms(1000);
FINGERPRINT_Cmd_Search_Finger(); //check for finger in flash memory
array_ACK(11);
Lcd_Cmd(_LCD_CLEAR);
if(receive_ACK[10]==0×00) {Lcd_Write(1,2,”Finger Match”);
if(flag==0)
{Lcd_Write(2,2,”Door Opened”);
LOAD=ON;
flag=1;}
else
{Lcd_Write(2,2,”Door Closed”);
LOAD=OFF;
flag=0;}
count=0;
}
if(receive_ACK[10]==0×01) Lcd_Write(2,2,”Match_Error”);
if(receive_ACK[10]==0×09) {Lcd_Write(1,2,”Not Match”);
Lcd_Write(2,2,”Try Again”);
count++ ;
if(count>3) {BUZZER=ON; //sound buzzer
count=0;
while(SAVE && DELETE && MATCH)
Lcd_Scroll(“ Sorry;;; You do not have access!!!”);}
}
}
}
}
Posted in 8051 Tutorials
4 Responses to Finger print based security system

embeded java master says:
March 7, 2012 at 11:18 am
wel d code is okay . but i dont tink is a good practise to make most section of d
program flow implemented in header file level. for d sake of some beginners , d header
file shud hav been neglected or shown ……
Log in to Reply
o
Sunday O. Efeh says:
May 7, 2012 at 5:28 pm
for those asking for the header files publication, I have added the header files I
used…… Regards
/******************************************************************
******************
*********************FPM10A HEADER / DRIVER ….WRITTEN BY
SUNDAY*******************
*****************COPY RIGHT … MICROSCALE EMBEDDED LTD. KADUNA
NIG.*****************
*******************************************************************
*****************/
#ifndef __LIB_FPM10A_H__
#define __LIB_FPM10A_H__
/******************************************************************
******************
************************************BASIC STORAGE
DEFINTION*************************
*******************************************************************
*****************/
char cnt;
unsigned int Templete_Num;
unsigned int ACK_Sum;
//unsigned char idata RECEVICE_BUFFER[24];
unsigned char idata receive_ACK[15];
//char idata receive_command[20];
/******************************************************************
******************
***************************FINGERPRINT PROTOCAL
DEFINITION**************************
*******************************************************************
*****************/
const unsigned char code FP_SetPwd[10] =
{0×01,0×00,0×07,0×12,0xff,0xff,0xff,0xff,0×04,0×16};
const unsigned char code FP_Pack_Head[6] = {0xEF,0×01,0xFF,0xFF,0xFF,0xFF};
//protcol header
const unsigned char code FP_VfyPwd[10] =
{0×01,0×00,0×07,0×13,0xff,0xff,0xff,0xff,0×04,0×17};
const unsigned char code FP_Get_Img[6] = {0×01,0×00,0×03,0×01,0×00,0×05};
//get/record fingerprint image
const unsigned char code FP_Templete_Num[6]
={0×01,0×00,0×03,0x1D,0×00,0×21 }; //get total number of template
const unsigned char data
FP_Search[11]={0×01,0×00,0×08,0×04,0×01,0×00,0×00,0×03,0xA1,0×0,0xB2};
//search range of fingeprints 0 – 929
const unsigned char data
FP_Search_0_9[11]={0×01,0×00,0×08,0×04,0×01,0×0,0×00,0×00,0×13,0×00,0
×21}; //search fingerprint no.0-9
unsigned char idata
FP_Img_To_Buffer1[7]={0×01,0×00,0×04,0×02,0×01,0×0,0×08}; //save image
to BUFFER1
unsigned char idata
FP_Img_To_Buffer2[7]={0×01,0×00,0×04,0×02,0×02,0×0,0×09}; //save image
to BUFFER2
unsigned char idata FP_Reg_Model[6]={0×01,0×00,0×03,0×05,0×0,0×09};
//Combine BUFFER1 and BUFFER2 to generate feature template
unsigned char idata FP_Delet_All_Model[6]={0×01,0×00,0×03,0x0d,0×00,0×11};
//clean up all templates in fingerprint module
unsigned char idata FP_Reg_Match[6]={0×01,0×00,0×03,0×03,0×00,0×07};
//compare charbuffer1 and charbuffer2
unsigned char
FP_Reg_Store[9]={0×01,0×00,0×06,0×06,0×02,0×00,0×00,0×00,0x0f}; //save
charbuffer2 to template ID0
unsigned char
FP_Reg_LoadChar[9]={0×01,0×00,0×06,0×07,0×02,0×00,0×00,0×00,0×10};
//read template ID0 to charbuffer2
volatile unsigned char idata
FP_Save_Finger[9]={0×01,0×00,0×06,0×06,0×01,0×00,0x0B,0×00,0×19};
//save the feature of BUFFER1 to specified position
volatile unsigned char idata
FP_Delete_Model[10]={0×01,0×00,0×07,0x0C,0×00,0×0,0×00,0×01,0×00,0×00}
;
/******************************************************************
******************
************************************ACK storage, 12
bytes****************************
*******************************************************************
*****************/
void array_ACK(unsigned char temp)
{
unsigned char i;
for( i=0;i<temp;i++)
{
receive_ACK[i]= getkey();
}
}
/******************************************************************
******************
************************************PASSWORD VERIFICATION
COMMAND*******************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_vfypwd(void)
{
unsigned char i;
for(i=0;i<6;i++) //send header
putchar(FP_Pack_Head[i]);
for(i=0;i<10;i++) //send command 0x1d
putchar(FP_VfyPwd[i]);
}
/******************************************************************
******************
************************************PASSWORD SET
COMMAND****************************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Setpwd(void)
{
unsigned char i;
for(i=0;i<6;i++) //send header
putchar(FP_Pack_Head[i]);
for(i=0;i<10;i++) //send command 0x1d
putchar(FP_SetPwd[i]);
}
/******************************************************************
******************
************************************GETS FINGER PRINT ON
SCANNER*********************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Get_Img(void)
{
unsigned char i;
for(i=0;i<6;i++) //send header
putchar(FP_Pack_Head[i]);
for(i=0;i<6;i++) //send command 0x1d
putchar(FP_Get_Img[i]);
}
/******************************************************************
******************
************************************SAVES IMAGE TO
BUFFER1****************************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Img_To_Buffer1(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<7;i++)
putchar(FP_Img_To_Buffer1[i]);
}
/******************************************************************
******************
************************************SAVES IMAGE TO
BUFFER2***************************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Img_To_Buffer2(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<7;i++)
putchar(FP_Img_To_Buffer2[i]);
}
/******************************************************************
******************
************************************REG MODEL BUFFER1 AND
BUFFER2********************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Reg_Model(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<6;i++)
putchar(FP_Reg_Model[i]);
}
/******************************************************************
******************
****************************COMPARES CONTENTS OF BUFFER1 AND
BUFFER2*****************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Match(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<6;i++)
putchar(FP_Reg_Match[i]);
}
/******************************************************************
******************
****************************STORES CONTENTS OF BUFFER1 AND
BUFFER2*****************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Store(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<9;i++)
putchar(FP_Reg_Store[i]);
}
/******************************************************************
******************
************************************ DATA TO BUFFER1 OR
BUFFER2**********************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_LoadChar(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<9;i++)
putchar(FP_Reg_LoadChar[i]);
}
/******************************************************************
******************
**********************************DELETES ALL FINGER PRINT
MODULES******************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Delete_All_Model(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i>8;
FP_Delete_Model[5]=(uiID_temp&0x00FF);
for(i=0;i>8;
FP_Delete_Model[9]=uiSum_temp&0x00FF;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<10;i++)
putchar(FP_Delete_Model[i]);
}
/******************************************************************
******************
************************************GETS TEMPLATE NUMBER
****************************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Get_Templete_Num(void)
{ unsigned int i;
// unsigned char temp[14];
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<6;i++)
putchar(FP_Templete_Num[i]);
}
/******************************************************************
******************
*****************SEARCHES FINGER PRINT MODULE
***************************************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Search_Finger(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<11;i++)
putchar(FP_Search[i]);
}
/******************************************************************
******************
******************************SEARCHES FINGER PRINT MODULE
**************************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Search_Finger_Admin(void)
{
unsigned char i;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i<11;i++)
putchar(FP_Search_0_9[i]);
}
/******************************************************************
******************
************************************SAVES FINGER PRINT
MODULE************************
*******************************************************************
*****************/
void FINGERPRINT_Cmd_Save_Finger( unsigned char ucH_Char,unsigned char
ucL_Char )
{
unsigned long temp = 0;
unsigned char i;
FP_Save_Finger[5] = ucH_Char;
FP_Save_Finger[6] = ucL_Char;
for(i=0;i> 8;
FP_Save_Finger[8]= temp & 0x0000FF;
for(i=0;i<6;i++)
putchar(FP_Pack_Head[i]);
for(i=0;i> 4) & 0x0F)|LCD_EN;
DATA_PORT = ((cmd >> 4) & 0x0F);
DATA_PORT = (cmd & 0x0F)|LCD_EN;
DATA_PORT = (cmd & 0x0F);
Delay_ms(10);
}
/******************************************************************
***********************
*********************FUNCTION TO DISPLAY CHARACTER ON THE
LCD********************************
*******************************************************************
**********************/
void Lcd_Data (unsigned dat)
{
DATA_PORT = (((dat >> 4) & 0x0F)|LCD_EN|LCD_RS);
DATA_PORT = (((dat >> 4) & 0x0F)|LCD_RS);
DATA_PORT = ((dat & 0x0F)|LCD_EN|LCD_RS);
DATA_PORT = ((dat & 0x0F)|LCD_RS);
Delay_ms(5);
}
/******************************************************************
***********************
*********************LCD INITIALIZATION
PARAMETERS****************************************
*******************************************************************
**********************/
void Lcd_Init ()
{
Lcd_Reset(); // Call LCD reset
Lcd_Cmd (0×28); // 4-bit mode – 2 line – 5×7 font.
Lcd_Cmd (0x0C); // Display no cursor – no blink.
Lcd_Cmd (0×06); // Automatic Increment – No Display shift.
Lcd_Cmd (0×80); // Address DDRAM with 0 offset 80h.
}
/******************************************************************
***********************
*********************PLACES THE LCD CURSOR AT ANY POSITION ON THE
DISPLY******************
*******************************************************************
**********************/
void Lcd_Cursor (char row, char column)
{
switch (row) {
case 1: Lcd_Cmd (0×80 + column – 1); break;
case 2: Lcd_Cmd (0xc0 + column – 1); break;
//case 3: Lcd_Cmd(0×94 + column – 1); break;
// case 4: Lcd_Cmd (0xd4 + column – 1); break;
default: break;
}
}
/******************************************************************
***********************
*********************FUNCTION TO DISPLAY STRING ON THE
LCD********************************
*******************************************************************
**********************
void Lcd_Chr(char row, char column, char c)
{
Lcd_Cursor (row, column);
Lcd_Data(c);
}
/******************************************************************
***********************
*********************FUNCTION TO DISPLAY STRING ON THE
LCD********************************
*******************************************************************
**********************/
void Lcd_Write(char row, char column, char *s)
{
Lcd_Cursor (row, column);
while (*s)
{
Lcd_Data(*(s++));
}
return;
}
/******************************************************************
***********************
*********************SCROLLS TEXT ON LCD
SCREEN*******************************************
*******************************************************************
********************** /
void Lcd_Scroll(char *word)
{
char *pos; // character pointers
char *adder;
int i,displayLen;
pos=word;
displayLen=16;
while (*pos != ”)
{
i=0;
adder=pos;
while ((i<displayLen)&&(*adder!=''))
{
Lcd_Data(*adder);
adder++;
i++;
}
Delay_ms(200);
Lcd_Cmd(_LCD_CLEAR);
pos++;
}
}
/******************************************************************
***********************
*********************DISPLAY CHARACTER ON LCD AND
USART***********************************
*******************************************************************
**********************/
#endif
/******************************************************************
***********************
********ENLOY*************ENJOY***********ENJOY***************ENJO
Y*************ENJOY******
*******************************************************************
**********************/
Lib _Uart.h
/******************************************************************
*********
(((((((((((((((((((((((((((UART ..HEADER FILE…SUNDAY))))))))))))))))))))))
*******************************************************************
*********/
#ifndef __Lb_Uart_H__
#define __Lb_Uart_H__
#define FOSC 11059200//11059200 ///xtal value
/******************************************************************
*********
(((((((((((((((((((((((((((BACIC SERIAL COM INITIALS))))))))))))))))))))))))
*******************************************************************
*********/
void Uart_Init(unsigned long BPS)
{
#ifndef MONITOR51
SCON = 0×50; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0×21; /* TMOD: timer 1, mode 2, 8-bit reload */
if(BPS==1200) {TH1=0xE8;TL1=0xE;}
if(BPS==2400) {TH1=0xF4;TL1=0xF4;}
if(BPS==4800) {TH1=0xFA;TL1=0xFA;}
if(BPS==9600) {TH1=0xFD;TL1=0xFD;}
if(BPS==19200) {TH1=0xFD;TL1=0xFD; PCON=0×80;}
if(BPS==28800) {TH1=0xFF;TL1=0xFF; }
if(BPS==38400) {TH1=0xFE;TL1=0xFE;;PCON=0×80;}
if(BPS==57600) {TH1=0xFF;TL1=0xFF;PCON=0×80;}
TR1 = 1; /* TR1: timer 1 run */
TI = 1; /* TI: set TI to send first char of UART */
#endif
}
#endif
/******************************************************************
*********
((((((((((NOTE:The baud rate is accurate only at values ranging))))))))))))
(((((((from 9600 to 1200////any bps above 9600 gives errors))))))))))))///
*******************************************************************
*********/
Lib_Delay.h
/******************************************************************
***********************
*********************LIB_DELAY.H FOR 8051
***********************************
*******************************************************************
**********************/
#ifndef Lib_Delay_H_
#define Lib_Delay_H_
#include
#define XTAL 11059200
unsigned char Delay8Plus2xCycles (unsigned char x);
unsigned char Delay8Plus2nCycles (unsigned char LoopCount)
{
while (–LoopCount);
return (LoopCount);
}
#define Crystal 11059200L /* Crystal speed */
#define ClockRes (Crystal/12) /* Clock ticks per second */
#define NanoSecondsPerCycle (1000000000L / ClockRes)
#define uSecToInstCycles(x) ((1000L * (x)) / NanoSecondsPerCycle)
/*
#define NOPS(x) 
(((x) & 1) ? _nop_() : 0), 
(((x) & 2) ? _nop_(),_nop_() : 0), 
(((x) & 4) ? _nop_(),_nop_(),_nop_(),_nop_() : 0), 
(((x) & ? _nop_(),_nop_(),_nop_(),_nop_(),_nop_(),_nop_(),_nop_(),_nop_() :
0)*/
/******************************************************************
***********************
******************** *MICRO SEC DELAY MACRO
***************************
*******************************************************************
**********************/
#define Delay_us(InstCycles) 
(((InstCycles) & 1) ? _nop_() : 0), 
(((InstCycles) & 2) ? _nop_(),_nop_() : 0), 
(((InstCycles) & ~7) ? Delay8Plus2nCycles(((InstCycles/4)-2)*2) 
: (((InstCycles) & 4) ? _nop_(),_nop_(),_nop_(),_nop_() : 0))
/******************************************************************
***********************
******************** *DELAY IN MILI SECONDS
***********************************
*******************************************************************
**********************/
void Delay_ms(unsigned Time_ms) ;
void Delay_ms(unsigned Time_ms) {
unsigned long NumberOfCyc;
NumberOfCyc =XTAL / 12000; // this will be done by compiler, no asm will be
genereated except that for assignment;
NumberOfCyc = NumberOfCyc * Time_ms;
NumberOfCyc = NumberOfCyc >> 5; // Dec and While below take around 32
instructions
if (NumberOfCyc > NumberOfCyc -= 8;
else
NumberOfCyc = 0;
while (NumberOfCyc) // while loop takes 32 cycles
{ //
–NumberOfCyc; //
_nop_(); //
_nop_(); //
_nop_(); //
}
}
/******************************************************************
***********************
********************* THE END **********************************
*******************************************************************
**********************/
#endif
/******************************************************************
***********************
********************* PLEASE DONOT EDIT
**********************************
*******************************************************************
**********************/
Log in to Reply

More Related Content

Viewers also liked

Locker opening and closing system using rfid password and gsm
Locker opening and closing system using rfid password and gsmLocker opening and closing system using rfid password and gsm
Locker opening and closing system using rfid password and gsmSai Kumar
 
Bio technology parks
Bio technology  parksBio technology  parks
Bio technology parksJay Choudhary
 
Keypad Based Bank Locker Security System Using Gsm Technology
Keypad Based Bank Locker Security System Using Gsm TechnologyKeypad Based Bank Locker Security System Using Gsm Technology
Keypad Based Bank Locker Security System Using Gsm TechnologyIJRES Journal
 
SCIENCE AND TECHNOLOGY OF KNOWLEDGE INDUSTRY AND TRANSFORMING BRAIN POWER INT...
SCIENCE AND TECHNOLOGY OF KNOWLEDGE INDUSTRY AND TRANSFORMING BRAIN POWER INT...SCIENCE AND TECHNOLOGY OF KNOWLEDGE INDUSTRY AND TRANSFORMING BRAIN POWER INT...
SCIENCE AND TECHNOLOGY OF KNOWLEDGE INDUSTRY AND TRANSFORMING BRAIN POWER INT...Dr. Raju M. Mathew
 
Bi directional visitor counter rewat
Bi directional visitor counter   rewatBi directional visitor counter   rewat
Bi directional visitor counter rewatvishwesh sharma
 
Bio-Metric Technology
Bio-Metric TechnologyBio-Metric Technology
Bio-Metric Technologyshyampariyar
 
Fingerprint base security system
Fingerprint base security systemFingerprint base security system
Fingerprint base security systempraful borad
 
Fingerprint base security system
Fingerprint base security systemFingerprint base security system
Fingerprint base security systempraful borad
 
Finger print based door access system
Finger print based door access systemFinger print based door access system
Finger print based door access systemAkshay Govekar
 
Bank locker system
Bank locker systemBank locker system
Bank locker systemRahul Wagh
 
Introduction to biometric systems security
Introduction to biometric systems securityIntroduction to biometric systems security
Introduction to biometric systems securitySelf
 
gsm based security system
gsm based security systemgsm based security system
gsm based security systemnayandey
 
Fingerprint based security system
Fingerprint based security systemFingerprint based security system
Fingerprint based security systemPadmakar Mangrule
 
Project report on bidirectional visitor counter & home automation
Project report on bidirectional visitor counter & home automationProject report on bidirectional visitor counter & home automation
Project report on bidirectional visitor counter & home automationRoshan Mani
 
Cancer Biology
Cancer BiologyCancer Biology
Cancer BiologyPhil Mayor
 
Biology Investigatory Project-Class XII-Breast Cancer
Biology Investigatory Project-Class XII-Breast CancerBiology Investigatory Project-Class XII-Breast Cancer
Biology Investigatory Project-Class XII-Breast Cancerlallu4
 
Biology 30 case study project
Biology 30 case study project Biology 30 case study project
Biology 30 case study project mmhth
 

Viewers also liked (20)

Locker opening and closing system using rfid password and gsm
Locker opening and closing system using rfid password and gsmLocker opening and closing system using rfid password and gsm
Locker opening and closing system using rfid password and gsm
 
Bio technology parks
Bio technology  parksBio technology  parks
Bio technology parks
 
Keypad Based Bank Locker Security System Using Gsm Technology
Keypad Based Bank Locker Security System Using Gsm TechnologyKeypad Based Bank Locker Security System Using Gsm Technology
Keypad Based Bank Locker Security System Using Gsm Technology
 
SCIENCE AND TECHNOLOGY OF KNOWLEDGE INDUSTRY AND TRANSFORMING BRAIN POWER INT...
SCIENCE AND TECHNOLOGY OF KNOWLEDGE INDUSTRY AND TRANSFORMING BRAIN POWER INT...SCIENCE AND TECHNOLOGY OF KNOWLEDGE INDUSTRY AND TRANSFORMING BRAIN POWER INT...
SCIENCE AND TECHNOLOGY OF KNOWLEDGE INDUSTRY AND TRANSFORMING BRAIN POWER INT...
 
Bi directional visitor counter rewat
Bi directional visitor counter   rewatBi directional visitor counter   rewat
Bi directional visitor counter rewat
 
Bio-Metric Technology
Bio-Metric TechnologyBio-Metric Technology
Bio-Metric Technology
 
Fingerprint base security system
Fingerprint base security systemFingerprint base security system
Fingerprint base security system
 
Fingerprint base security system
Fingerprint base security systemFingerprint base security system
Fingerprint base security system
 
Finger print based door access system
Finger print based door access systemFinger print based door access system
Finger print based door access system
 
Bank locker system
Bank locker systemBank locker system
Bank locker system
 
Introduction to biometric systems security
Introduction to biometric systems securityIntroduction to biometric systems security
Introduction to biometric systems security
 
gsm based security system
gsm based security systemgsm based security system
gsm based security system
 
Fingerprint based security system
Fingerprint based security systemFingerprint based security system
Fingerprint based security system
 
Project report on bidirectional visitor counter & home automation
Project report on bidirectional visitor counter & home automationProject report on bidirectional visitor counter & home automation
Project report on bidirectional visitor counter & home automation
 
Gsm based control system
Gsm based control systemGsm based control system
Gsm based control system
 
Cancer Biology
Cancer BiologyCancer Biology
Cancer Biology
 
Biology Investigatory Project-Class XII-Breast Cancer
Biology Investigatory Project-Class XII-Breast CancerBiology Investigatory Project-Class XII-Breast Cancer
Biology Investigatory Project-Class XII-Breast Cancer
 
biometrics
biometricsbiometrics
biometrics
 
Biology project
Biology projectBiology project
Biology project
 
Biology 30 case study project
Biology 30 case study project Biology 30 case study project
Biology 30 case study project
 

Similar to Fingerprint base security system

m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for recordG Lemuel George
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counterMafaz Ahmed
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMR Selamet
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdsiti_haryani
 
Monitoring Temperature Room With Display LCD and Data Recording
Monitoring Temperature Room With Display LCD and Data RecordingMonitoring Temperature Room With Display LCD and Data Recording
Monitoring Temperature Room With Display LCD and Data RecordingMR Selamet
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdmukhammadimam
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 aroosa khan
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2srknec
 
Keypad locking system using 8051
Keypad locking system using 8051Keypad locking system using 8051
Keypad locking system using 8051manu anand
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingYuda Wardiana
 
summer training report (2)
summer training report (2)summer training report (2)
summer training report (2)Kavya Gupta
 
MEmento Final Presentation
MEmento Final PresentationMEmento Final Presentation
MEmento Final PresentationGiovanniDeLuca20
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdmukhammadimam
 

Similar to Fingerprint base security system (20)

m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for record
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counter
 
Presentation acs-03
Presentation acs-03Presentation acs-03
Presentation acs-03
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recording
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcd
 
Basic standard calculator
Basic standard calculatorBasic standard calculator
Basic standard calculator
 
Monitoring Temperature Room With Display LCD and Data Recording
Monitoring Temperature Room With Display LCD and Data RecordingMonitoring Temperature Room With Display LCD and Data Recording
Monitoring Temperature Room With Display LCD and Data Recording
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcd
 
Password based door locksystem
Password  based door locksystemPassword  based door locksystem
Password based door locksystem
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
 
Reporte vhd10
Reporte vhd10Reporte vhd10
Reporte vhd10
 
Keypad locking system using 8051
Keypad locking system using 8051Keypad locking system using 8051
Keypad locking system using 8051
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recording
 
summer training report (2)
summer training report (2)summer training report (2)
summer training report (2)
 
MEmento Final Presentation
MEmento Final PresentationMEmento Final Presentation
MEmento Final Presentation
 
Direct analog
Direct analogDirect analog
Direct analog
 
Lampiran 1.programdocx
Lampiran 1.programdocxLampiran 1.programdocx
Lampiran 1.programdocx
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcd
 

Recently uploaded

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 

Recently uploaded (20)

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 

Fingerprint base security system

  • 1. Project name: Finger print based security system These project utilize fingerprint recognition technology to allow access to only those whose fingerprints you choose. It contains all the necessary electronics to allow you to store, delete, and verify fingerprints with just the touch of a button. Stored fingerprints are retained even in the event of complete power failure or battery drain. These eliminates the need for keeping track of keys or remembering a combination password, or PIN. It can only be opened when an authorized user is present, since there are no keys or combinations to be copied or stolen, or locks that can be picked. In this project the fingerprint module FPM10A is used. It can store up to 100 finger prints on its own memory. It can be controlled through its serial port. The microcontroller STC90LE58AD interacts with the module. You can add a fingerprint, Delete a fingerprint and identify the fingerprint. To add a fingerprint, just show the finger on the module and press the ADD key. Now the microcontroller will send the ADD command to the module and the module will add it into the memory. To delete the finger follow the same as above.
  • 2. To identify the finger, press the Identify button and if the finger matches then the Relay is complemented. Also the fingerprint ID is displayed over the LCD display. **All necessary materials and components are readily available at www.microscale- embedded FPM10A 1.Pin Definition SD-FPM10A uses 1.0mm FPC socket which has 5 pins. The pin definition is as follows: 1 is VCC It’s between 3.6V and 5.5V 2 is GND 3 is TXD serial port sending 4 is RXD serial port receiving. 5 is NC floating Components list 1. STC90LE58AD 2. 11.0592MHZ XTAL 3. FINGER PRINT MODULE (FPM10A) 4. 220V-12V TRANSFORMER 5. LM317 6. 7812 VOLTAGE REGULATOR 7. 2 K RESISTORS (X2NOS.) 8. 1K RESISTOR (1NOS.) 9. 10K RESISTOR (3 NOS.) 10.330 OHMS RESISTOR (1NOS.) 11.670 OHMS RESISTOR (1 NOS.) 12.2N2222 TRANSISTOR (2 NOS.) 13.BUZZER 14.12V DC RELAY 15.PUSH BUTTON SWITCH (3 NOS.) *****C source codes below**** /********************************************************************************
  • 3. *************************FINGER PRINT MODULE CONTOLLER***************************** **********************************************************************************/ #include <LIB_STC_MCU.h > #include <stdio.h> #include <LIB_FPM10A.h> #include”Lib_Delay.c” #include <lcd_4.h> #include <Lib_Uart.h> #include <intrins.h> #include <string.h> #define ON 1 #define OFF 0 sbit SAVE =P1^0; //save button sbit DELETE =P1^1; //delete button sbit MATCH =P1^2; //button to identify finger print sbit BUZZER =P3^6; sbit LOAD =P3^5; void Store_Number_Fingerprint(void) { BUZZER=OFF; FINGERPRINT_Cmd_vfypwd(); //enable pasword handshaing with module array_ACK(11); //get return or acknowledgement packet from module Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) //if command successful Lcd_Write(1,2,”VfyPwd_OK”); else //if command failure {
  • 4. Lcd_Write(1,2,”VfyPwd_ERROR”); while(1); } Delay_ms(1000); do{ FINGERPRINT_Cmd_Get_Img(); //get finger print features from scanner array_ACK(12); //get return or acknowledgement packet from module if(receive_ACK[10]!=0×00) {Lcd_Cmd(_LCD_CLEAR); Lcd_Write(1,2,”No Finger”); Lcd_Write(2,1,”Place Finger”);} Delay_ms(1000); } while(receive_ACK[10]!=0×00); Lcd_Cmd(_LCD_CLEAR); Lcd_Write(1,2,”Image_OK”); Delay_ms(1000); FINGERPRINT_Cmd_Img_To_Buffer1(); //save image features into buffer1 array_ACK(12); //get return or acknowledgement packet from module Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) Lcd_Write(1,2,”Img_to_Buff1_Ok”); else Lcd_Write(1,2,”Img_to.._ERROR”); Delay_ms(2000); do{ FINGERPRINT_Cmd_Get_Img(); //get finger print features from scanner array_ACK(12); //get return or acknowledgement packet from module if(receive_ACK[10]!=0×00)
  • 5. {Lcd_Cmd(_LCD_CLEAR); Lcd_Write(1,2,”No Finger”); Lcd_Write(2,1,”Place Finger”);} Delay_ms(1000); } while(receive_ACK[10]!=0×00); Lcd_Cmd(_LCD_CLEAR); Lcd_Write(1,2,”Image_OK”); Delay_ms(500); Lcd_Write(1,2,”Remove Finger”); Delay_ms(1000); FINGERPRINT_Cmd_Img_To_Buffer2(); //save image features into buffer1 array_ACK(12); //get return or acknowledgement packet from module Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) Lcd_Write(1,2,”Img_to_Buff2_Ok”); else Lcd_Write(1,2,”Img_to.._ERROR”); Delay_ms(2000); FINGERPRINT_Cmd_Reg_Model(); array_ACK(12); Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) Lcd_Write(1,2,”RegMode1_OK”); else Lcd_Write(1,2,”RegMode1_ERROR”); Delay_ms(1000); FINGERPRINT_Cmd_Get_Templete_Num(); //get template number array_ACK(14); //get return or acknowledgement packet from module Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00)
  • 6. Lcd_Write(1,2,”TemplateNum_OK”); else Lcd_Write(1,2,”TemplateNum_ERROR”); Templete_Num=(((int)receive_ACK[10]*256)+(int)receive_ACK[11]); Lcd_Chr(2,2,Templete_Num); Delay_ms(1000); FINGERPRINT_Cmd_Store(); array_ACK(12); Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) Lcd_Write(1,2,”Reg_Store_OK “); else Lcd_Write(1,2,”Reg_Store_ERROR “); FINGERPRINT_Cmd_Save_Finger(0,2); array_ACK(12); Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) Lcd_Write(1,2,”Save_OK “); if(receive_ACK[10]==0×01) Lcd_Write(1,2,”Error “); if(receive_ACK[10]==0x0b) Lcd_Write(1,2,”Out of range”); if(receive_ACK[10]==0×18) Lcd_Write(1,2,”Flach Error”); } void main (void) { int flag,count,i=0; BUZZER=OFF; LOAD=OFF; Uart_Init(57600); Lcd_Init(); Lcd_Cmd(_LCD_CLEAR);
  • 7. Lcd_Cursor(1,1); Lcd_Write(1,1,”WELCOME”); Delay_ms(1000); while(1) { if(!SAVE) Store_Number_Fingerprint(); if(!DELETE) { BUZZER=OFF; FINGERPRINT_Cmd_Delete_All_Model(); //delete finger print array_ACK(12) ; Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) Lcd_Write(2,2,”Empty_Ok”); if(receive_ACK[10]==0×01) Lcd_Write(2,2,”Empty_Error”); if(receive_ACK[10]==0x0c) Lcd_Write(2,2,”Empty_Fail”); } if(!MATCH) { FINGERPRINT_Cmd_vfypwd(); //enable pasword handshaing with module array_ACK(11); Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) Lcd_Write(1,2,”VfyPwd_OK”); else { Lcd_Write(1,2,”VfyPwd_ERROR”); while(1); } Delay_ms(1000);
  • 8. do{ FINGERPRINT_Cmd_Get_Img(); array_ACK(12); if(receive_ACK[10]!=0×00) Lcd_Cmd(_LCD_CLEAR); {Lcd_Write(1,2,”No Finger”); Lcd_Write(2,1,”Place Finger”);} Delay_ms(1000); } while(receive_ACK[10]!=0×00); Lcd_Cmd(_LCD_CLEAR); Lcd_Write(1,2,”Please Wait…”); Delay_ms(1000); FINGERPRINT_Cmd_Img_To_Buffer1(); Delay_ms(1000); FINGERPRINT_Cmd_Search_Finger(); //check for finger in flash memory array_ACK(11); Lcd_Cmd(_LCD_CLEAR); if(receive_ACK[10]==0×00) {Lcd_Write(1,2,”Finger Match”); if(flag==0) {Lcd_Write(2,2,”Door Opened”); LOAD=ON; flag=1;} else {Lcd_Write(2,2,”Door Closed”); LOAD=OFF; flag=0;} count=0; } if(receive_ACK[10]==0×01) Lcd_Write(2,2,”Match_Error”); if(receive_ACK[10]==0×09) {Lcd_Write(1,2,”Not Match”); Lcd_Write(2,2,”Try Again”); count++ ;
  • 9. if(count>3) {BUZZER=ON; //sound buzzer count=0; while(SAVE && DELETE && MATCH) Lcd_Scroll(“ Sorry;;; You do not have access!!!”);} } } } } Posted in 8051 Tutorials 4 Responses to Finger print based security system  embeded java master says: March 7, 2012 at 11:18 am wel d code is okay . but i dont tink is a good practise to make most section of d program flow implemented in header file level. for d sake of some beginners , d header file shud hav been neglected or shown …… Log in to Reply o Sunday O. Efeh says: May 7, 2012 at 5:28 pm for those asking for the header files publication, I have added the header files I used…… Regards /****************************************************************** ****************** *********************FPM10A HEADER / DRIVER ….WRITTEN BY SUNDAY******************* *****************COPY RIGHT … MICROSCALE EMBEDDED LTD. KADUNA NIG.***************** ******************************************************************* *****************/ #ifndef __LIB_FPM10A_H__ #define __LIB_FPM10A_H__ /****************************************************************** ****************** ************************************BASIC STORAGE
  • 10. DEFINTION************************* ******************************************************************* *****************/ char cnt; unsigned int Templete_Num; unsigned int ACK_Sum; //unsigned char idata RECEVICE_BUFFER[24]; unsigned char idata receive_ACK[15]; //char idata receive_command[20]; /****************************************************************** ****************** ***************************FINGERPRINT PROTOCAL DEFINITION************************** ******************************************************************* *****************/ const unsigned char code FP_SetPwd[10] = {0×01,0×00,0×07,0×12,0xff,0xff,0xff,0xff,0×04,0×16}; const unsigned char code FP_Pack_Head[6] = {0xEF,0×01,0xFF,0xFF,0xFF,0xFF}; //protcol header const unsigned char code FP_VfyPwd[10] = {0×01,0×00,0×07,0×13,0xff,0xff,0xff,0xff,0×04,0×17}; const unsigned char code FP_Get_Img[6] = {0×01,0×00,0×03,0×01,0×00,0×05}; //get/record fingerprint image const unsigned char code FP_Templete_Num[6] ={0×01,0×00,0×03,0x1D,0×00,0×21 }; //get total number of template const unsigned char data FP_Search[11]={0×01,0×00,0×08,0×04,0×01,0×00,0×00,0×03,0xA1,0×0,0xB2}; //search range of fingeprints 0 – 929 const unsigned char data FP_Search_0_9[11]={0×01,0×00,0×08,0×04,0×01,0×0,0×00,0×00,0×13,0×00,0 ×21}; //search fingerprint no.0-9 unsigned char idata FP_Img_To_Buffer1[7]={0×01,0×00,0×04,0×02,0×01,0×0,0×08}; //save image to BUFFER1 unsigned char idata FP_Img_To_Buffer2[7]={0×01,0×00,0×04,0×02,0×02,0×0,0×09}; //save image to BUFFER2 unsigned char idata FP_Reg_Model[6]={0×01,0×00,0×03,0×05,0×0,0×09}; //Combine BUFFER1 and BUFFER2 to generate feature template unsigned char idata FP_Delet_All_Model[6]={0×01,0×00,0×03,0x0d,0×00,0×11}; //clean up all templates in fingerprint module unsigned char idata FP_Reg_Match[6]={0×01,0×00,0×03,0×03,0×00,0×07}; //compare charbuffer1 and charbuffer2 unsigned char FP_Reg_Store[9]={0×01,0×00,0×06,0×06,0×02,0×00,0×00,0×00,0x0f}; //save charbuffer2 to template ID0 unsigned char FP_Reg_LoadChar[9]={0×01,0×00,0×06,0×07,0×02,0×00,0×00,0×00,0×10}; //read template ID0 to charbuffer2 volatile unsigned char idata
  • 11. FP_Save_Finger[9]={0×01,0×00,0×06,0×06,0×01,0×00,0x0B,0×00,0×19}; //save the feature of BUFFER1 to specified position volatile unsigned char idata FP_Delete_Model[10]={0×01,0×00,0×07,0x0C,0×00,0×0,0×00,0×01,0×00,0×00} ; /****************************************************************** ****************** ************************************ACK storage, 12 bytes**************************** ******************************************************************* *****************/ void array_ACK(unsigned char temp) { unsigned char i; for( i=0;i<temp;i++) { receive_ACK[i]= getkey(); } } /****************************************************************** ****************** ************************************PASSWORD VERIFICATION COMMAND******************* ******************************************************************* *****************/ void FINGERPRINT_Cmd_vfypwd(void) { unsigned char i; for(i=0;i<6;i++) //send header putchar(FP_Pack_Head[i]); for(i=0;i<10;i++) //send command 0x1d putchar(FP_VfyPwd[i]); } /****************************************************************** ****************** ************************************PASSWORD SET COMMAND**************************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Setpwd(void) { unsigned char i; for(i=0;i<6;i++) //send header putchar(FP_Pack_Head[i]); for(i=0;i<10;i++) //send command 0x1d putchar(FP_SetPwd[i]); }
  • 12. /****************************************************************** ****************** ************************************GETS FINGER PRINT ON SCANNER********************* ******************************************************************* *****************/ void FINGERPRINT_Cmd_Get_Img(void) { unsigned char i; for(i=0;i<6;i++) //send header putchar(FP_Pack_Head[i]); for(i=0;i<6;i++) //send command 0x1d putchar(FP_Get_Img[i]); } /****************************************************************** ****************** ************************************SAVES IMAGE TO BUFFER1**************************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Img_To_Buffer1(void) { unsigned char i; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<7;i++) putchar(FP_Img_To_Buffer1[i]); } /****************************************************************** ****************** ************************************SAVES IMAGE TO BUFFER2*************************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Img_To_Buffer2(void) { unsigned char i; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<7;i++) putchar(FP_Img_To_Buffer2[i]); } /****************************************************************** ****************** ************************************REG MODEL BUFFER1 AND BUFFER2******************** ******************************************************************* *****************/
  • 13. void FINGERPRINT_Cmd_Reg_Model(void) { unsigned char i; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<6;i++) putchar(FP_Reg_Model[i]); } /****************************************************************** ****************** ****************************COMPARES CONTENTS OF BUFFER1 AND BUFFER2***************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Match(void) { unsigned char i; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<6;i++) putchar(FP_Reg_Match[i]); } /****************************************************************** ****************** ****************************STORES CONTENTS OF BUFFER1 AND BUFFER2***************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Store(void) { unsigned char i; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<9;i++) putchar(FP_Reg_Store[i]); } /****************************************************************** ****************** ************************************ DATA TO BUFFER1 OR BUFFER2********************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_LoadChar(void) { unsigned char i; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]);
  • 14. for(i=0;i<9;i++) putchar(FP_Reg_LoadChar[i]); } /****************************************************************** ****************** **********************************DELETES ALL FINGER PRINT MODULES****************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Delete_All_Model(void) { unsigned char i; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i>8; FP_Delete_Model[5]=(uiID_temp&0x00FF); for(i=0;i>8; FP_Delete_Model[9]=uiSum_temp&0x00FF; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<10;i++) putchar(FP_Delete_Model[i]); } /****************************************************************** ****************** ************************************GETS TEMPLATE NUMBER **************************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Get_Templete_Num(void) { unsigned int i; // unsigned char temp[14]; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<6;i++) putchar(FP_Templete_Num[i]); } /****************************************************************** ****************** *****************SEARCHES FINGER PRINT MODULE *************************************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Search_Finger(void) { unsigned char i;
  • 15. for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<11;i++) putchar(FP_Search[i]); } /****************************************************************** ****************** ******************************SEARCHES FINGER PRINT MODULE ************************** ******************************************************************* *****************/ void FINGERPRINT_Cmd_Search_Finger_Admin(void) { unsigned char i; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i<11;i++) putchar(FP_Search_0_9[i]); } /****************************************************************** ****************** ************************************SAVES FINGER PRINT MODULE************************ ******************************************************************* *****************/ void FINGERPRINT_Cmd_Save_Finger( unsigned char ucH_Char,unsigned char ucL_Char ) { unsigned long temp = 0; unsigned char i; FP_Save_Finger[5] = ucH_Char; FP_Save_Finger[6] = ucL_Char; for(i=0;i> 8; FP_Save_Finger[8]= temp & 0x0000FF; for(i=0;i<6;i++) putchar(FP_Pack_Head[i]); for(i=0;i> 4) & 0x0F)|LCD_EN; DATA_PORT = ((cmd >> 4) & 0x0F); DATA_PORT = (cmd & 0x0F)|LCD_EN; DATA_PORT = (cmd & 0x0F); Delay_ms(10); } /****************************************************************** *********************** *********************FUNCTION TO DISPLAY CHARACTER ON THE
  • 16. LCD******************************** ******************************************************************* **********************/ void Lcd_Data (unsigned dat) { DATA_PORT = (((dat >> 4) & 0x0F)|LCD_EN|LCD_RS); DATA_PORT = (((dat >> 4) & 0x0F)|LCD_RS); DATA_PORT = ((dat & 0x0F)|LCD_EN|LCD_RS); DATA_PORT = ((dat & 0x0F)|LCD_RS); Delay_ms(5); } /****************************************************************** *********************** *********************LCD INITIALIZATION PARAMETERS**************************************** ******************************************************************* **********************/ void Lcd_Init () { Lcd_Reset(); // Call LCD reset Lcd_Cmd (0×28); // 4-bit mode – 2 line – 5×7 font. Lcd_Cmd (0x0C); // Display no cursor – no blink. Lcd_Cmd (0×06); // Automatic Increment – No Display shift. Lcd_Cmd (0×80); // Address DDRAM with 0 offset 80h. } /****************************************************************** *********************** *********************PLACES THE LCD CURSOR AT ANY POSITION ON THE DISPLY****************** ******************************************************************* **********************/ void Lcd_Cursor (char row, char column) { switch (row) { case 1: Lcd_Cmd (0×80 + column – 1); break; case 2: Lcd_Cmd (0xc0 + column – 1); break; //case 3: Lcd_Cmd(0×94 + column – 1); break; // case 4: Lcd_Cmd (0xd4 + column – 1); break; default: break; } } /****************************************************************** *********************** *********************FUNCTION TO DISPLAY STRING ON THE LCD******************************** ******************************************************************* ********************** void Lcd_Chr(char row, char column, char c)
  • 17. { Lcd_Cursor (row, column); Lcd_Data(c); } /****************************************************************** *********************** *********************FUNCTION TO DISPLAY STRING ON THE LCD******************************** ******************************************************************* **********************/ void Lcd_Write(char row, char column, char *s) { Lcd_Cursor (row, column); while (*s) { Lcd_Data(*(s++)); } return; } /****************************************************************** *********************** *********************SCROLLS TEXT ON LCD SCREEN******************************************* ******************************************************************* ********************** / void Lcd_Scroll(char *word) { char *pos; // character pointers char *adder; int i,displayLen; pos=word; displayLen=16; while (*pos != ”) { i=0; adder=pos; while ((i<displayLen)&&(*adder!='')) { Lcd_Data(*adder); adder++; i++; } Delay_ms(200); Lcd_Cmd(_LCD_CLEAR); pos++; } } /****************************************************************** *********************** *********************DISPLAY CHARACTER ON LCD AND
  • 18. USART*********************************** ******************************************************************* **********************/ #endif /****************************************************************** *********************** ********ENLOY*************ENJOY***********ENJOY***************ENJO Y*************ENJOY****** ******************************************************************* **********************/ Lib _Uart.h /****************************************************************** ********* (((((((((((((((((((((((((((UART ..HEADER FILE…SUNDAY)))))))))))))))))))))) ******************************************************************* *********/ #ifndef __Lb_Uart_H__ #define __Lb_Uart_H__ #define FOSC 11059200//11059200 ///xtal value /****************************************************************** ********* (((((((((((((((((((((((((((BACIC SERIAL COM INITIALS)))))))))))))))))))))))) ******************************************************************* *********/ void Uart_Init(unsigned long BPS) { #ifndef MONITOR51 SCON = 0×50; /* SCON: mode 1, 8-bit UART, enable rcvr */ TMOD |= 0×21; /* TMOD: timer 1, mode 2, 8-bit reload */ if(BPS==1200) {TH1=0xE8;TL1=0xE;} if(BPS==2400) {TH1=0xF4;TL1=0xF4;} if(BPS==4800) {TH1=0xFA;TL1=0xFA;} if(BPS==9600) {TH1=0xFD;TL1=0xFD;} if(BPS==19200) {TH1=0xFD;TL1=0xFD; PCON=0×80;} if(BPS==28800) {TH1=0xFF;TL1=0xFF; } if(BPS==38400) {TH1=0xFE;TL1=0xFE;;PCON=0×80;} if(BPS==57600) {TH1=0xFF;TL1=0xFF;PCON=0×80;} TR1 = 1; /* TR1: timer 1 run */ TI = 1; /* TI: set TI to send first char of UART */ #endif } #endif /****************************************************************** ********* ((((((((((NOTE:The baud rate is accurate only at values ranging)))))))))))) (((((((from 9600 to 1200////any bps above 9600 gives errors))))))))))))/// ******************************************************************* *********/
  • 19. Lib_Delay.h /****************************************************************** *********************** *********************LIB_DELAY.H FOR 8051 *********************************** ******************************************************************* **********************/ #ifndef Lib_Delay_H_ #define Lib_Delay_H_ #include #define XTAL 11059200 unsigned char Delay8Plus2xCycles (unsigned char x); unsigned char Delay8Plus2nCycles (unsigned char LoopCount) { while (–LoopCount); return (LoopCount); } #define Crystal 11059200L /* Crystal speed */ #define ClockRes (Crystal/12) /* Clock ticks per second */ #define NanoSecondsPerCycle (1000000000L / ClockRes) #define uSecToInstCycles(x) ((1000L * (x)) / NanoSecondsPerCycle) /* #define NOPS(x) (((x) & 1) ? _nop_() : 0), (((x) & 2) ? _nop_(),_nop_() : 0), (((x) & 4) ? _nop_(),_nop_(),_nop_(),_nop_() : 0), (((x) & ? _nop_(),_nop_(),_nop_(),_nop_(),_nop_(),_nop_(),_nop_(),_nop_() : 0)*/ /****************************************************************** *********************** ******************** *MICRO SEC DELAY MACRO *************************** ******************************************************************* **********************/ #define Delay_us(InstCycles) (((InstCycles) & 1) ? _nop_() : 0), (((InstCycles) & 2) ? _nop_(),_nop_() : 0), (((InstCycles) & ~7) ? Delay8Plus2nCycles(((InstCycles/4)-2)*2) : (((InstCycles) & 4) ? _nop_(),_nop_(),_nop_(),_nop_() : 0)) /****************************************************************** *********************** ******************** *DELAY IN MILI SECONDS *********************************** ******************************************************************* **********************/
  • 20. void Delay_ms(unsigned Time_ms) ; void Delay_ms(unsigned Time_ms) { unsigned long NumberOfCyc; NumberOfCyc =XTAL / 12000; // this will be done by compiler, no asm will be genereated except that for assignment; NumberOfCyc = NumberOfCyc * Time_ms; NumberOfCyc = NumberOfCyc >> 5; // Dec and While below take around 32 instructions if (NumberOfCyc > NumberOfCyc -= 8; else NumberOfCyc = 0; while (NumberOfCyc) // while loop takes 32 cycles { // –NumberOfCyc; // _nop_(); // _nop_(); // _nop_(); // } } /****************************************************************** *********************** ********************* THE END ********************************** ******************************************************************* **********************/ #endif /****************************************************************** *********************** ********************* PLEASE DONOT EDIT ********************************** ******************************************************************* **********************/ Log in to Reply