Contents - Elektor

1.1.6 Intellibus. 19 ... 9.1.6 mikroElektronika CAN Communication Kit. 103 ... 140. 11.7.1 Structure of a mikroC Program. 141. 11.7.2 Variable Names. 143.
105KB taille 9 téléchargements 240 vues
Contents

Preface

9

Acknowledgements

11

1. THE AUTOMOTIVE BUS SYSTEMS 1.1 Vehicle Bus Systems 1.1.1 CAN Bus 1.1.2 LIN Bus 1.1.3 FlexRay 1.1.4 MOST 1.1.5 Byteflight 1.1.6 Intellibus 1.1.7 Comparison of Automotive Bus Systems 1.2 Summary

13 15 16 16 17 18 18 19 20 21

2.

A BRIEF HISTORY OF CAN 2.1 CAN IN Automotive Industry 2.2 The Basic Structure of a CAN Automotive System 2.3 Advantages of the CAN Bus 2.4 Disadvantages of the CAN Bus 2.5 Properties of the CAN Bus 2.6 Summary

25 28 29 35 36 36 37

3.

THE ISO/OSI REFERENCE MODEL AND CAN 3.1 CAN Bus ISO/OSI Model 3.2 Summary

39 41 43

4.

CAN PHYSICAL LAYER 4.1 CAN Bus Termination 4.2 CAN Bus Data Rate 4.3 Cable Stub Length 4.4 CAN Bus Signal Levels 4.5 CAN Connectors 4.6 Summary

45 45 47 48 49 50 52



Contents

5. CAN BUS FRAMES 5.1 Data Frame 5.1.1 Start Of Frame (SOF) 5.1.2 Arbitration Field 5.1.3 RTR Field 5.1.4 Control Field 5.1.5 Data Field 5.1.6 CRC Field 5.1.7 ACK Field 5.1.8 End of Frame Field 5.2 Remote Frame 5.3 Error Frame 5.4 Overload Frame 5.5 Extended CAN Frames 5.6 Summary

53 55 56 56 58 59 59 60 61 61 62 62 64 65 66

6. CAN BUS ERROR CONDITIONS 6.1 Bit Stuffing 6.2 CAN Bus Error Detection 6.2.1 Bit Error 6.2.2 Bit Stuffing Error 6.2.3 CRC Error 6.2.4 Frame Error 6.2.5 ACK Error 6.3 CAN Bus Fault Confinement 6.4 Summary

67 67 69 69 69 69 70 70 70 72

7.

DATA EXCHANGE ON CAN BUS 7.1 Data Exchange With Data Frames 7.2 Remote Frames on the Bus 7.3 Summary

73 73 77 78

8. CAN BUS TIMING 8.1 Bit Timing 8.2 Selection of Bit Timing Segments 8.2.1 The Prop_Seg 8.2.2 The Oscillator Tolerance 8.3 Summary

79 79 82 83 84 96



Contents

9. CAN BUS DEVELOPMENT TOOLS 9.1 Hardware development Tools 9.1.1 The RCDK8C CAN Development Kit 9.1.2 CCS CAN Bus Development Kit 9.1.3 CAN MicroMOD Development Kit 9.1.4 Starterkit MB91360 9.1.5 BASIC-Tiger CAN Bus Prototyping Board 9.1.6 mikroElektronika CAN Communication Kit 9.1.7 mikroElektronika CAN-1 Board 9.1.8 mikroElektronika CANSPI Board 9.2 Software Development Tools 9.3 CAN Bus Analyzers 9.3.1 Microchip CAN Bus Analyzer 9.3.2 CAN Bus X-Analyzer 9.3.3 PCAN Lite 9.3.4 PCAN Explorer 9.3.5 CAN Physical Layer Analyzer 9.3.6 CAN-Bus-Tester 9.3.7 LeCroy Bus Analyzer 9.4 An Example Using a CAN Bus Analyzer 9.5 Summary

97 97 97 99 101 101 102 103 104 104 106 106 106 107 108 109 109 111 111 113 118

10.

CAN BUS CONTROLLERS 10.1 The Basic Structure of a CAN Transceiver 10.2 The Basic Structure of a CAN Controller 10.3 The MCP2515 Controller 10.4 Microcontrollers with Built-in CAN Bus Modules 10.5 Summary

119 120 122 125 126 128

11. MICROCONTROLLER BASED CAN BUS PROJECTS 11.1 What is a Microcontroller ? 11.2 The PIC18F Microcontroller Series 11.3 PIC18F Microcontroller Architecture 11.4 Resetting the Microcontroller 11.5 Clock Sources 11.6 Parallel I/O Ports 11.7 mikroC Programming Language 11.7.1 Structure of a mikroC Program 11.7.2 Variable Names 11.7.3 Variable Types 11.7.4 Constants

129 129 130 131 135 136 139 140 141 143 144 146 

Contents

11.8 12.

11.7.5 Arrays 11.7.6 Pointers 11.7.7 Structures 11.7.8 Operators in C 11.7.9 Modifying in the Flow of Control 11.7.10 Iteration Statements 11.7.11 Functions and Libraries 11.7.12 LCD Interface 11.7.13 Example Program 11.7.14 Testing 11.7.15 PIC® Microcontroller CAN Interface 11.7.16 PIC18F258 Microcontroller 11.7.17 PIC18F258 Message Transmission 11.7.18 PIC18F258 Message Reception 11.7.19 mikroC CAN Functions 11.7.20 CAN Bus Project Development 11.7.21 CAN Bus Project 1 11.7.22 CAN Bus Project 2 11.7.23 CAN Bus Project 3 Summary

149 151 153 156 164 168 176 177 182 186 188 190 191 191 193 198 198 213 224 238

ON BOARD DIAGNOSTICS (OBD) 12.1 OBD II 268 12.2 Hand-Held OBD II Scan Tools 12.3 PC Based OBD II Scan Tools 12.4 Data Logging 12.5 Example Using Hand-Held OBD II Scan Tool 12.6 Summary

239 239 244 244 246 246 253

Index



255