⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 can.lst

📁 xc164的双can的使用例程
💻 LST
📖 第 1 页 / 共 5 页
字号:
  212  1      
  213  1        ///  Configuration of the Node B Baud Rate:
  214  1        ///  - required baud rate = 10.000 kbaud
  215  1        ///  - real baud rate     = 10.000 kbaud
  216  1        ///  - sample point       = 60.00 %
  217  1        ///  - there are 5 time quanta before sample point
  218  1        ///  - there are 4 time quanta after sample point
  219  1        ///  - the (re)synchronization jump width is 2 time quanta
  220  1        ///  - enable the module clock divider (by 8)
  221  1      
  222  1        CAN_BBTRL      =  0xB471;      // load bit timing register low
  223  1      
  224  1        CAN_BBTRH      =  0x0000;      // load bit timing register high
  225  1      
  226  1        CAN_BFCRL      =  0x0000;      // load frame counter timing register low
  227  1      
  228  1        CAN_BFCRH      =  0x0000;      // load frame counter timing register high
  229  1      
  230  1        ///  -----------------------------------------------------------------------
  231  1        ///  Configuration of the CAN Message Objects 0 - 31:
  232  1        ///  -----------------------------------------------------------------------
  233  1      
  234  1        ///  -----------------------------------------------------------------------
  235  1        ///  Configuration of Message Object 0:
  236  1        ///  -----------------------------------------------------------------------
  237  1        ///  - message object 0 is valid
  238  1        ///  - enable receive interrupt; bit INTPND is set after successfull 
  239  1        ///    reception of a frame
  240  1      
  241  1        ///  - message object is used as receive object
C166 COMPILER V6.02, CAN                                                                   08/28/2006 10:05:47 PAGE 5   

  242  1        ///  - standard 11-bit identifier
  243  1        ///  - 0 valid data bytes
  244  1        ///  - this message object works with CAN node A
  245  1        ///  - remote monitoring is disabled
  246  1        ///  - receive interrupt node pointer: TwinCAN SRN 0
  247  1      
  248  1        CAN_MSGCFGL0   =  0x0000;      // load message configuration register low
  249  1        CAN_MSGCFGH0   =  0x0000;      // load message configuration register high
  250  1      
  251  1        ///  - acceptance mask 11-bit: 0x7FF
  252  1        ///  - identifier 11-bit:      0x001
  253  1      
  254  1        CAN_MSGAMRL0   =  0xFFFF;      // load acceptance mask register low
  255  1        CAN_MSGAMRH0   =  0xFFFF;      // load acceptance mask register high
  256  1        CAN_MSGARL0    =  0x0000;      // load arbitration register low
  257  1        CAN_MSGARH0    =  0x0004;      // load arbitration register high
  258  1        CAN_MSGDRL00   =  0x0001;      // load data register 0 low
  259  1        CAN_MSGDRH00   =  0x0002;      // load data register 0 high
  260  1        CAN_MSGDRL04   =  0x0003;      // load data register 4 low
  261  1        CAN_MSGDRH04   =  0x0000;      // load data register 4 high
  262  1      
  263  1        ///  - functionality of standard message object
  264  1      
  265  1        CAN_MSGFGCRL0  =  0x0000;      // load FIFO/gateway control register low
  266  1        CAN_MSGFGCRH0  =  0x0000;      // load FIFO/gateway control register high
  267  1      
  268  1        CAN_MSGCTRH0   =  0x0000;      // load message control register high
  269  1        CAN_MSGCTRL0   =  0x5599;      // load message control register low
  270  1      
  271  1        ///  -----------------------------------------------------------------------
  272  1        ///  Configuration of Message Object 1:
  273  1        ///  -----------------------------------------------------------------------
  274  1        ///  - message object 1 is valid
  275  1        ///  - enable receive interrupt; bit INTPND is set after successfull 
  276  1        ///    reception of a frame
  277  1      
  278  1        ///  - message object is used as receive object
  279  1        ///  - standard 11-bit identifier
  280  1        ///  - 0 valid data bytes
  281  1        ///  - this message object works with CAN node A
  282  1        ///  - remote monitoring is disabled
  283  1        ///  - receive interrupt node pointer: TwinCAN SRN 0
  284  1      
  285  1        CAN_MSGCFGL1   =  0x0000;      // load message configuration register low
  286  1        CAN_MSGCFGH1   =  0x0000;      // load message configuration register high
  287  1      
  288  1        ///  - acceptance mask 11-bit: 0x7FF
  289  1        ///  - identifier 11-bit:      0x002
  290  1      
  291  1        CAN_MSGAMRL1   =  0xFFFF;      // load acceptance mask register low
  292  1        CAN_MSGAMRH1   =  0xFFFF;      // load acceptance mask register high
  293  1        CAN_MSGARL1    =  0x0000;      // load arbitration register low
  294  1        CAN_MSGARH1    =  0x0008;      // load arbitration register high
  295  1        CAN_MSGDRL10   =  0x0000;      // load data register 0 low
  296  1        CAN_MSGDRH10   =  0x0000;      // load data register 0 high
  297  1        CAN_MSGDRL14   =  0x0000;      // load data register 4 low
  298  1        CAN_MSGDRH14   =  0x0000;      // load data register 4 high
  299  1      
  300  1        ///  - functionality of standard message object
  301  1      
  302  1        CAN_MSGFGCRL1  =  0x0000;      // load FIFO/gateway control register low
  303  1        CAN_MSGFGCRH1  =  0x0001;      // load FIFO/gateway control register high
