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

LIN bus

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



Joined: 15 Oct 2011
Posts: 36

View user's profile Send private message

LIN bus
PostPosted: Tue Oct 25, 2011 3:05 pm     Reply with quote

Hello,
I have some problem with lin bus driver. Is someone use this driver ??
I think some function have mistakes, for example:

Code:

#bit ID_Parity_error = Errorflag.0
#bit bit_error = Errorflag.1
#bit CRC_error = Errorflag.2
#bit data_received = Errorflag.3
#bit addr_match   = Errorflag.4



Code:

/*
void linbus_verify_checksum(byte* databytes, int8 message_length)
This function will verify the checksum of the data received
Call this function after read_data_packet()
PARAMS databytes: Received Data
PARAMS message_length: Length of message
RETURNS: none
This function will set the CRC_error bit in Errorflag if it detect checksum error
*/
void linbus_verify_checksum(byte* databytes, int8 message_length)
{
int CRC, CRC_actual;
CRC_actual = getc();
CRC = linbus_calculate_checksum(&databytes[0], message_length);
 if(CRC_actual==CRC)
CRC_error =0;
else
CRC_error =0;  // i think here should be 1
}


I built the circuit, pic16f690 and mcp2003 with 8Mhz crystal for master and pic16f690, mcp2003 with intRC 8MHz. I tried testing code from example but this code don't working.
My complier is 4.120.
Maybe someone have working code ?? for lin bus.

Best regards
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