Download Microcontrollers ApNote AP2922
Transcript
’C’ CAN Driver Routines for the C166 family 1 Introduction....................................................................................................................3 1.1 Abstract.........................................................................................................................3 1.2 CAN Driver Routines Overview ....................................................................................3 1.3 Files included in the CAN Driver ApNote......................................................................4 1.4 Global Variables used by the Driver Routines..............................................................4 1.5 Notes concerning this ApNote ......................................................................................5 2 Routine #1: Initialization Procedure for the CAN Module...........................................7 3 Routine #2: Configuring a Message Object of the CAN Module..............................10 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 frame............24 10 Routine #9: Check for a Bus Off Situation in the CAN Module..............................25 11 Hints concerning the CAN Library CAN16X1.LIB....................................................26 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 AP2922 ApNote - Revision History Actual Revision : Rel.01 Previous Revision: --Page of Page of Subjects changes since last release) actual Rel. prev. Rel. Semiconductor Group 2 of 33 AP2922 05.97