C166 COMPILER V6.02, CAN                                                                   08/28/2006 10:05:47 PAGE 6   

  304  1      
  305  1        CAN_MSGCTRH1   =  0x0000;      // load message control register high
  306  1        CAN_MSGCTRL1   =  0x5599;      // load message control register low
  307  1      
  308  1        ///  -----------------------------------------------------------------------
  309  1        ///  Configuration of Message Object 2:
  310  1        ///  -----------------------------------------------------------------------
  311  1        ///  - message object 2 is valid
  312  1        ///  - enable receive interrupt; bit INTPND is set after successfull 
  313  1        ///    reception of a frame
  314  1      
  315  1        ///  - message object is used as receive object
  316  1        ///  - standard 11-bit identifier
  317  1        ///  - 0 valid data bytes
  318  1        ///  - this message object works with CAN node A
  319  1        ///  - remote monitoring is disabled
  320  1        ///  - receive interrupt node pointer: TwinCAN SRN 0
  321  1      
  322  1        CAN_MSGCFGL2   =  0x0000;      // load message configuration register low
  323  1        CAN_MSGCFGH2   =  0x0000;      // load message configuration register high
  324  1      
  325  1        ///  - acceptance mask 11-bit: 0x7FF
  326  1        ///  - identifier 11-bit:      0x003
  327  1      
  328  1        CAN_MSGAMRL2   =  0xFFFF;      // load acceptance mask register low
  329  1        CAN_MSGAMRH2   =  0xFFFF;      // load acceptance mask register high
  330  1        CAN_MSGARL2    =  0x0000;      // load arbitration register low
  331  1        CAN_MSGARH2    =  0x000C;      // load arbitration register high
  332  1        CAN_MSGDRL20   =  0x0000;      // load data register 0 low
  333  1        CAN_MSGDRH20   =  0x0000;      // load data register 0 high
  334  1        CAN_MSGDRL24   =  0x0000;      // load data register 4 low
  335  1        CAN_MSGDRH24   =  0x0000;      // load data register 4 high
  336  1      
  337  1        ///  - functionality of standard message object
  338  1      
  339  1        CAN_MSGFGCRL2  =  0x0000;      // load FIFO/gateway control register low
  340  1        CAN_MSGFGCRH2  =  0x0002;      // load FIFO/gateway control register high
  341  1      
  342  1        CAN_MSGCTRH2   =  0x0000;      // load message control register high
  343  1        CAN_MSGCTRL2   =  0x5599;      // load message control register low
  344  1      
  345  1        ///  -----------------------------------------------------------------------
  346  1        ///  Configuration of Message Object 3:
  347  1        ///  -----------------------------------------------------------------------
  348  1        ///  - message object 3 is valid
  349  1        ///  - enable receive interrupt; bit INTPND is set after successfull 
  350  1        ///    reception of a frame
  351  1      
  352  1        ///  - message object is used as receive object
  353  1        ///  - standard 11-bit identifier
  354  1        ///  - 0 valid data bytes
  355  1        ///  - this message object works with CAN node A
  356  1        ///  - remote monitoring is disabled
  357  1        ///  - receive interrupt node pointer: TwinCAN SRN 0
  358  1      
  359  1        CAN_MSGCFGL3   =  0x0000;      // load message configuration register low
  360  1        CAN_MSGCFGH3   =  0x0000;      // load message configuration register high
  361  1      
  362  1        ///  - acceptance mask 11-bit: 0x7FF
  363  1        ///  - identifier 11-bit:      0x234
  364  1      
  365  1        CAN_MSGAMRL3   =  0xFFFF;      // load acceptance mask register low
