EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / finger print module R303a

finger print module R303a

|

Microcontroller › AVR › finger print module R303a

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 5 months ago by GANEEV SINGH.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 15, 2015 at 3:13 pm #3554
    Shubham Chauhan
    Participant

    I am new in programming in C I am working on the project of fingerprint module R303a interfacing with atmega16. I made a code(not completed just to store image) but nothing seems to happen my code is this . Please help me 

    #define F_CPU 1000000UL
    #include<avr/io.h>
    #include<util/delay.h>
    #include"LCD_DISPLAY.H"
    #include"LCD_DISPLAY.C"
    #include<avr/io.h>
     
    int usart_init( baurd_rate)
     
    {
           
     UBRRL = (F_CPU/(16*baurd_rate))-1;
     
    //UBRRL=0x33;
     UCSRC=(1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0);
     UCSRB=(1<<RXEN)|(1<<TXEN);
     
    }
    unsigned char i=0,fp[20],rec,dummy;
    unsigned char enroll[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X01,0X00,0X05};
    unsigned  char generate_ch[13]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X04,0x02,0X01,0X00,0X08};
    unsigned char store[11]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X06,0X06,0X01};
    unsigned char identify[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X11,0X00,0X15};
     
     
    void USART_Transmit( unsigned char data )
    {
    /* Wait for empty transmit buffer */
    while ( !( UCSRA & (1<<UDRE)) );
     
    /* Put data into buffer, sends the data */
    UDR = data;
    }
    unsigned char USART_Received( void)
    {
    /* Wait for data to be received */
    while ( !(UCSRA & (1<<RXC)) );
    return UDR;
     
    }
     
    int main()
    {
    again:
    init_LCD();
     usart_init;
     print_lcd(0x80,"enroll");
     _delay_ms(3000);
      lcd_clr();
      
       i=0;
           while(i<12)
           {
            USART_Transmit (enroll);
            i++;
           }
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      dummy=USART_Received();
      dummy=USART_Received();
      if(!rec)
      {
       print_lcd(0x80,"enroll kk");
    _delay_ms(2000);
     }
      else
      {
      print_lcd(0x80,"enroll not ok");
    _delay_ms(2000);
      }
     
      
      i=0;
      while(i<13)
           {
            USART_Transmit (generate_ch);
            i++;
           }
     rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      dummy=USART_Received();
      dummy=USART_Received();
     
      if(!rec)
      {
       print_lcd(0x80,"gen char ok");
    _delay_ms(2000);
     }
      else
      {
      print_lcd(0x80,"gen char notok");
    _delay_ms(2000);
      goto again;
      }
         i=0;
      while(i<11)
           {
            USART_Transmit (store);
            i++;
           }
       rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      rec=USART_Received();
      dummy=USART_Received();
      dummy=USART_Received();
      if(!rec)
      { 
      
       print_lcd(0x80,"store ok");
    _delay_ms(2000);
     }
      else
      {
      print_lcd(0x80,"store notok");
    _delay_ms(2000);
     
        }
     }
     
    December 26, 2016 at 2:23 pm #14295
    GANEEV SINGH
    Participant
    Hi Shubham
     
    You have not provided any PageID and Checksum in store[ ]. Both of them are of 2 bytes each. You could append "0x00,0x01,0x00,0x0f" to your existing store[ ]. 
     
    This might help :)
  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Can I make two inputs from one?? June 21, 2025
  • using a RTC in SF basic June 21, 2025
  • Help with finding unique wire lug(s) June 21, 2025
  • Simple LED Analog Clock Idea June 21, 2025
  • Kawai KDP 80 Electronic Piano Dead June 21, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise