View previous topic :: View next topic |
Author |
Message |
koray_duran
Joined: 04 Feb 2010 Posts: 37
|
rs232 communication problem |
Posted: Thu Feb 04, 2010 7:44 am |
|
|
Hello,
I work on a fingerprint sensor, i try to communicate with it.
It makes me crazy. I need your help.
I will send a command like this :
char test[] = {0x02, 0x00, 0xD', 0x00, 0x00, 0x00}; //
And after that i need to receive an answer and compare it like this :
char testok[] = {0x02, 0x08, 0x00, 0x00}; //
I tried something like this :
i=0;
while (capenrlram[i] != 0xAA){printf("%c", capenrlram[i++]);}
But it doesnt work proper. Also i have problem to get answer and compare with "testok" variable. I tried to use "gets" command for this.
By the way, my serial setting is this but the parity of module is Odd.
#use rs232(baud=9600,parity=N,xmit=PIN_A2,rcv=PIN_A3,bits=8, stream=UART)
Please guys help me with this. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Feb 04, 2010 3:05 pm |
|
|
Quote: |
I work on a fingerprint sensor, i try to communicate with it.
|
Post a link to the data sheet for the fingerprint module. It must be
the full data sheet (and not just a brochure), that contains the
communications protocol for the module. |
|
|
koray_duran
Joined: 04 Feb 2010 Posts: 37
|
|
Posted: Fri Feb 05, 2010 8:51 am |
|
|
...
Last edited by koray_duran on Thu Dec 23, 2010 3:54 am; edited 1 time in total |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sat Feb 06, 2010 8:47 am |
|
|
You are gonna have some fun with the 4 byte CRC calcs 4 this puppy.
your fun is JUST BEGINNING! |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sat Feb 06, 2010 8:50 am |
|
|
as in this:
The CRC calculation can be implemented as a table of pre-computed effects to ensure efficiency. The CRC value is 32 bits long. The table is indexed by the byte to be encoded and thus the table contains 256 double words (256 * 32 bits). The CRC algorithm implementation was initially developed by the University of California, Berkeley and its contributors, but has been changed and somewhat simplified to fit the embedded nature of FPC-AM3. The algorithm uses the CCITT-32 CRC Polynomial. |
|
|
koray_duran
Joined: 04 Feb 2010 Posts: 37
|
|
Posted: Sat Feb 06, 2010 10:47 am |
|
|
Thanks for answering asmboy but I don't think that I need using crc or something.
Commands and answers are clear.
I am not qualified in C language so I have this problems. |
|
|
|