6 Replies Latest reply on Oct 11, 2017 9:52 AM by anmic_2693366

    CAN protocol component

    userc_40378

      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
          thbac_282891

          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
            userc_40378

            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
              helic_263931

              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
                userc_40378

                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
                  thbac_282891

                  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.

                  • 6. Re: CAN protocol component
                    anmic_2693366

                    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?