CAN protocol component

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

   

I have read a few things about CAN in PSoC and I got a couple of questions. 

   

http://www.cypress.com/file/127111/download just a sample datasheet. 

   

It says that CAN has a 16 receive buffer with filter. By my understanding of the wording, it seems like you can receive only the messages that the filter will allow, and you may not able to see everything. Can you set the filter to blank so you can see all the messages? What can a user do when they need to log/communicate with more than 16 messages?

   

Also, is it possible to change the individual bits of the message just before being sent, for example to test CRC check of other modules. You induce some error bits here and there. Can this by done manually?

   

 

   

Thanks.

0 Likes
1 Solution
ThBa_282891
Level 3
Level 3
First like received First like given

Hi,

   

in FULL-CAN mode the messages are filtered by message-ID. In BASIC-CAN mode this has to be done in software, thus you are able to receive all message-IDs.

View solution in original post

0 Likes
6 Replies
ThBa_282891
Level 3
Level 3
First like received First like given

Hi,

   

in FULL-CAN mode the messages are filtered by message-ID. In BASIC-CAN mode this has to be done in software, thus you are able to receive all message-IDs.

0 Likes
Anonymous
Not applicable

Yes, I read that software implementation part, but it is using valuable cpu time for something that can be done very efficiently with hardware.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Well, ion the first post you said you want to get all messages from the CAN bus to handle them in your code. In the other post you complain that you then need the CPU to process all the messages. You cannot have both 🙂

Anonymous
Not applicable

I want to use dedicated the hardware as much as possible to process the data, not software. 

   

I am not sure how the hardware works but by software could be done by polling or using interrupts. Think of it like this:

   

Hardware version:

   

Lots of kids in the hallway and the teacher is taking care of the kids in classroom. Kids come to the class from outside by themselves.

   

 

   

Software version:

   

Teacher has to explain to kids in the classroom, but whenever hears noise outside (or periodically every 10 sec or so) goes to the hallway and looks if any kids belong to the class so the teacher may grab them and bring them in. 

   

Have you ever tried doing things by bit banging or by using dedicated ports and protocols?

   

Can you tell the efficiency in operation between the two versions now?

0 Likes
ThBa_282891
Level 3
Level 3
First like received First like given

You process all the timing critical CAN-IDs with FullCAN. The other messages also cause an interrupt but simply put the message into a buffer.

   

Then, whenever you have the time, you process the messages from this buffer.If you use an OS, the task for this job can have a low priority.

0 Likes
Anonymous
Not applicable

Does it means that the receiver has to check every message and then compare the identifier id of the message which has been used by the transmitter?

0 Likes