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 support@ccsinfo.com

Why don't I get CAN mesaages

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



Joined: 01 Sep 2004
Posts: 3

View user's profile Send private message Send e-mail

Why don't I get CAN mesaages
PostPosted: Wed Sep 01, 2004 6:20 pm     Reply with quote

Hi,

I use 18F458 40MHz with mcp2551 transciever. I use CCS can driver named can-18xxxx8.c
I would like test by loopback mode for getting frames what I sent, but it did not come back.
I tried a different PIC in normal can mode but the reasult is the same.

I initalized the can module by can_init(), as in the example codes. I sent a frame (it went, I have inicator leds, and i tested on oscilloscope) but it did not received by the PIC (the can_kbhit() funcion always returns false)

CAN somebody help me, what do I do bad?

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 01, 2004 6:41 pm     Reply with quote

Yes, we recently discussed how to make the CCS CAN driver work
in loopback mode. See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=20106
lito



Joined: 01 Sep 2004
Posts: 3

View user's profile Send private message Send e-mail

PostPosted: Thu Sep 02, 2004 1:36 pm     Reply with quote

Thank you for fast answer

The reason why I did not get the messages is the difference of sent message type (what was standard ID) and the filtered id (it was extended).
Each filter has an EXIDEN bit, it determines that does the filter do anything with the incoming message if the RXM bits in RXBnCON reg. are 00 (=all valid message).
If you have only extended filter (EXIDEN is 1) no standard messages will received.
So the 'all_valid_message' means you will receive messages, that not differ from the filter type.

!!!!!!!!!!!!!
I spoke about ONLY the filter TYPE, not about the filter value. The filter and mask value pair have to match to message to receive messages of course.
!!!!!!!!!!!!!

The solution is to match the sent and filtered id, so when I sent extended messages, it received succesfully, when I used the original can_init() funcion. (it uses extended filters for set up)


The reference information for this topic is:
- The RXFnSIDL register's EXIDEN bit
- The RXBnCON register's RXM bitfield, and its description in 18F458's datasheet (DS41159) section 19.5.3.
- Forum topics:
- http://www.ccsinfo.com/forum/viewtopic.php?t=20106
- http://www.ccsinfo.com/forum/viewtopic.php?t=17862
(the first link is mentioned above also)

If I wrote something bad please correct my post,
I hope it help to other to get the first experience with CAN module

lito
lito



Joined: 01 Sep 2004
Posts: 3

View user's profile Send private message Send e-mail

PS
PostPosted: Thu Sep 02, 2004 1:41 pm     Reply with quote

Do not matter how do you develop, loopback mode or multi node envionment, it works (or not) depend on the message type (std. or ext.)

lito
mirberti
Guest







PostPosted: Fri Sep 03, 2004 9:23 am     Reply with quote

If you like see this topic :

http://www.ccsinfo.com/forum/viewtopic.php?t=3711&highlight=18f458

this is an example for use CAN to comunicate with a master ad slave.

by Mirko
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