This application note describes CAN protocol driver software routines written in ‘C’ for the members of the Siemens 16-bit microcontroller family C166 which are equipped with an on-chip CAN module (e.g. C167CR, C164CI).
1 Introduction3
1.1 Abstract..3
1.2 CAN Driver Routines Overview .3
1.3 Files included in the CAN Driver ApNote4
1.4 Global Variables used by the Driver Routines4
1.5 Notes concerning this ApNote 5
2 Routine #1: Initialization Procedure for the CAN Module7
3 Routine #2: Configuring a Message Object of the CAN Module10
4 Routine #3: Load the data bytes of a Message Object..13
5 Routine #4: Read the data bytes of a Message Object (1..14) 15
6 Routine #5: Read out Message Object 15 (Basic CAN Message Object) 17
7 Routine #6: Send a Message Object .20
8 Routine #7: Check a Message Object (1..14) for new data ..22
9 Routine #8: Check Message Object 15 for new data or new remote frame24
10 Routine #9: Check for a Bus Off Situation in the CAN Module25
11 Hints concerning the CAN Library CAN16X1.LIB26
12 Hints concerning the Example Programs..26
13 Hints concerning the Interrupt Service Routine CISR16X1.C ..30
14 Hints concerning the Header File CREG_16X.H..33
15 Hints concerning the CANalyzer Configuration Files (*.CFG) .33
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !