• AVR Freaks

Hot!CE128_ECAN_FIFO, ECAN1Config.c/h and ECAN1Drv.c/h

Author
uln
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/03/20 10:02:31
  • Location: 0
  • Status: offline
2020/01/22 04:59:09 (permalink)
0

CE128_ECAN_FIFO, ECAN1Config.c/h and ECAN1Drv.c/h

I use the ECAN1Config.c/h and ECAN1Drv.c/h files from CE128_ECAN_FIFO in my actual project.
Like "smam" (https://www.microchip.com/forums/FindPost/347096) I came to the conclusion,
that the last parameter of ecan1WriteRxAcptFilter(1,0x1FFEFFFF,1,15,0) should have the same
value like the first parameter of ecan1WriteRxAcptMask(1,0x1FFFFFFF,1,1); in that example!?

But it seems, there wasn't "a little mistake in the code", it works when I use 0 and 1 for these
parameters and doesn't work, when I write two times a 0 to my source code - can anyone explain?
 
 
/* 
This function configures Acceptance Filter "n"

Inputs:
n-> Filter number [0-15]
identifier-> Bit ordering is given below
Filter Identifier (29-bits) : 0b000f ffff ffff ffff ffff ffff ffff ffff
           |____________|_____________________|
           SID10:0 EID17:0


Filter Identifier (11-bits) : 0b0000 0000 0000 0000 0000 0fff ffff ffff
                |___________|
                 SID10:0
exide -> "0" for standard identifier
   "1" for Extended identifier

bufPnt -> Message buffer to store filtered message [0-15]
maskSel -> Optinal Masking of identifier bits [0-3]
      
*/

void ecan1WriteRxAcptFilter(int n, long identifier, unsigned int exide, unsigned int bufPnt,unsigned int maskSel) {
  :
}


/*
This function configures Acceptance Filter Mask "m"

Inputs:
m-> Mask number [0-2]
identifier-> Bit ordering is given below
Filter Mask Identifier (29-bits) : 0b000f ffff ffff ffff ffff ffff ffff ffff
                |____________|_____________________|
                 SID10:0 EID17:0


Filter Mask Identifier (11-bits) : 0b0000 0000 0000 0000 0000 0fff ffff ffff
                     |___________|
                     SID10:0

mide -> "0" Match either standard or extended address message if filters match
         "1" Match only message types that correpond to 'exide' bit in filter
     
*/

void ecan1WriteRxAcptMask(int m, long identifier, unsigned int mide, unsigned int exide){
  :
}

#1

1 Reply Related Threads

    uln
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2019/03/20 10:02:31
    • Location: 0
    • Status: offline
    Re: CE128_ECAN_FIFO, ECAN1Config.c/h and ECAN1Drv.c/h 2020/01/22 06:59:40 (permalink)
    0
    OK - I've forgotten to insert the used CAN-ID on configuration of the filter!
    Now the corrected code will work - using a non configured mask will also work,
    because such one will accept all CAN-IDs by default.
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5