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

Problem with driver "can-18xxx8.c"

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







Problem with driver "can-18xxx8.c"
PostPosted: Tue Feb 17, 2004 10:38 am     Reply with quote

Hello together,

I think there is a mistake inside CCS-Can-driver
"can-18xxx8.c". In the function to get the received ID
can_get_ID(...) a problem occurs if extended ID's were used.

The line

ret|=((int32)*ptr & 0xE0) << 18;

try to get the Bits 7..5 of RxBnSIDL and clears Bit4..0.
Up to this point all is OK.

Then these 3-Bits "should be" shifted to Bit 18..20 (16 extended-Bits
+ 2 extended-bits -> 0..17).

But they will be shifted to Bit 23..25 !!!
My suggestion:

ret|=((int32)*ptr & 0xE0) << 13;

Perhaps someone of CCS will take this.
By the way: Is there someone who has changed this driver
for PIC18F6680 (more filters...) ?

Kind regards
Uwe Koch




int32 can_get_id(int * addr, int1 ext) {
int32 ret;
int * ptr;

ret=0;
ptr=addr;

if (ext) {
ret=*ptr; //eidl

ptr--; //eidh
ret|=((int32)*ptr << 8);

ptr--; //sidl
ret|=((int32)*ptr & 0x03) << 16;
ret|=((int32)*ptr & 0xE0) << 13;
// ret|=((int32)*ptr & 0xE0) << 18; CCS-Fehler, die 3-Bits werden zu weit geschoben. Ich vermute die haben gedacht sie w�rden rechtsb�ndig im Register stehen(Bit0..2), dann w�re es OK.

ptr--; //sidh
ret|=((int32)*ptr << 21);
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 17, 2004 9:53 pm     Reply with quote

Quote:
My suggestion:
ret|=((int32)*ptr & 0xE0) << 13;
Perhaps someone of CCS will take this.

I found the same problem about 2 weeks ago
while testing a board. (Exact same solution, too).

CCS tech support doesn't directly watch this board.
You should send them an email to tell them about
this problem, and your solution. Email it to:
[email protected]
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