EP1829294A1 - Dispositif pour systeme can - Google Patents

Dispositif pour systeme can

Info

Publication number
EP1829294A1
EP1829294A1 EP05794435A EP05794435A EP1829294A1 EP 1829294 A1 EP1829294 A1 EP 1829294A1 EP 05794435 A EP05794435 A EP 05794435A EP 05794435 A EP05794435 A EP 05794435A EP 1829294 A1 EP1829294 A1 EP 1829294A1
Authority
EP
European Patent Office
Prior art keywords
frequency
oscillator
bit
module
controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
EP05794435A
Other languages
German (de)
English (en)
Inventor
Lars-Berno Fredriksson
Kenth Lennartsson
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Callahan Cellular LLC
Original Assignee
Kvaser Consultant AB
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from SE0402573A external-priority patent/SE533636C2/sv
Application filed by Kvaser Consultant AB filed Critical Kvaser Consultant AB
Publication of EP1829294A1 publication Critical patent/EP1829294A1/fr
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/407Bus networks with decentralised control
    • H04L12/413Bus networks with decentralised control with random access, e.g. carrier-sense multiple-access with collision detection (CSMA-CD)

Definitions

  • a device for a CAN system is a device for a CAN system.
  • the present invention relates to a device intended to be comprised in a module in a CAN system with CAN connection.
  • CANalyzer from Vector Informatik GmbH
  • X- analyser from Warwick Technologies Ltd
  • CANlab from Accurate Technologies Inc.
  • PC-based software that, in conjunction with various CAN/PC interfaces from Kvaser AB, for example LAPcan, can retrieve, timestamp . and send messages and error frames on the bus in order to determine the appearance in relation to time of messages on the bus and if and when errors appear.
  • CAN Scope from Vector Informatik that can measure voltage levels on the CAN bus as a function of the time and, using the rules of the CAN protocol, can display an interpreted image in which the voltage levels are displayed as CAN bits .
  • oscilloscopes incorporating corresponding interpretation. Kvaser markets a product, Memorator, by means of which a large number of messages can be timestamped and saved for later analysis.
  • CAN Controllers can only be set to certain bit times determined by the frequency of the oscillator that clocks the CC. For example, 1 Mbit/s can not be set at all with a 13 MHz or 33 MHz clock frequency, while with a 12 MHz frequency only the sample points 50% and 66.67% can be selected.
  • oscillators are required with great precision, often 500 ppm down to 20 ppm.
  • the USB standard demands at least 500 ppm precision and USB components often demand tighter tolerances, for example Philips recommends 50 ppm for its ISP1761 USB host controller.
  • a unit forming a CAN module to be able to be connected to the CAN system and to be used for various target and indication cases and, for example, to be used as the source in the system for interpretation and initiation of various functions in the CAN system.
  • the unit must, for example, be able to be connected as a source of interference in the system in association with testing.
  • the unit must be able to be sold as separate to the CAN module or corresponding individual connectable unit.
  • the unit must also be able to work with components that are constructed and function in a simple way.
  • the unit must be able to work with connections of various types (topologies), preferably bus connections but also with optical connections, star-wired connections and/or network connections.
  • an oscillator is introduced with variable clock frequency that clocks the CC and a reference frequency that can be compared with the variable clock frequency.
  • the source of the reference frequency can be a crystal oscillator or it can be obtained indirectly from messages on the CAN bus by measuring how many- clock cycles the message takes up from Start Of Frame to the acknowledgement bit and comparing this with a theoretically derived value.
  • the present invention solves all or parts of the said problem and, in connection with this, indicates new ways of looking at the CAN bus and its function.
  • the invention works principally with a CC, a CAN Transceiver (CT) , an oscillator with variable frequency, a CPU with associated memories and peripherals and a reference frequency.
  • CT CAN Transceiver
  • the invention utilizes protocol rules according to CAN (ISO 11898-1) and indication of the SOF and ACK bits in the CAN messages.
  • the protocol's rules are utilized for the construction of a CAN message on the bus.
  • one or more counters are also utilized.
  • the invention also relates to a method for enabling a module to adjust automatically to a system' s bit rate.
  • the invention is mainly characterized by the characterising parts of claim 1 and the independent claims.
  • the principal characteristics of a device according to the invention can be that it comprises an oscillator that, in response to directions from an associated microcomputer, generates a number of different frequencies and also comprises a CAN Controller utilizing the frequencies that is connected or can be connected to the connection via a transceiver.
  • CAN messages can only occur in CAN Controllers.
  • a transmitting CAN Controller generates pulses at TTL level on its TX connection to a CAN transceiver that amplifies these to a pulse train on the bus.
  • the CAN transceivers of receiving modules read off the pulse train on the bus and convert these to pulses at TTL level and display these on the RX connection of the respective connected CAN Controllers.
  • the CAN Controller interprets the pulses according to the CAN protocol and determines whether they represent a correct CAN message or not.
  • a device with a CAN transceiver, a CAN Controller, a variable oscillator and a microprocessor as the main components, which among other things can generate pulses and pulse trains on the bus and can also analyse pulses and pulse trains on the bus according to the rules of the CAN protocol and determine within which limits the pulse train on the bus can be interpreted as correct CAN messages, when Error Flags are to be generated and when a pulse on the CAN connection is to be disregarded.
  • the new way of thinking is that CAN messages only occur in CAN Controllers.
  • a transmitting CAN Controller generates pulses at TTL level on its TX connection to a CAN transceiver that amplifies these to a pulse train on the bus.
  • the CAN transceivers of receiving modules read off the pulse train on the bus and convert these to pulses at TTL level and display these on the RX connection of the respective connected CAN Controllers.
  • the CAN Controller interprets the pulses according to the CAN protocol and determines whether they represent a correct CAN message or not.
  • Figure 1 shows the construction of bits and bit segments in a CAN system
  • Figure 2 shows in the form of block diagram the construction of a CAN module with the new components that can be connected to CAN systems that comprise a connection (for example a bus connection) to which other CAN modules are also connected,
  • a connection for example a bus connection
  • Figure 3 shows in the form of block diagram a second embodiment of a CAN module with a number of CAN Controllers and transceivers
  • Figure 4 shows in the form of a combined diagram and block diagram bit and structure configurations
  • Figure 5 shows in the form of a diagram the relationships between bit configurations
  • Figure 6 shows in the form of a diagram additional relationships between bit constellations
  • FIG. 7 shows in the form of block diagram an embodiment that is modified in relation to the embodiment according to Figure 3,
  • FIG. 8 shows in the form of block diagram an embodiment that is further modified in relation to the embodiment according to Figure 3.
  • Figures 9, 10 show in the form of diagrams third and fourth embodiments.
  • a CAN bit 100 is shown in Figure 1. It is constructed of a number of bit quanta, BTQ, that are generated by an oscillator whose frequency is broken down by a prescaler and divided into Synchronization Segment (Sync_Seg) , Propagation Segment (Prop__Seg) , Phase Segment 1 (Phase_Seg 1) and
  • Phase Segment 2 Phase Segment 2 (Phase_Seg 2), or alternatively into
  • TSEG_2 TSEG-2 .
  • the symbol 0 is dominant over 1.
  • a maximum of five consecutive symbols of the same value can be transmitted ' , after which at least one symbol of opposite value must be transmitted. If six or more symbols of the same type are to be transmitted, an extra symbol of opposite type is inserted, so-called bit stuffing.
  • bit stuffing For signalling, the Non Return to Zero
  • NRZ consecutive symbols of the same value are identified by dead reckoning.
  • a free bus has the continual value 1.
  • a message is introduced by a zero, Start of Frame (SOF) .
  • SOF Start of Frame
  • the falling edge on changing from 1 to 0 at SOF is utilized for synchronization of all the connected CCs. These are then re-synchronized at each falling edge in the following bit sequence in a message.
  • Sync Jump Width SJW is the maximum number of BTQ that can be used for adjusting the bit length during resynchronization.
  • TSEG_1 is shortened or TSEG_2 is lengthened by the requisite number of BTQ, however at most SJW.
  • the CAN protocol places requirements on CCs' oscillators connected to a system. Their frequency fo sc must not deviate from a nominal frequency f n om by more than df according to the following, where all the conditions must be fulfilled:
  • the invention also relates to a method for enabling a module to adjust automatically to a system's bit rate.
  • Figure 2 shows the invention schematically.
  • the object of the invention 202 and also one, 203, or more, 204, modules that are active on the bus are connected to a CAN connection 201.
  • the object of the invention has a microprocessor 205 with requisite peripherals 206 and can be connected via a connection 207 to a high-level computer 208, for example a PC, via a USB connection.
  • the microprocessor is connected to the CAN Controller CCl via the connection 209.
  • the CAN Controller contains a state machine 230 that operates according to rules for CAN 231, an error counter 232, transmission logic 233 that generates outgoing pulses, bit time logic 234 that, among other things, determines the sample point and bit end, a configuration register 235, message queues for incoming 236 and outgoing 237 messages, a filter 238, a clock generator 239 and a communication device 240 for communication with the microprocessor.
  • CCl is clocked by a clock frequency 210, generated by the variable oscillator 211.
  • the microprocessor sets the oscillator's 211 frequency via the connection 212 and the setting logic 241.
  • CCl is connected to the CAN transceiver CTl via the transmission connection TXl and the reception connection RXl.
  • CTl is connected to the CAN bus 201 via the CAN High connection 213 and the CAN Low connection 214. These are also connected to the AD-transducer 215 that can measure the potential of the respective connections in relation to the earth reference potential 216.
  • the microprocessor can read off the AD- transducer via the connection 217 and can thereby not only ascertain the change of level on the bus, but also measure the deviations in potential of other transmitting modules relative to the earth reference 216.
  • the microprocessor can also set CTl in active or listen only mode via the connection 218.
  • CCl signals on TXl are prevented from going out on the bus 201 but are returned to RXl.
  • the microprocessor has also one or more clock functions 219 with counter and capture register 220. Pulse trains 221 appear on the bus. Each such pulse train 221' changes between two differential voltage levels, level 0 (Level 0) and level 1 (Level 1) .
  • CTl receives a pulse train 221' and displays it on CCl' s RX input RXl at TTL level 220" .
  • the pulse train is now interpreted by CCl according to the rules for CAN.
  • the first change 242 from level 1 to level 0 is interpreted as SOF if level 0 still applies at the sample point, otherwise the change is disregarded.
  • CCl generates a bit pattern according to the CAN rules, that goes out as a pulse train on the connection TXl to CTl that sends out a corresponding pulse train on the CAN bus.
  • CCl is set to a bit length 1 that is six times longer than the value set in the modules 203 and 204 and assume that CCl is to transmit a message where the CAN identifier starts with 1.
  • CCl sends out SOF to CTl, which in turn changes the CAN bus level from 1 to 0. This level persists until CCl sends out level 1.
  • modules' 203 and 204 CCs have detected a correct SOF followed by five bits with the same symbol 0 which is not in accordance with the bit stuffing rules of the CAN protocol, for which reason they transmit an error flag.
  • the module's 203 sample point can be determined in the following way: 1.
  • the modules 204 are disconnected from the bus, or alternatively continue in silent mode. 2.
  • the system's bit frequency is 250 kbit/s and CCl is set to this with the frequency 16 MHz.
  • the microcontroller 205 sets the oscillator 211 to 21.333 MHz and commands CCl to transmit any message in which the CAN identifier starts with 1111.
  • a pulse has gone out on the bus that represents 75% of a zero according to the CAN protocol.
  • the CC in 203 has detected a falling edge from level 1 to level 0 and, if the level does not persist at the sample point, then no action is taken, which is now assumed to be the case.
  • CCl receives its own message, but CTl transmits level 0 from the bus on account of the error flag transmitted by the CC in 203. 10. CCl indicates bit error due to the error flag and reports failure of transmission to the microprocessor. 11. From what has occurred, it can be ascertained that the sample point of the CC in 203 lies between 75 % and 76.2 % of the bit time.
  • FIG. 3 shows schematically a construction of a CAN module according to the invention.
  • a module 302 according to the invention is connected to the CAN bus 301 and one or more other modules connected to the system are represented by 304.
  • the CAN module consists of a microprocessor 305 with requisite peripherals 306.
  • the CAN module can be connected to a high-level computer 307, for example a PC, via the connection 308, for example a USB connection.
  • the microprocessor arrangement there are one or more clock functions 309, 309', each with a- counter with one or more capture registers 310, 310'.
  • the oscillator 303 is of a type with variable frequency and clocks the clock function 310.
  • a CAN Controller CCl is comprised in the microprocessor, or alternatively can be connected to the microprocessor, which CAN Controller CCl is also clocked by the oscillator 303.
  • the CC is connected to a transceiver CTl in the usual way via the RX and TX connections.
  • the transceiver has, among other things, the task of matching levels in the connection to the processing levels that apply in the processing equipment.
  • Known transceiver types can be used, for example SN65HVD235D from Texas Instrument.
  • the oscillator's 303 frequency can be controlled from the microprocessor via the connections 313.
  • the microprocessor arrangement is equipped with a temperature sensor 317.
  • the CAN system works with a nominal bit frequency, for example 250 kbit/s, which occurs commonly in practice.
  • the well-known CAN protocol SAE J1939 works with this bit rate.
  • the oscillator 303 can be a Dallas Maxim DS1086, which has a digitally-set fundamental frequency between 33.3 and 66.6 MHz in ranges of 5.12 MHz. Within each range, the frequency can be set in steps of 5 kHz, that is 1024 steps giving a resolution of approx. 1 per thousand.
  • Example of bit rates achieved by CCl Example of bit rates achieved by CCl:
  • the example above shows that it is possible to achieve a time resolution of parts of a ns in the bit time per setting step and that, with one and the same incoming frequency, it is possible to obtain different bit times by changing the number of BTQ in the bit. It is thus possible to utilize an inexpensive variable oscillator as the one proposed for the generation of bits with small differences between them.
  • the proposed oscillator has very wide tolerances, +/- 0.5 % for the set fundamental frequency and over 3 % across the temperature range -40 to +85° C.
  • a reference frequency 312 is introduced that can be generated by a crystal oscillator 311 and the temperature sensor 317 is introduced in order to be able to obtain the current temperature and thereby the ability to correct for temperature variations.
  • crystal oscillators with high precision, 50 ppm and below, available at a low cost as they are used in mass-produced apparatuses such as mobile telephones, computers, clocks, etc.
  • the oscillator 311 can advantageously be selected from such a range that the frequency is of lesser importance in comparison to the precision and the cost.
  • the oscillator 311 clocks the clock function 309' with the fixed frequency 312 that can be broken down into a suitable frequency for the counter 310'.
  • the variable oscillator 303 is connected to the clock function 309.
  • the oscillator 303 clocks the CCl.
  • the microprocessor 305 can advantageously be clocked by the oscillator 303 via the connection 314 if an internal CC is to be used, but can be clocked in another way.
  • the microprocessor 305 sets the oscillator's 303 outgoing frequency 315 via the connection 313.
  • the microprocessor 305 can read off the current temperature from the temperature sensor 317 via the connection 316.
  • data 318 has been stored in the microprocessor' s memory concerning the oscillator's 311 frequency and, if required, also its temperature dependence.
  • the frequency 312 is now utilized as the reference frequency according to the following:
  • the system now consists of an adjustable clock signal 315 with a poor precision, for example 0.5 % and a second fixed clock signal 312 with a high precision, for example 20 ppm, that are to be set in relation to each other so that their mutual relationship is ensured and so that it is thereby possible to calibrate the oscillator 303 to a higher precision, for example 200 ppm or better.
  • the measurement of a clock signal can be carried out in two different ways.
  • the direct method is to measure the period of the clock signal. However, the period time of a 25 MHz clock signal is 40 nanoseconds and a measurement with a precision of 0.1 % requires a resolution of 4 picoseconds, which is difficult with current technology.
  • the second method is to count the number of clock pulses over a particular period of time and to compare the number of clock pulses according to the equation:
  • the reference crystal 311 is assumed to have the frequency 19 MHz.
  • the microprocessor sets the oscillator 303 to 19 MHz via the connection 313.
  • the clock signal 312 is connected to one of the microprocessor's clock inputs 321 via the frequency transmitter 320, that halves the frequency to a permitted 9.5 MHz. By setting special logic for this input, the signal can be connected to a counter, symbolized by 310', with 16 bits.
  • M32C has additional logic 322 that makes it possible to restart the counter when a set value has been reached or when the counter has reached its highest value, hexadecimal FFFF.
  • the counter logic has a function that means that an input can change level, that is a divided-down clock signal is obtained, relative to the connected clock frequency.
  • This output is thereafter connected to a second counter input 323 on M32C.
  • the input logic is set so that the signal is used to start and stop the counter.
  • This counter is set in such a way that it counts the internal clock 324 that is driven by the clock signal 315.
  • the output in 322 changes over and starts the counting of clock signals that come from the clock signal 315 in the counter 310. Thereafter these two counters count pulses simultaneously.
  • the output changes value and the second counter 310 stops. Thereafter the microprocessor can read off the value in the second counter 1 that can be compared directly with the first counter's change-over point from 1' to 2'.
  • M32C has logic that makes it possible to rescale the clock pulses 312, by dividing down the frequency before it is connected to the second counter. If the resolution is not adequate with this direct measurement , then it is possible to extend the measurement over a number of the abovementioned measurement periods by using interrupts and software.
  • a reference frequency can be obtained from the CAN bus.
  • a CC is used that can give a signal upon the detection of SOF, which the CC MCP2515 from Microchip can do, and in addition the module's CAN connection can be set to listen only mode, that is can receive messages, but not the signals on the bus.
  • This can be achieved by the use of a CAN transceiver SN65HVD235D from Texas Instrument. This can be connected in an "autobaud feedback loop" whereby it forwards incoming signals to the CC s RX input but stops the CC s signals from the TX output from coming out on the bus, that is the same as listen only mode.
  • CTl can be set in active or listen only mode by the processor 305 via the connection 330 and CCl can generate an SOF pulse directly or indirectly to the clock function 309 or alternatively to the processor 305 via the connection 331.
  • signals on RXl and TXl can be connected directly or indirectly to 309 via the connections 332 and 333 respectively.
  • the module or modules 304 connected to the CAN bus 301 are assumed to send messages symbolized by 332.
  • the abovementioned reference frequency device 333 is now not needed. The reference frequency is obtained by the sequence described below.
  • the current bit rate on the CAN bus 301 is assumed to be 250 kbit/s.
  • the CCl is able to compensate for a large deviation between the transmitting CC s oscillator and its own by adjusting its bit time by up to 4 BTQ at each resynchronization. 4
  • the counter's 310 value is captured in capture register 1. 4.a
  • the counter 310 captures each value when the connection 332 exhibits a falling edge in a capture register.
  • the microprocessor reads off and saves the captured value when it has received an SOF indication from CCl.
  • CTl signals a falling edge on TXl, which is forwarded to the counter 310 via the connection 332, the counter's value is captured in the capture register 2.
  • the microprocessor reads off the captured value one or several clock cycles after a falling edge has been detected on TXl.
  • CCl When CCl has indicated a received message to the microprocessor, it reads this off and determines, using the rules of the CAN protocol, how many clock cycles N in 309 this message would have occupied from the SOF sample point, up to the falling edge in ACK,
  • the microprocessor calculates the value M which is the difference between the values captured in the capture register 1 and the capture register 2 minus the number of pulses corresponding to 6 BTQ (the number up to the sample point in SOF) , 9.a or alternatively minus 0.
  • the microprocessor obtains the reference frequency by dividing N by M.
  • the frequency of a particular module on the network can be obtained.
  • a virtual system frequency can be obtained.
  • the oscillator 303 When the oscillator 303 has been calibrated to the reference frequency, it can be set to the correct frequency in order to obtain the correct bit time for the system. Thereafter the CCl bit-timing register is set to the values specified for the system and is thereafter ready for active signalling on the bus. The calibration is suitably repeated at different temperatures, after which temperature compensation can be carried out.
  • the invention thus makes it possible to set a module according to a CAN system specification with any bit time and low frequency deviation using simple and inexpensive standard components.
  • the requirement concerning the oscillator tolerance of the individual modules is dependent upon the system's construction and the CCs setting of bit time and SJW.
  • the tolerance specified in the specification for the CAN system in question for example 1 %, is used as a starting point.
  • the microprocessor is first set to a nominal frequency, for example 16 MHz, and a number of messages, for example 1000 messages, are received without errors.
  • the microprocessor sets (16*1.05) MHz and if a number of messages, for example 1000 messages, are received correctly, the upper tolerance limit has been verified for reception.
  • the procedure is repeated with the oscillator setting (16*0.995) MHz and if the same number of messages is received correctly, then the whole tolerance range has been verified for reception.
  • the procedure is repeated with the transmission of a corresponding number of messages and if they can be transmitted without the other modules generating error frames, the tolerance range has been verified.
  • the swing is increased to, for example, +/- 1.5 % and the microprocessor steps up the frequency, for example in increments of 0.01 %, after each 1000th received message. For each increment, the number of error frames that CCl generates is recorded. By logging all values in a test vehicle over a long period of time and under extreme conditions, the number of error frames can be compiled as a function of the frequency and the limits for the permitted frequency deviation in the system can be validated.
  • FIG. 4 shows an alternative embodiment of the object of the invention 402 connected to a CAN bus 401 that operates at 250 kbit/s.
  • the module 402 has three sets of CCs, CTs and oscillators and a microprocessor 405 with requisite peripherals 406.
  • the module is connected to a high-level computer 407, for example a PC, via the connection 408, for example USB.
  • the microprocessor arrangement comprises a clock function 409 with a number of capture registers 410.
  • the oscillator 411 clocks the microprocessor and the clock function.
  • the microprocessor comprises or is connected to a CAN Con ⁇ troller CCl, which is also clocked by the oscillator 211.
  • the CC is connected to a transceiver TCl in the usual way via the RX and TX connections.
  • the first TC can be set in active or passive mode by the processor 205 via the connection 214.
  • an additional two CAN Controllers and transceivers are arranged, CC2 and TC2 and CC3 and TC3 respectively. However, these are clocked by the oscillators OSC2 and OSC3 respectively.
  • the frequency of these oscillators can be controlled from the microprocessor via the connections 415 and 416 respectively.
  • the oscillators OSC2 and OSC3 are of variable type as described above and the oscillator 411 has a fixed frequency.
  • the microprocessor arrangement is equipped with one or more timers, symbolized by 417, and a temperature sensor 418.
  • the sample point of a target module 403 in the system is to be determined. Any other connected modules 404 are disconnected or set in a mode that ensures that none can signal actively on the bus or transmit an ACK bit or error frame, so-called silent mode.
  • CC2 is set to 1 Mbit/s with 20 BTQ and OSC2 at 40 MHz.
  • TCl and CCl are set in the normal way for communication with the bit rate 250 kbit/s. The setting is not critical as CCl will only be used for the detection of errors.
  • CC2 is instructed to send a message with a CAN identifier that starts with 0011111. The remainder of the message is not of importance.
  • the target module will perceive 00 as an SOF.
  • FIG. 5 shows the procedure in detail.
  • CCl transmits the message according to the above, which is shown by 501.
  • the target module records an SOF and expects to read a zero according to 502.
  • the pulse is made shorter so that the target module reads a one at the ' sample point, which is shown by 503 and 503'.
  • the target module interprets the falling edge as an interference and takes no action.
  • the pulse is made longer (504, 504') and if the target module reads a dominant level, it will then expect zeros and ones, however at the most four consecutive zeros or five consecutive ones according to the rules for CAN.
  • the sample point of the target module can be calculated with great precision by indirectly utilizing the CCs ability to send CAN messages.
  • signals from CC2 it is necessary for signals from CC2 to be prevented from going out on the bus after the pulse has been generated and CCl must not be able to read the bus until after the pulse has died away.
  • CT2 being set in active mode and CTl being disconnected from the bus before the procedure is started.
  • CC2 detects it own sample point 505 in its own SOF, it triggers the timer 507 by the signal 508. This is set to approximately 7 ⁇ s.
  • the signal 509 is generated that disconnects CT2 from the bus and connects in CTl, whereby CT modes are utilized indirectly by the change-over taking place during the course of the CAN signalling.
  • the change-over is shown by 510.
  • CCl results in CCl reading the bus as rece ⁇ ssive (511) if the pulse is shorter than the sample point of the target system, but if the pulse is longer than the sample point of the target module, then there will be an active error flag after the target module has detected six recessive bits (512) .
  • CCl will detect this as an SOF (513) and after five consecutive bits it will generate an active error flag 514. This event generates an interrupt 515 to the microprocessor, either or both of the SOF and active error flag being dependent upon the characteristics and setting of CCl, that thereby has information for indirectly determining the sample point of the target module according to the method described.
  • the microprocessor can detect whether the target system is transmitting an active error flag or not.
  • the error handling specified in CAN is used indirectly to measure the sample point.
  • the sample point is determined using a rising edge. As it is a passive edge, its gradient depends upon the termination and capacitance of the bus. A falling edge is actively driven and therefore steeper. Once the sample point is approximately known, its position can be determined with greater precision if a falling edge is input.
  • the CAN identifier of the transmitted message start with 0101111 which generates a double pulse 515. The message is sent with the same bit rate as before. If no error is detected, then the sample point 516 of the target module lies at the zero. If an error is detected, the sample point lies at the one, which is shown by 516'.
  • the sample point is input by increasing the bit time if an active error flag is generated and by reducing the bit time if there is no active error flag. By means of a gradually reducing range, the sample point is determined.
  • OSC2 and CC2 are utilized to generate a pulse that is perceived by the target module alternately as the introduction to a message with the CAN identifier OOOOlx and as a message with the CAN identifier 0000Ox where a bit-stuffing error arises.
  • Figure 6 shows such pulses.
  • the target module will send an error frame after it has counted five recessive bits, while in the latter case, it does so immediately after it has detected the incorrect bit stuffing bit.
  • This makes it possible to measure the bit rate of the target system by basically the same method as described above for measuring the sample point by indirect utilization of the CAN specification' s definition of bit, stuffing bit, message and error handling.
  • the sample point of the target module When the sample point of the target module has been determined, it is possible to obtain a measurement of the highest possible bit rate which is 25/23-parts of the samplinc time. It can be expedient to set CC2 and OSC2 to obtair a bit time that is 4/3 Darts of the measured time.
  • a pulse is generated with the length of five bit times.
  • the pulse 601 has become longer than the sum of SOF, four consecutive bits and the time to the sample point S according to the target module's CC, so that this generates an active error flag 602 due to a stuffing error in the next bit.
  • the pulse 603 is, on the other hand, too short, so the target module's CC reads a one after four zeros.
  • T bm (5*T b -T sm )/5
  • Tb is the bit time for CC2
  • T sm is the target module's time to the sample point. As no falling edge has been generated by the pulse, the target module has never been resynchronized.
  • SJW determines the maximum adjustment of the bit time that a receiving module can carry out.
  • CC2 By setting CC2 to send a message with the CAN identifier starting with eleven ones, it will send out the bit sequence 01111101111101, that is the triple pulse 606.
  • the triple pulse 606' By increasing the bit time in CC2, the triple pulse 606' is achieved.
  • the target module expects the appearance of 607 but as the falling edge does not come until immediately before the sample point, it resynchronizes with SJW and expects the continued pattern 608.
  • At the sample point 609 a zero is expected but a one is read and so an active error flag 610 is sent out.
  • the target module can receive the message correctly.
  • the sampling time 609 has been input and can be measured indirectly by varying CC2's bit time.
  • the signal delay between the target module and the measurement module can be measured simply in the following way.
  • CC2 is set to send a message that starts with the CAN identifier that is a stuffing bit is necessitated.
  • CT2 disconnects TX2 from the bus and the pulse 701 in Figure 7 is generated.
  • CC3 reads the bus and detects SOF. After six consecutive ones have been read, an active error flag is generated.
  • the target module does likewise, but later due to the signal delay.
  • the bit time in CC3 is now lengthened so that it does not generate an error frame but reads the active error flag as the start of a legal dominant bit.
  • 702 shows how the target module generates an active error flag and 703 shows how CC3 interprets this as a dominant bit.
  • CC3's bit time By- shortening CC3's bit time, it will detect a stuffing bit error immediately before the change-over from the target module's active error flag has reached it. In this way, the falling edge from the target module can be. delimited.
  • CC3's bit length By adjusting CC3's bit length to the change-over point between immediate error frame generation and after five consecutive bits, the falling edge of the target module can be measured.
  • the signal delay T S j W can now be obtained from the equation
  • T sjw (6*T b3 +T s3 )-(6*T m +Tsm)
  • Tb3 is CC3's bit time and T S 3 is its sampling time and T m is the target module's bit time and T sm is its sampling time.
  • CCl is set for a given bit rate, for example 250 kbit/s and the sample point is set to 75% of the bit time.
  • CCl's bit rate is now measured with CC2 and CC3.
  • Each oscillator drifts with the temperature.
  • the current temperature for the calibration is measured by the temperature sensor 418. By recalibrating at different temperatures, a temperature compensation can be calculated. All measurements can now be carried out with the oscillator 411 as reference. This can, in turn, be calibrated to an external reference according to the methods described in the Swedish patent applications SE 0401922-0 and SE 0401130-0.
  • FIG 8 shows an alternative construction.
  • the crystal 411 has been replaced by a variable oscillator OSCl that clocks the CPU 405' and CCl.
  • a reference crystal oscillator 801 of good quality for example 16 MHz with 20 ppm precision or 12 MHz and 50 ppm precision, has been introduced.
  • Counters 802, 803, 804 and 805 are connected to this and to the respective OSCs, which counters can all be started and stopped simultaneously by the CPU 405', or alternatively there can be capture registers that can be frozen simultaneously.
  • the oscillator 801, that works with a fixed frequency can be used to clock peripherals that preferably work with a fixed frequency, for example communication circuits 806 for the communication with the high-level computer 407'.
  • the frequency of the OSCs can be set in relation to the reference frequency from 801.
  • the CPU 405' has a tool for setting the respective OSCs to any frequency within their frequency range with a given precision in relation to the reference frequency 801.
  • a local time base has been established.
  • Many CPUs incorporate one or more CCs that are clocked with the same base frequency as the CPU itself. If the base frequency is fixed, this limits the possibilities for adapting an incorporated CC to a suitable bit rate and sample point in a CAN system that works with a different fundamental frequency.
  • an incorporated CCl can also advantageously be used.
  • the local time base may need to be matched to the high-level computer 407'. If the communication .between 402' and 407' uses a protocol that is based on synchronous time slots given by the high-level computer, for example USB, then its start-of-frame pulse can be utilized by counting the oscillator's 801 pulses during a timeslot.
  • a change-over unit 807 is caused by the CPU 405' to connect in SOF pulses from the USB unit 806 that start and stop the counter 802, or alternatively freeze its capture register. In this way, the number of pulses that 801 generates during a timeslot is obtained .
  • the CCl in Figure 4 is set to the system's nominal bit rate.
  • the CC2 is varied in steps towards a lower bit rate and the CC3 is varied towards a higher bit rate.
  • Each CC is allocated two capture registers in 409. The time is captured at SOF and at the ACK bit or locally generated error frame. All the CTs are set so that listening on the bus can take place, but not transmission.
  • CC3's output TX3 is connected to capture register 1 by the connection 419. When CC3 activates TX3, the time is frozen in capture register 1. In this way, the time is captured for a generated ACK bit or active error flag.
  • the capture register 2 is connected to CC3's SOF signal by the connection 420.
  • CCl and CC2 are connected in a corresponding way to their respective capture registers. After each message detected by CCl or each error frame generated by CCl, the microprocessor preferably reads off the following values:
  • the high-level computer logs the messages that have been sent. At predetermined intervals, for example each second, the high-level computer commands the microprocessor 405 to reduce the bit time by a certain amount, for example 0.1 % in CC2 and to increase CC3 by the same amount. With increased deviation, CC2 and CC3 will generate error frames for certain messages while CCl receives a correct message. Utilizing the SOF and ACK time stamps, it can be ascertained whether there is a slot larger than three bit times between a message and the subsequent message. If such is the case, no arbitration and hence no resynchronization has been carried out at the transmitter.
  • the bit rate of the transmitting module is the average of CC2's and CC3's bit rates at which error frames start to appear if CC2 and CC3 have the same SJW, preferably one BTQ.
  • the bit rate of each module in the system can be determined.
  • the length of a CAN message varies with the transmitting module's oscillator frequency and setting, resynchronization upon arbitration and the number of stuffing bits.
  • a CC for example CC3, is set to the nominal bit rate for the CAN system and CT3 is set in a mode where it does not actively participate in the communication with transmission, for example Autobaud feedback loop in the case of TI 235.
  • the value of the clock 409 is captured via 419 and the ACK bit is captured via 420 in the clock's capture register 410.
  • the length ti of the message is given by
  • the number of stuffing bits can be calculated after reception by applying the rules of the CAN protocol and hence also the total number of bits B in the message.
  • FIG. 9 shows one of several alternative hardware constructions.
  • Two one or more CCs are connected to a change-over unit 901 that is controlled by the CPU 405" via the connection 902.
  • the CPU can switch the TX connection from the respective CC from connection to TX4 to CCs own input RX, to a different CCs RX, to a trigger output 903 connected to suitable target, for example a capture register or CCs mode switching, or can disconnect it completely.
  • the respective CCs RX connection can be connected to RX4, to one or more other CCs' TX or can be disconnected completely. In this way, different configurations for different purposes can be achieved in a simple way.
  • CCs with different characteristics can be connected in parallel, which can be advantageous.
  • MCP2515 can generate an SOF signal, a characteristic that the internal CCs in the microprocessor M16C from Mitsubishi does not possess.
  • the latter has an advanced error register whereby conclusions can be drawn regarding the type of error and where in the message it was discovered, a characteristic that the former CC does not possess.
  • the method for measuring the length of a message as described above can be utilized for automatic adaptation to the current bit rate in a system.
  • the length of received messages is measured using a counter connected to OSC3.
  • the counter is started by SOF and is stopped by ACK.
  • the number of pulses that is thus counted gives the raw length of the message up to the acknowledgement bit in the pulses.
  • the received message is converted according to the rules in the CAN protocol so that the number of bits up to the acknowledgement bit is obtained and is multiplied by the number of pulses from OSC3 that result in a bit. If the number of bits is the same, then the module has the correct frequency in relation to the transmitting module.
  • CAN modules are usually designed to be able to be incorporated in systems that are unknown to the designer, which results in the designer facing a difficult choice of oscillator precision.
  • Precise oscillators are crystal-based and they are considered to be less reliable than ceramic oscillators. Crystal-based oscillators have typically a precision of 20 - 500 ppm within a given temperature range, while inexpensive ceramic oscillators typically lie within the range 1 - 3%.
  • CAN Controllers can only be set to certain bit rates given by the frequency of the oscillator that clocks the CC. For example, 1 Mbit/s can not be set at all with a 13 MHz or 33 MHz clock frequency, while with a 12 MHz frequency only the sample points 50% and 66.67% can be selected.
  • the system designer is therefore restricted in the choice of bit frequency by the fixed oscillator frequencies of the modules comprised in the system. The invention eliminates this problem completely.
  • variable oscillator in accordance with the concept of the invention, can be set to a suitable frequency for the system and can then continually modify it in accordance with deviations that have arisen locally or externally.
  • a module it must thus be possible to set a module according to a CAN system specification with any bit time and low frequency deviation by the use of simple and inexpensive standard components.
  • a second module is assumed to transmit traffic on the bus.
  • the CAN Controller is set to nominal bit rate and silent mode.
  • the microprocessor is first set to nominal frequency, for example 16 MHz. If then one or more messages are received without errors, the microprocessor sets the frequency one increment higher, for example to (16*1.001) MHz, and if messages are still received correctly, the microprocessor increases the frequency by yet another increment.
  • the process is repeated until the CAN Controller reports an error frame.
  • the microprocessor returns to the initial frequency and decrements in a corresponding way until the CC reports error frames. Thereafter, the microprocessor sets the average frequency and resets the CAN Controller in active mode. Then the microprocessor adjusts the frequency in response to the measured temperature. If error frames are detected even during the first attempt, then the frequency is adjusted by half the permitted variation in one direction. If messages are then received without errors, the above method is repeated to determine the average frequency. Otherwise, it is set half the swing in the other direction compared to the first attempt. The attempts can be repeated until all the nominal tolerance range for the variable oscillator has been covered, if so required.
  • solutions to the problem can be based on frequency control via microprocessor and the solutions can be regarded as examples for guidance that can be modified depending upon system applications.
  • a first module can be equipped with an internal frequency reference and other modules can obtain their reference frequencies from the CAN messages transmitted from this first module.
  • a special fixed message for use for obtaining references can be used, which can facilitate a precise setting as the number of bits occurring in the message is previously known.
  • An embodiment for using a microcomputer for control of the frequency comprises the use of a modified CAN Controller.
  • the microcomputer then only needs to set the CAN Controller approximately so that a number of messages, preferably from a master module appointed in the system, can be received without errors. Thereafter the oscillator is fine-tuned by the CAN Controller. It can be an advantage as far as cost and space are concerned if the variable oscillator is incorporated into the CC or CT.
  • Figure 10 shows a CAN module 1000 with the outline construction of the modified CAN Controller 1001 and of the variable oscillator 1002.
  • the CC 1001 has a TX connection 1003, a pulse generation unit 1004 that generates pulse trains according to the CAN specification for messages from the transmission buffer 1005.
  • the RX connection 1006 is connected to the state machine 1007, that is clocked by the oscillator 1002 via the connection 1008, where received pulses are interpreted as bits according to the CAN rules 1009 and are transferred to the intermediate register 1010 where, after processing, they are transferred to the reception buffers 1011, which can be read off by a microcomputer via the adapter unit 1012 and the connection 1013.
  • the state machine resynchronizes this function, symbolized by 1014, according to the CAN rules.
  • the register 1015 and the function 1016 are introduced.
  • the microprocessor enters in the register the CAN identifier for the message or messages from which the reference frequency is to be obtained.
  • the function 1016 is activated. This interacts with the function 1014.
  • the function 1014 shortens TSEG_2
  • the function 1016 sends an order via the connection 1017 to reduce the frequency by an increment, for example 5 kHz.
  • the function 1014 increases TSEG_1
  • the function commands the oscillator 1002 to increase the frequency by an increment.
  • the oscillator frequency is adapted to the oscillator frequency of the module that transmits messages with the CAN identifiers in the register 1015.
  • the incoming pulse train is generated only by the transmitting module and is unaffected by the activity of other modules.
  • the said embodiment of the invention has many technical advantages.
  • most or even all of the messages can be related to one or a particular number of engine speeds .
  • each unit has a longer time to carry out its tasks than at high engine speeds.
  • the oscillator 1002 in a unit is controlled via an external reference 1018 that is connected to the connection 1019.
  • the external reference obtains information from the engine 1020 via one or more sensors 1021 connected to the engine, using which it can set the oscillator 1002 to a frequency- related to the speed of the engine.
  • the oscillator frequency then controls the CAN Controller in accordance with the speed of the engine. If a microcomputer 1022 is clocked by the same oscillator via a connection 1023, then the computer's programs will be executed in synchronization with the speed of the engine, which is an advantage if the microcomputer controls parts of the engine, for example ignition or valve lifting.
  • variable oscillator can advantageously be incorporated with the variable oscillator
  • CAN Controller into one component. Also as far as function is concerned, according to the above, it is advantageous also to incorporate the microprocessor into a component so that both the CC and the CPU are clocked jointly by the variable oscillator.
  • the proposed invention can thus advantageously be used in general CAN systems where a module comprised in the system is selected as master module and does not adjust its frequency while all the other modules in the system obtain a reference frequency from the messages sent from the master module and adjust their oscillators using the said reference frequency.

Abstract

L'invention concerne un dispositif destiné à être incorporé comme module dans un système CAN présentant un raccordement. Le dispositif comprend un oscillateur qui génère plusieurs fréquences différentes en réponse à des instructions provenant d'un micro-ordinateur. De plus, un contrôleur CAN est incorporé, qui reçoit lesdites fréquences et est raccordé ou peut être raccordé au raccordement par l'intermédiaire d'un émetteur-récepteur. Le procédé de l'invention permet d'obtenir un instrument efficace pouvant être utilisé pour vérifier et valider un travail en association avec un système CAN.
EP05794435A 2004-10-25 2005-10-15 Dispositif pour systeme can Withdrawn EP1829294A1 (fr)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
SE0402573A SE533636C2 (sv) 2004-10-25 2004-10-25 Anordning vid bussförbindelse i CAN-system
SE0500088 2005-01-13
PCT/SE2005/001548 WO2006057590A1 (fr) 2004-10-25 2005-10-15 Dispositif pour systeme can

Publications (1)

Publication Number Publication Date
EP1829294A1 true EP1829294A1 (fr) 2007-09-05

Family

ID=36498270

Family Applications (1)

Application Number Title Priority Date Filing Date
EP05794435A Withdrawn EP1829294A1 (fr) 2004-10-25 2005-10-15 Dispositif pour systeme can

Country Status (2)

Country Link
EP (1) EP1829294A1 (fr)
WO (1) WO2006057590A1 (fr)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10614016B2 (en) * 2015-10-20 2020-04-07 Nxp B.V. Controller area network (CAN) device and method for operating a CAN device
CN107786402B (zh) * 2016-08-31 2024-01-19 北京昱连科技有限公司 Ttcan控制通讯模块和车辆的ttcan控制通讯系统
US10892911B2 (en) * 2018-08-28 2021-01-12 Texas Instruments Incorporated Controller area network receiver
CN109743228B (zh) * 2019-01-09 2022-08-05 上海科世达-华阳汽车电器有限公司 一种采样点位置的测定方法及系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5574848A (en) * 1993-08-24 1996-11-12 National Semiconductor Corporation Can interface selecting one of two distinct fault recovery method after counting a predetermined number of recessive bits or good can frames
DE19722114C2 (de) * 1997-05-27 2003-04-30 Bosch Gmbh Robert Taktsignal-Bereitstellungsvorrichtung und -verfahren
GB9723557D0 (en) * 1997-11-08 1998-01-07 Univ Warwick Bus loading meter
US6831551B2 (en) * 2002-12-19 2004-12-14 General Electric Company Method and system for modulating a carrier frequency to support nondestructive bitwise arbitration of a communication medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See references of WO2006057590A1 *

Also Published As

Publication number Publication date
WO2006057590A1 (fr) 2006-06-01

Similar Documents

Publication Publication Date Title
US7934039B2 (en) Variable oscillator for generating different frequencies in a controller area network
US10146725B2 (en) Method and device for checking the correct functioning of a serial data transmission
EP1535170B1 (fr) Bus usb multivoie synchronisé
US7958438B2 (en) CAN system
Kannisto et al. Software and hardware prototypes of the IEEE 1588 precision time protocol on wireless LAN
JP5330415B2 (ja) データバスと、データバスに接続された複数の加入者とを含む通信システム、及び、このような通信システムの駆動方法
US8089991B2 (en) Network and method for clock synchronization of clusters in a time triggered network
US9461937B2 (en) Method and device for a serial data transmission with additionally inserted data
CN101399635A (zh) 通讯波特率自适应方法、装置以及主机
CN109951407B (zh) 使用计时器与多个从设备进行基于边沿的通信
CA2640556A1 (fr) Systeme reparti de synchronisation et de chronometrage
WO2006057590A1 (fr) Dispositif pour systeme can
CN104317762A (zh) 一种fpga自适应控制rs485芯片收发方向的方法
US5402420A (en) Communication unit having non-destructive arbitration function
US6598107B1 (en) Method for communicating data on a serial bus
US8422613B2 (en) Clock-synchronous communication apparatus and communication system
CN113872727A (zh) 高速通信系统
KR102263092B1 (ko) 프로그래머블 게이트 어레이를 이용한 시각 동기장치 및 방법
CN117376049A (zh) 传感器和数字通信方法
JP2004287533A (ja) Usbデバイスコントローラ
CN114953787A (zh) 一种芯片、装置及数据传输方法
JPH04188920A (ja) クロック生成方式
JPH04150337A (ja) 時分割方向制御伝送方法と装置

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

17P Request for examination filed

Effective date: 20070416

AK Designated contracting states

Kind code of ref document: A1

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IS IT LI LT LU LV MC NL PL PT RO SE SI SK TR

DAX Request for extension of the european patent (deleted)
RAP1 Party data changed (applicant data changed or rights of an application transferred)

Owner name: TIMEGALACTIC AB

RAP1 Party data changed (applicant data changed or rights of an application transferred)

Owner name: XINSHU MANAGEMENT L.L.C.

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION IS DEEMED TO BE WITHDRAWN

18D Application deemed to be withdrawn

Effective date: 20120501