> I have 4 circuits with on each of them exists PIC18F258.these are slaves.and > there is 1 master PIC18F458 as master. > They talk by can bus.I send messages with the can_msg_id = id of the slave > circuit. > for example slave 1 =1 > slave 2 = 2 > slave 3 = 3 > so a slave doesnt take a msgs to its reveice buffer if that msgs doesnt > belong to it. > > In order to achieve this , i must use can mask registers. > > has anyone wrote sth like this or any knowledge about it? > thanks... I'm writing code for those PICs. Maybe I can help you, but you should be more specific explaining what you want to know. Anyway, I'll try to answer... Let's say you're using RX buffer 0. You have one mask and two filters associated with that buffer, right? When a message is received it's ID is compared against the filters. If any matches, the received message is placed in the receive buffer. BUT only the bits in the mask set to '1' will be checked (e.g. MASK=000...000 -> all messages will be received, regardless of filter values; MASK=000...010 -> only messages with 2nd ID bit equal to filter1's 2nd bit OR filter2's 2nd bit will be accepted; MASK=111...111 -> All messages equal to ANY filter will pass). If you just want messages with ID=x to be received, you set the two filters to 'x' and the mask register to all 1's. Is this what you wanted to know? You might find useful CAN routines in C to start with in AN738 at http://www.microchip.com/1010/suppdoc/appnote/all/an738/index.htm -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body