# Problem with initialization of mbf200 sensor

Status
Not open for further replies.

#### ibrahim03

##### Full Member level 1
I am trying to interface a mbf200 fingerprint sensor with the ATMEGA32 AVR microcontroller using the parallel bus interface of the microcontroller.

I am having problems with the sensor initialization.

First thing I want to know is that how will i know that the sensor has been initialized correctly ?

I am using the following code for the initialization and from what i have understood is that if the sensor is initialized correctly then the INTR pin should go low on touching the sensor. Is that correct?
Also I dont have any idea about the value of 'Discharge current register' and 'discharge time register' and 'Programmable gain control register' (I am using arbitrary values at present). What are these registers actually used for?

Code:
// PORTC connected to data lines of mbf.
// PA0 connected to index data reg selection line(A0)
// PA1 connected to read enable line (active low)
// PA2 connected to write enable line (active low)

//---------------------------
// write into mbf register
//---------------------------
void Write_Reg(unsigned char reg,unsigned char data)
{

DDRC = 0xFF;		//portc as output

//select a particular register

PORTA &= ~(1<<PA0);

PORTA |= (1<<PA1);

PORTA &= ~(1<<PA2);

PORTC = reg;

//send data to register

_delay_us( 45 );;					   //40us delay

PORTA |= (1<<PA0);

PORTC = data;

_delay_us( 45 );;					   //40us delay
}

//---------------------------
// mbf initialization
//---------------------------

void mbf_initial(void)
{

Write_Reg(0x08,0x00);	 	   //reset value of CTRLA reg

Write_Reg(0x09,0x0D);		   //set value of CTRLB register

_delay_us( 45 );;					   //40us delay

Write_Reg(0x06,0x40);		   //discharge time register value(houzee)

Write_Reg(0x07,0x10);		   //discharge current register value(houzee)

Write_Reg(0x0E,0x03);		   //clear pending work

Write_Reg(0x0D,0x51);		   //Interrupt control register (*)

_delay_us( 110 );;			   		   //100us delay

}

#### ibrahim03

##### Full Member level 1
Re: mbf200

Can anyone who has worked on this sensor please give me the circuit diagram to run the mbf200?
I cant detect any signs of life in the sensor.

Also how would i know that the sensor is alive?

I will be happy to donate a good amount of points to the person who is generous enough to help me.

mbf200

Points: 2