View previous topic :: View next topic |
Author |
Message |
lito
Joined: 01 Sep 2004 Posts: 3
|
Why don't I get CAN mesaages |
Posted: Wed Sep 01, 2004 6:20 pm |
|
|
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
|
|
|
lito
Joined: 01 Sep 2004 Posts: 3
|
|
Posted: Thu Sep 02, 2004 1:36 pm |
|
|
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
|
PS |
Posted: Thu Sep 02, 2004 1:41 pm |
|
|
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
|
|
|
|