C166 COMPILER V6.02, CAN                                                                   08/28/2006 10:05:47 PAGE 7   

  366  1        CAN_MSGAMRH3   =  0xFFFF;      // load acceptance mask register high
  367  1        CAN_MSGARL3    =  0x0000;      // load arbitration register low
  368  1        CAN_MSGARH3    =  0x08D0;      // load arbitration register high
  369  1        CAN_MSGDRL30   =  0x0000;      // load data register 0 low
  370  1        CAN_MSGDRH30   =  0x0000;      // load data register 0 high
  371  1        CAN_MSGDRL34   =  0x0000;      // load data register 4 low
  372  1        CAN_MSGDRH34   =  0x0000;      // load data register 4 high
  373  1      
  374  1        ///  - functionality of standard message object
  375  1      
  376  1        CAN_MSGFGCRL3  =  0x0000;      // load FIFO/gateway control register low
  377  1        CAN_MSGFGCRH3  =  0x0003;      // load FIFO/gateway control register high
  378  1      
  379  1        CAN_MSGCTRH3   =  0x0000;      // load message control register high
  380  1        CAN_MSGCTRL3   =  0x5599;      // load message control register low
  381  1      
  382  1        ///  -----------------------------------------------------------------------
  383  1        ///  Configuration of Message Object 4:
  384  1        ///  -----------------------------------------------------------------------
  385  1        ///  - message object 4 is valid
  386  1        ///  - enable receive interrupt; bit INTPND is set after successfull 
  387  1        ///    reception of a frame
  388  1      
  389  1        ///  - message object is used as receive object
  390  1        ///  - standard 11-bit identifier
  391  1        ///  - 0 valid data bytes
  392  1        ///  - this message object works with CAN node A
  393  1        ///  - remote monitoring is disabled
  394  1        ///  - receive interrupt node pointer: TwinCAN SRN 0
  395  1      
  396  1        CAN_MSGCFGL4   =  0x0000;      // load message configuration register low
  397  1        CAN_MSGCFGH4   =  0x0000;      // load message configuration register high
  398  1      
  399  1        ///  - acceptance mask 11-bit: 0x7FF
  400  1        ///  - identifier 11-bit:      0x000
  401  1      
  402  1        CAN_MSGAMRL4   =  0xFFFF;      // load acceptance mask register low
  403  1        CAN_MSGAMRH4   =  0xFFFF;      // load acceptance mask register high
  404  1        CAN_MSGARL4    =  0x0000;      // load arbitration register low
  405  1        CAN_MSGARH4    =  0x0000;      // load arbitration register high
  406  1        CAN_MSGDRL40   =  0x0000;      // load data register 0 low
  407  1        CAN_MSGDRH40   =  0x0000;      // load data register 0 high
  408  1        CAN_MSGDRL44   =  0x0000;      // load data register 4 low
  409  1        CAN_MSGDRH44   =  0x0000;      // load data register 4 high
  410  1      
  411  1        ///  - functionality of standard message object
  412  1      
  413  1        CAN_MSGFGCRL4  =  0x0000;      // load FIFO/gateway control register low
  414  1        CAN_MSGFGCRH4  =  0x0004;      // load FIFO/gateway control register high
  415  1      
  416  1        CAN_MSGCTRH4   =  0x0000;      // load message control register high
  417  1        CAN_MSGCTRL4   =  0x5599;      // load message control register low
  418  1      
  419  1        ///  -----------------------------------------------------------------------
  420  1        ///  Configuration of Message Object 5:
  421  1        ///  -----------------------------------------------------------------------
  422  1        ///  - message object 5 is valid
  423  1        ///  - enable receive interrupt; bit INTPND is set after successfull 
  424  1        ///    reception of a frame
  425  1      
  426  1        ///  - message object is used as receive object
  427  1        ///  - standard 11-bit identifier
C166 COMPILER V6.02, CAN                                                                   08/28/2006 10:05:47 PAGE 8   

  428  1        ///  - 0 valid data bytes
  429  1        ///  - this message object works with CAN node A

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -