| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
AN2010 Using Motorola msCAN Filter Configuration Tool Steven
Top Searches for this datasheetOrder this document AN2010/D AN2010 Using Motorola msCAN Filter Configuration Tool Steven McAslan Body Electronics Software Systems East Kilbride, Scotland. Freescale Semiconductor, Inc. Introduction Controller Area Network (CAN) communication standard widely used automotive industrial applications signal between nodes network. reasons success such areas availability modules integrated onto microcontrollers intended embedded applications. Motorola msCAN such module that available both 8-bit M68HC08 family devices 16-bit M68HC12 family. well providing robust implementation standard, msCAN able reduce overhead microcontroller filtering unwanted messages before they reach input buffers. This application note describes software tool that provides automated configuration msCAN filter based messages that present network. Used conjunction with Filter Generator's user's manual provides practical examples tips best tool. benefits filters standard allows very large number nodes single network. However, each individual node will typically only require receive transmit subset messages network. msCAN were receive every message present network then microcontroller would spend time analysing messages only discover that many were interest that particular node. networks where node interested only small subset Motorola, Inc., 2000 More Information This Product, www.freescale.com AN2010 Application Note total messages available then significant amount processing time could lost performing worthless evaluations. allow processor avoid doing this, Motorola provides filters msCAN module that will prevent certain unwanted messages from reaching input buffers thus requiring CPU's attention. user must configure these filters best suit message traffic network which node belongs. Although this trivial task, performed design time extra effort spent design phase will translate improved runtime utilisation. Freescale Semiconductor, Inc. filters work simplest case, filters work applying logical comparison individual bits message identifier. each filtered bit, comparison either Test logic Test logic Ignore value Consider following example. Suppose that filter examines eleven bits standard message identifier. each bit, filter will check contains logic (represented `1'), logic (represented `0'), either logic logic (represented `x'). this simple example there only three possible messages. filter will accept messages reject one. Filter value: Message Message Message 0001x1001x0 00011100110 00110100110 00010100100 this case filter will reject Message since third most significant 001. rather than 000. effect filter simply convenient defining messages that must receive. above example there bits whose value ignored whose value fixed. This gives four identifiers that filter will pass 00010100110, 00010110110, 00011100110, 00011110110. AN2010 More Information This Product, www.freescale.com MOTOROLA msCAN filters msCAN filters msCAN provides features described above adds further flexibility allowing user configure filter number ways. M68HC08 family filter single 32-bit value that operates across full 29-bits extended message identifier. this case filter identifies sets messages: that receives that rejects. Alternatively, filter split into two. This allows msCAN examine only first bits message identifier, allows separate filters perform checking. simple example, this would allow Message accepted extra filter available: Filter value Filter value Message Message Message 0001x1001x0 00x101x01x0 00011100110 00110100110 00010100100 Freescale Semiconductor, Inc. msCAN will accept three messages. Filter will accept Messages before filter will accept Message configuration that uses filters, there four sets messages: accepted Filter rejected Filter accepted Filter rejected Filter practice, unimportant which filter accepts message messages accepted either will placed input buffer. This means that message accepted more than filter. example both Filter Filter accept Message filter further split into four 8-bit filters that examine only first bits message identifier. this case filter accept reject complex sets message identifiers only however, where variation first eight bits identifier. M68HC08 family possible filter combinations are: 32-bit filters 16-bit filters 16-bit filter, 8-bit filters 8-bit filters case M68HC12 msCAN module there second 32-bit filter that configured same first filter. other AN2010 MOTOROLA More Information This Product, www.freescale.com Application Note words, M68HC12 family msCAN following combinations: 32-bit filters 32-bit filter, 16-bit filters 32-bit filter, 8-bit filters 16-bit filter, 8-bit filters 16-bit filters 8-bit filters practice msCAN filter uses three sets registers provide filter configuration. Firstly, CIDAC register determines configuration banks into filter sizes number filters. Secondly, registers CIDMR0/1/2/3 determine those bits which filter will operate placing appropriate position filter register. Finally, registers CIDAR0/1/2/3 determine value those bits determined CIDMR0/1/2/3. instance case simple example with filter value 0001x1001x0 CIDMR0/1/2/3 register would configured 00001000010 message identifier bits except would compared against CIDAR0/1/2/3 registers. These would configured 00010100100 this case bits `0', since they ignored equally valid them `1'. Freescale Semiconductor, Inc. AN2010 More Information This Product, www.freescale.com MOTOROLA Configuration Problem Configuration Problem This powerful flexibility brings with problem own. Namely, select best configuration filter size/number filter values most efficiently reject those messages that node wishes ignore. Note that configuration, essential that required message never rejected, many cases this mean that filter accept messages that used node. this situation, microcontroller must still perform acceptance testing each message accepted filter, although would have examine fewer messages than would case without filter. Even systems with only moderate complexity, this filter configuration extremely complex time consuming node programmer select. addition, apparent (without much further work) confirm whether selected combination most efficient reducing overhead message acceptance. above reasons Motorola developed msCAN Filter Generator software tool. objective tool automate selection filter values msCAN module. tool search through many combinations filter values, select most efficient that detect, provide values user form that readily used. rest this application note provides examples illustrate typical uses tool. Note that some less significant details using this tool discussed here fully described software user's manual. Freescale Semiconductor, Inc. AN2010 MOTOROLA More Information This Product, www.freescale.com Application Note Using Filter Generator user configure filter generator software operate variety different modes, however, Software Example begins examining basic operation. filter generator software creates filter configuration examining message identifiers contained lists. first list contains message identifiers that node wishes accept; second list contains message identifiers used network. software will examine accepted message list propose filter configuration that will accept these messages. Next software will compare network list against filter determine which messages will accepted which will rejected. Finally, software will produce listing results either screen text file. Particularly case where there large number messages, possible select best filter configuration first pass. this reason, software automatically repeat process 10,000 times select best configuration that detected. many cases this simple mode will sufficient produce effective filter configuration, before examining further options software, consider preparation message lists filter generator. software always reads message lists from text files. exact format these files, again, configurable, simplest case they consist lists hexadecimal numbers. Consider following example: Freescale Semiconductor, Inc. AN2010 More Information This Product, www.freescale.com MOTOROLA Software Example Software Example this case message list files contained folder named "messages" drive. wanted message list "wanted.txt" network list "network.txt". Each file contains standard bit) message identifiers. content each file shown below: File c:\messages\wanted.txt 0x245 0x256 0x392 0x376 File c:\messages\network.txt (This must contain messages wanted.txt too) 0x067 0x068 0x069 0x123 0x245 0x256 0x257 0x376 0x392 0x393 Freescale Semiconductor, Inc. Execute filter generator software typing following command window single line): mscanfg c:\messages\wanted.txt c:\messages\network.txt filter generator will configure single 32-bit filter best match data times then produce detailed output description window. Note that some warning messages will also created when using above operating mode these ignored this stage. filter generator will display calculated filter values window. this example filter generator produces following output: AN2010 MOTOROLA More Information This Product, www.freescale.com Application Note took loops find optimal filter MSCAN Filter List, generated MSCAN Filter Generator Number filters: Filter size: Number wanted messages: Number unwanted messages: Number unwanted accepted messages: Rejection ratio: Filter values: Filter value 0x4ae0 mask 0x0260 Filter value 0x7ec0 mask 0x1c80 Freescale Semiconductor, Inc. (0100101011100000) (0000001001100000) (0111111011000000) (0001110010000000) List unwanted messages that will accepted current filter pattern: Message 0x257 Accepted filter: List wanted messages accepted different filters Message Accepted filter: 0x392 0x245 0x256 0x376 NOTE: MUST place space between option switch value e.g. -im1. increase number iterations changing parameter. AN2010 More Information This Product, www.freescale.com MOTOROLA Software Example Software Example information network stored convenient textual format shown above. particular, wanted network messages stored single list some other "standard" application. This example explains extract information required from these lists configure Filter Generator read lists correctly. Suppose information stored Microsoft Word format table: Freescale Semiconductor, Inc. Message Name Message Source node Receiving nodes Temperature1 Temperature1 Temperature1 DriverTemp PassengerTemp WindowPosition DoorOpen WindowPosition DoorOpen 1553458A 1553558A 1555658A 12694002 12694003 17334467 17334465 17334477 17334475 Sensor1 Sensor2 Sensor3 ControlPanel ControlPanel Door1 Door1 Door2 Door2 Dashboard, HVAC Dashboard HVAC HVAC HVAC HVAC Dashboard HVAC Dashboard table contains information messages very simple network. This example examines configuration filter generator HVAC node. message extended format these require additional piece information read correctly. There steps follow: Copy table another document Insert additional column table (after column) indicate extended used, place each row. Delete header comment placing character front hexadecimal delimiter front each Message Convert table text format separated commas `,'. AN2010 MOTOROLA More Information This Product, www.freescale.com Application Note Save file text format "network2.txt" Temperature1, 0x1553458A, Sensor1, Dashboard, HVAC Temperature1, 0x1553558A, Sensor2, Dashboard Temperature1, 0x1555658A, Sensor3, HVAC DriverTemp, 0x12694002, ControlPanel, HVAC PassengerTemp, 0x12694003, ControlPanel, HVAC WindowPosition, 0x17334467, Door1, HVAC DoorOpen, 0x7334465, Door1, Dashboard WindowPosition, 0x17334477, Door2, HVAC DoorOpen, 0x17334475, Door2, Dashboard Delete lines table that have HVAC receiver Save file text format "wanted2.txt" Temperature1, 0x1553458A, Sensor1, Dashboard, HVAC Temperature1, 0x1555658A, Sensor3, HVAC DriverTemp, 0x12694002, ControlPanel, HVAC PassengerTemp, 0x12694003, ControlPanel, HVAC WindowPosition, 0x17334467, Door1, HVAC WindowPosition, 0x17334477, Door2, HVAC Freescale Semiconductor, Inc. filter generator using following command: mscanfg c:\messages\wanted2.txt c:\messages\network2.txt 1000 this example filter generator produces following output: took 1000 loops find optimal filter MSCAN Filter List, generated MSCAN Filter Generator Number filters: Filter size: Number wanted messages: Number unwanted messages: Number unwanted accepted messages: Rejection ratio: Filter values: Filter value mask Filter value mask 0xbbde88ee 0x2ac408ea 0xaabecb14 0x00244000 List unwanted messages that will accepted current filter pattern: Message Accepted filter: AN2010 More Information This Product, www.freescale.com MOTOROLA Software Example List wanted messages accepted different filters Message 0x17334467 0x17334477 0x12694003 0x1555658a Accepted filter: NOTE: Freescale Semiconductor, Inc. option tells Filter Generator that file contains message that extended format. tell Filter Generator which extended format data field immediately following must `1'. data standard data field must contain `0'. Extended standard messages both used same file. information stored Microsoft Excel format then follow above sequence except that steps executed single step using save comma delimited text (CSV). Software Example examples filter configuration been left Filter Generator tool. these cases tool itself will decide optimum configuration filter size. However, user define exact filter configuration specifying number filters their size. This useful feature take advantage where there visible pattern obvious user perhaps where minor change made network filter configuration should remain before. options used define configurations. From earlier description filter options 68HC08 68HC12 families possibilities available configure tool are: Family Option Configuration 68HC08 68HC08 68HC08 68HC12 68HC12 68HC12 -nf4 -nf2 -s16 -nf1 -s32 -nf8 -nf4 -s16 -nf2 -s32 filters filters filters filters filters filters AN2010 MOTOROLA More Information This Product, www.freescale.com Application Note demonstrate effect forcing filters certain sizes, Software Example re-run with filter size forced mscanfg c:\messages\wanted2.txt c:\messages\network2.txt 1000 This produces result that efficient: took 1000 loops find optimal filter MSCAN Filter List, generated MSCAN Filter Generator Number filters: Filter size: Number wanted messages: Number unwanted messages: Number unwanted accepted messages: Rejection ratio: Filter values: Filter value 0xb99e mask 0x0000 Filter value 0xaaba mask 0x0000 Filter value 0xaa9e mask 0x0000 Filter value 0x935a mask 0x0000 Freescale Semiconductor, Inc. (1011100110011110) (0000000000000000) (1010101010111010) (0000000000000000) (1010101010011110) (0000000000000000) (1001001101011010) (0000000000000000) List unwanted messages that will accepted current filter pattern: Message 0x1553558a 0x17334475 Accepted filter: List wanted messages accepted different filters Message 0x17334467 0x1555658a 0x17334477 0x12694003 0x12694002 0x1553458a Accepted filter: AN2010 More Information This Product, www.freescale.com MOTOROLA Software Example Software Example This example examines more advanced features Filter Generator. particular looks options generating language configuration file, using alternative algorithm, other minor details. filter generator produce language function that will configure filter registers msCAN module option. file produced contains ANSI function with following prototype: void msCANFiltersInit(void) Freescale Semiconductor, Inc. Filter Generator includes alternative algorithm selecting suitable filter configuration. This second option faster than main choice require more iterations achieve same result main choice option. typical first pass network configuration determine complexity filter selection task. message includes that indicates Remote Transmission Request. Like Extended field this data determined each individual Message placed separate field after extended field input files. present then filter will operate this also. examples Filter Generator tool displayed results window. This helpful when examining different options making judgements tool. However, where output will used configure msCAN module text file much more useful outcome. option specify name output file. Finally, Filter Generator produce detailed "map" operation selected filter configuration wanted messages option. This allows user which filters accept most messages this turn used optimise specification Message used within network. examples shown here option. Software Example language output file called filter.c specified. addition, detailed description performance selected configuration produced executing following command: mscanfg c:\messages\wanted2.txt c:\messages\network2.txt c:\messages\filter.c AN2010 MOTOROLA More Information This Product, www.freescale.com Application Note This produces following output message: took loops find optimal filter Filter information written c:\messages\filter.c detailed output function: MSCAN Filter List, generated MSCAN Filter Generator Freescale Semiconductor, Inc. Number filters: Filter size: Number wanted messages: Number unwanted messages: Number unwanted accepted messages: Rejection ratio: Filter values: Filter value mask Filter value mask 0xbbde88ee 0x2ac408ea 0xaabecb14 0x00244000 List unwanted messages that will accepted current filter pattern: Message Accepted filter: List wanted messages accepted different filters Message 0x1553458a 0x12694002 0x17334477 0x17334467 Accepted filter: function initialize MSCAN filters: void msCANFiltersInit( void sure that SFTRES set! CIDAC 0x0; (unsigned long *)CIDAR0 0xbbde88ee; (unsigned long *)CIDMR0 0x2ac408ea; (unsigned long *)CIDAR4 0xaabecb14; (unsigned long *)CIDMR4 0x00244000; return; AN2010 More Information This Product, www.freescale.com MOTOROLA Other Considerations Other Considerations Although Filter Generator tool wide range options examine message data, does static sense. other words, takes account number times each message broadcast network. This means that although filter appear highly successful accepting only single message many rejected, this accepted message most common network, overhead dealing with still large. this case more effective modify filter generator configuration options force this regular message rejected accept others that less often transmitted. hardware implementation msCAN filter itself, some standard inadvertently rejected because filter does pattern match more than message itself. This occur when standard used with 16-bit filter size. 11-bit itself, extended indicator (IDE bit) handled required, leaving three bits 16-bit filter undefined. these lower mask bits then filter comparison will continue beyond section message into next sections message that DLC, data etc. avoid this problem, least significant three bits mask register (CIDMR1/3) must force filter ignore message bits that part Freescale Semiconductor, Inc. Conclusion Motorola msCAN Filter Generator provides powerful flexible optimising filter configuration msCAN module. This turn greatly reduce overhead handling messages intended particular node. Software Availability receive further information about msCAN Filter Generator tool obtain software itself send email CAN@metrowerks.com with msCAN Filter Generator subject line. AN2010 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Motorola reserves right make changes without further notice products herein. Motorola makes warranty, representation guarantee regarding suitability products particular purpose, does Motorola assume liability arising application product circuit, specifically disclaims liability, including without limitation consequential incidental damages. "Typical" parameters which provided Motorola data sheets and/or specifications vary different applications actual performance vary over time. operating parameters, including "Typicals" must validated each customer application customer's technical experts. Motorola does convey license under patent rights rights others. Motorola products designed, intended, authorized components systems intended surgical implant into body, other applications intended support sustain life, other application which failure Motorola product could create situation where personal injury death occur. Should Buyer purchase Motorola products such unintended unauthorized application, Buyer shall indemnify hold Motorola officers, employees, subsidiaries, affiliates, distributors harmless against claims, costs, damages, expenses, reasonable attorney fees arising directly indirectly, claim personal injury death associated with such unintended unauthorized use, even such claim alleges that Motorola negligent regarding design manufacture part. Motorola registered trademarks Motorola, Inc. Motorola, Inc. Equal Opportunity/Affirmative Action Employer. reach USA/EUROPE: Motorola Literature Distribution; P.O. 5405, Denver, Colorado 80217. 1-303-675-2140 HOME PAGE: http://motorola.com/sps/ JAPAN: Motorola Japan Ltd.; SPS, Technial Information Center, 3-20-1, Minami-Azabu, Minato-ku, Tokyo 106-8573 Japan. 81-3-3440-3569 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, King Street, Industrial Estate, N.T., Hong Kong. 852-266668334 CUSTOMER FOCUS CENTER: 1-800-521-6274 Motorola, Inc., 2000 More Information This Product, www.freescale.com AN2010/D Other recent searchesSM5307B - SM5307B SM5307B Datasheet PT2352 - PT2352 PT2352 Datasheet NJM2710 - NJM2710 NJM2710 Datasheet MAX1775 - MAX1775 MAX1775 Datasheet G6854-01 - G6854-01 G6854-01 Datasheet ECS-2200 - ECS-2200 ECS-2200 Datasheet
Privacy Policy | Disclaimer |