CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

rs232 communication problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
koray_duran



Joined: 04 Feb 2010
Posts: 37

View user's profile Send private message

rs232 communication problem
PostPosted: Thu Feb 04, 2010 7:44 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Feb 04, 2010 3:05 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Feb 05, 2010 8:51 am     Reply with quote

...

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

View user's profile Send private message AIM Address

PostPosted: Sat Feb 06, 2010 8:47 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Sat Feb 06, 2010 8:50 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Feb 06, 2010 10:47 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group