Microcontroller › AVR › How to interface fingerprint module serially with AVR
- This topic has 14 replies, 13 voices, and was last updated 11 years, 9 months ago by Disha raka.
-
AuthorPosts
-
March 2, 2011 at 7:10 pm #767usmanParticipant
Hi
I want to send a data package of 14 bytes serially from my atmega16L to finger print module R303A to perform commands.
please help me if anyone has used any fingerprint module
March 3, 2011 at 4:43 pm #5655BhaaskarParticipantPut on array and send the data in array serially
March 8, 2011 at 6:37 am #5668Amit JoshiParticipantfirst find out the baud rate of the finger print module and set the USART baud rate accordingly.
store the whole 14 byte data into array and transmit it using USART. try the following link to learn usartApril 26, 2011 at 9:47 am #6035usmanParticipantHi, this is what I m doing but unsuccessful…#define USART_BAUDRATE 57600#define F_CPU 8000000#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16))) – 1)//this is the packet i want to transmit. I have define the array as:char GenImg[12] = { 0xEF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x03, 0x01, 0x00, 0x05 };//I have called in the main these functions:usart_init();_delay_ms(500);_delay_ms(500);send_bytes(GenImg,12);//this function is for “initialization of usart”:void usart_init(){UCSRB |= (1 << RXEN) | (1 << TXEN); // Turn on the transmission and reception circuitryUCSRC |= (1 << URSEL) | (1 << UCSZ0) | (1 << UCSZ1);// Use 8-bit character sizesUCSRC &= ~(1 << UMSEL); // In UCSRC, UMSEL = 0 for asynchronousUCSRC &= ~(1<<USBS); //In UCSRC, USBS = 0 => 1 stop bitUBRRL = BAUD_PRESCALE;// Load lower 8-bits of the baud rate value into the low byte of the UBRR registerUBRRH = (BAUD_PRESCALE >> ; // Load upper 8-bits of the baud rate value..// into the high byte of the UBRR register}//this is function for transmitting:void send_bytes(char *s, int length){while (length–){usart_transmit(*s);s++;}}void usart_transmit(unsigned char c){while(!(UCSRA & (1 << UDRE))); // wait until UDR readyUDR = c; // send character}Please help me to correct any errors!April 26, 2011 at 1:23 pm #6037dagakshayParticipantwhat are the error you getting when you debug it…
June 8, 2011 at 1:30 am #6333dimas fahmigafurParticipanthow ready to work with AVR project with ingerprint????
may i give an example please bro??
December 12, 2011 at 9:32 am #6921sathyaParticipantHi Can you please send the embedded c code (not vb) for finger print module r303a to my mail id : [email protected]
Awaiting for your reply
January 12, 2012 at 9:47 am #7020divyaParticipantIn R303A module checksum = package id + package legnth + package content…..but the check sum size is two bytes do we need to neglect low byte overflow or high byte overflow..
Thanks in advance..
January 29, 2012 at 9:50 am #7087Sumit dubeyParticipanthey even m facing the same problem…….
i hv some basic difficulties lyk…..how cn set the baud rate of finger print module…..
what command sould i send to initialize finger print module…..
i even tried to interface it direct to pc using RS232 cable with its defaul baud rate but it is not responding…!!!
is there any command tht will confirm tht my finger print module is working fine….??it would be great if i get some help related to this issue…..reply me plzzz
March 14, 2012 at 5:44 pm #7302Abhishek jainParticipanthi everyone,
can anyone please help me in sending commands to fingerprint module (r303) from at89c51 in c coding. if anyone can find then please reply or send me to my mail id i.e. [email protected]
March 31, 2012 at 7:40 am #7362pradeep vParticipantHi..
can anyone send me the complete c-code for finger print module (R303A)? plz send it to [email protected]
February 13, 2013 at 5:47 am #9125Rajdeep singhParticipantHello, I am also facing same problem, but when i am connecting fingerprint module with hyper terminal using MAX232 data receiving properly but when i am connecting fingerprint module with microcontroller, no data is receiving at the outupt,anybody help…
February 17, 2013 at 10:19 am #9147AJISH ALFREDParticipantHi Rajdeep,
Make sure that you are using MAX232 converter for connecting the module with the microcontroller and also check it properly for working. You can do loop back test with the MAX232 to ensure that it is working.
February 27, 2013 at 6:52 pm #9194Disha rakaParticipantDear all,
here i m using R305 Finger print module with P89V51RD2
but my program is not working please see my program n say me corrections,
or give me your code please…
its urgent friends…
program:
#include<reg51.h>#include<string.h>sfr ldata=0x90;sbit rs=P2^3;sbit rw=P2^4;sbit en=P2^5;sbit busy=P1^7;sbit S1=P3^2;sbit S2=P3^3;sbit S3=P3^4;//===================================================================/void fingerprint(void);void UARTSendByte(unsigned char[],unsigned char dt );unsigned char UARTGetByte(void);void fingerdata(char);void conv();void elect();void lcdcmd(unsigned char);void lcddata(unsigned char);void lcdready();void msdelay(unsigned int);void UARTInit(void);//==============================================================================/unsigned int i,j,g,h,k,l,key,m,n;code unsigned char mydata1[]“WELCOME”); //7code unsigned char mydata2[]“SCAN UR FINGER 1st”); // 18code unsigned char mydata3[]“SCANNING”); //9code unsigned char mydata4[]“ACCESS GRANTED”); //14code unsigned char mydata5[]“ACCESS DENIED”); //13code unsigned char mydata8[]“THANKS”); //6code unsigned char mydata12[]“>”);code unsigned char mydata11[]“<<“);unsigned char dec1,dec2,asc1,asc2,adc1;//===============================================================================/code char GenImg[12] = { 0xEF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x03, 0x01, 0x00, 0x05 };//==================================================================================/void conv(){dec1=adc1%10;dec2=adc1/10;asc1=dec1 | 0x30;asc2=dec2 | 0x30;}//=========================================================================================/void main(){lcdcmd (0x38); //8 bit LCD modelcdcmd(0x0C); //lcdcmd(0x01); // clear lcdlcdcmd(0x06); // lcd on pointer offdo //LOOP START{lcdcmd(0x01); // clear lcdlcdcmd(0x86); //1st linefor(i=0;i<strlen(mydata1);i++) //WELCOMElcddata(mydata1);for(i=0;i<strlen(mydata2);i++) // SCAN UR FINGER 1stlcddata(mydata2);msdelay(500); //lcdcmd(0x01); //clr lcdlcdcmd(0x86); //1st linefor(i=0;i<strlen(mydata3);i++) //SCANNINGlcddata(mydata3);lcdcmd(0x06);for(k=0x94;k<0xA8;k++){lcdcmd(k); //>>>>>>>>>>>>>>>>>>>>>>>>>for(i=0;i<strlen(mydata12);i++)lcddata(mydata12);}UARTInit();UARTSendByte(GenImg,12);UARTGetByte();fingerdata(i);msdelay(500);lcdcmd(0x01);lcdcmd(0x9b); //3rd linefor(i=0;i<strlen(mydata8);i++) //THANKSlcddata(mydata8);msdelay(10);lcdcmd(0xc5);}}while(1); //repeat forever} //main endvoid UARTSendByte(unsigned char GenImg[],unsigned char dt){for(i=0;i<dt;i++){TI=0;SBUF = GenImg;while(TI==0);TI=0;}}//unsigned char UARTGetByte(void){ RI=0;while(RI==0);RI=0;return SBUF;}void fingerdata(char i){i=SBUF;adc1=i;conv();lcddata(asc2);lcddata(asc1);}//======================================================================/void lcdcmd (unsigned char value){lcdready();ldata=value;rs=0;rw=0;en=1;msdelay(1);en=0;return;}//====================================================================================================/void lcddata (unsigned char value){lcdready();ldata=value;rs=1;rw=0;en=1;msdelay(1);en=0;return;}//====================================================================================================/void lcdready(){busy=1;rs=0;rw=1;while (busy==1){en=0;msdelay(1);en=1;}return;}//==========================================================================================================/void msdelay(unsigned int value){unsigned int i,j;for(i=0;i<value;i++)for(j=0;j<1275;j++) ;}//====================================================================================/void UARTInit(void){PCON=0X80;SCON=0X50; //232 COM initTMOD=0x20;TH1=0XFE;TR1=1;}March 5, 2013 at 3:11 pm #9247Disha rakaParticipanthi all
anyone please reply yaar…
-
AuthorPosts
- You must be logged in to reply to this topic.