5 Replies Latest reply on Mar 12, 2016 4:44 AM by user_228698340

    CAN protocol component

    urimakarona_1604181

      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.

        • 1. Re: CAN protocol component
          user_228698340

          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.

          • 2. Re: CAN protocol component
            urimakarona_1604181

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

            • 3. Re: CAN protocol component
              user_78878863

              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 :)

              1 of 1 people found this helpful
              • 4. Re: CAN protocol component
                urimakarona_1604181

                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?

                • 5. Re: CAN protocol component
                  user_228698340

                  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.