AUTO-CONFIGURED LLN BUS NODES The invention relates to electronic devices and more specifically to electronic devices used within systems conforming to the L N Bus standard.
LLN Bus is a name given to an open protocol defined for use in communicating between a number of distributed modules. Many applications of the LLN Bus are targeted specifically at the automotive industry.
In LLN Bus applications each module contains an interface circuit, usually implemented as a single integrated circuit, which interfaces to the common signal conductor or bus and handles the protocols associated with the messages and the required responses.
Each module in a system has a unique identity, LD, within the system, which enables a bus master to communicate with a selected module or a group of modules within the system.
As originally defined, all the modules within a LLN Bus system are connected in parallel. That is they share a bus across which all messages and communications are sent and received. Each module has a pull up resistor and an active pull down transistor. Message initiation is asynchronous and message collisions are resolved by arbitration means. Since a pull down or active state, will take precedence over a pull up, or recessive state, any transmitting module seeing an active state when transmitting a recessive state knows that another module is transmitting. Under such circumstances the module transmitting the active state takes precedence and any other modules must cede the bus and try again later.
Each module is assumed to be preconfigured before installation with its own unique LD.
Such an assumption places demands on the manufacturers, installers and most particularly on those repairing a system to correctly configure every module before installation. An extension to the system protocol providing a method of configuring a module with an LD after installation was thereby proposed and implemented by Bosch and Philips amongst others and has been favorably received.
In such a system the electronic interface between the bus and the modules is altered. In particular, the system incorporates extended capability modules capable of being configured wherein each extended capability module has two connections to the bus, the normal modules having only one connection to the bus.
The bus is made discontinuous at each extended capability module and one connection is made to each side of the discontinuity. Extended capability modules are thus connected in a daisy chain configuration whilst normal modules are connected to the bus as before. The extended capability modules maintain signal continuity along the bus but introduce a nominal (approximately one ohm) series resistance per extended capability module. Ln such a system all the modules are identical and so in a specific application the position of the module within the daisy chain defines the loads and sensors connected to said module. Extended capability modules are manufactured in a non-configured state but can be configured after installation. Ln a non-configured state a module has no identification (LD) and cannot be selectively communicated with. To overcome this limitation, all non-configured extended capability modules respond to a configuration
request message transmitted onto the bus by a bus master, by tiirning off their pull down transistors and forcing a current through their pull up transistor onto the common signal conductor. These forced currents will flow along the common signal conductor to the bus master which has its pull down transistor turned on. By this means every non-configured extended capability module except one will see a voltage across the nominal one ohm series resistance introduced at each extended capability module. The exception is the module furthest from the master as defined by the daisy chaining connections. This non-configured extended capability module is thus uniquely identified and enables itself for programming of an LD within the system. The procedure can be repeated until all non-configured extended capability modules are configured with an LD.
This scheme has a number of limitations. The normal performance of the bus is degraded by the introduction of the series resistances. The series resistance within an extended capability module is normally implemented within an integrated circuit and the tolerance of such resistors is wide. The forced currents are all sunk via the bus master, which has maximum current capabilities and a current limiting capability defined within the specification. The value of the forced current used to identify and enable one module for configuration must be small and carefully selected and controlled. The voltages developed across the series resistor within a module are also small and must be measured with high accuracy. The reliability of such systems may be reduced under conditions of electrical interference or noise. The performance of such systems may also be restricted to limited temperature and voltage ranges and may only be reliable under workshop conditions.
A better solution has been proposed in our co-pending International Patent
Application WO2004/049642 wherein there is provided a reconfigurable extended capability module said reconfigurable module having means for being configured with an LD and also having embedded within it at the manufacturing stage a unique Identification Code, CLN, for use during a configuring operation. In this solution, during a configuration sequence the bus master transmits a configuration request and all non-configured reconfigurable modules respond by transmitting a reply consisting of their CLN. Standard LLN bus arbitration rules apply, with active states winning over recessive states. One non-configured reconfigurable module will thus win the arbitration and become the 'selected module'. The selected module only then forces a current through the pull up resistor.
Non-configured reconfigurable modules which are not currently selected monitor the current through their series resistors to determine that a selected module is responding. Each non-configured reconfigurable module maintains a position counter. The position counter is incremented each time a voltage is detected across the series resistor of a module indicating that the selected module responding with a forced current is further from the master than the module incrementing its counter. The position counter within any non-configured reconfigurable module will not be incremented when that non-configured extended capability module is itself the selected device. Once an non-configured reconfigurable module has been selected it is no longer considered non-configured and remains unresponsive to further configuration requests and with its position counter fixed showing its position in the daisy chain. Once all non-configured extended capability modules have been selected each will have a position counter showing a unique position for that module within
the daisy chain. This unique position counter value can be used to select a module and configure it for use in the system.
The benefit of the above system is that only one module is forcing current at a time thus simplifying the task of determining that a current is flowing by reducing the accuracy required for the measurement. Accordingly, the permitted tolerances of the individual components are also less onerous. However, the master unit specification imposes an upper limit on the current that can be forced through the series resistors and this consequently limits the magnitude of the voltage drop across the series resistors. It is thus an object of the invention to provide an improved scheme for configuring modules that is compatible with the LLN bus standard.
According to a first aspect of the present invention there is provided a LLN bus system comprising a plurality of modules linked to a LLN bus along which electronic data or instructions can be sent to and from each said module, a number of said modules being non-configured and having a unique code associated therewith but having no unique identification address associated therewith, said system further including configuration means which interrogates said modules and detects the unique code of said non-configured modules, said configuration means selecting one non- configured module to act as a current sink and selecting every other non-configured module in turn, to act as a current source, the selected current source module forcing a current onto the bus, which is conducted to the current sink module wherein each said non-configured module further comprises means for detecting said current and a
counter which is incremented or decremented on each occasion the module detects said current flowing between a selected current source and the current sink.
Preferably said configuration means is the bus master, and each non- configured module is a slave node. Preferably each said non-configured module is a reconfigurable module having means for being configured with an LD and also having embedded within it at the manufacturing stage a fixed unique Chip Identification Code (CLN) for use during a configuring operation.
Preferably, each said non-configured module is a module compatible with the LLN Bus Standard. Preferably, each said module is connected to the LIN bus by a pair of LLN Bus interface pins, said LLN bus interface pins being connected by a series resistor. Most preferably the pair of LLN bus interface pins are connected to the bus such that the pins are connected on either side of a discontinuity in the bus. Preferably the series resistor is a 1 ohm or similar value resistor. In this manner the modules may be connected as a daisy chain of slave nodes on the LLN Bus.
Preferably said modules may detect the flow of current along the bus by monitoring a voltage drop across their series resistors.
Preferably said module further comprises a pull up resistor and additionally a current source for forcing a pull up current onto one of the bus interface pins. Preferably said module further comprises a transistor for sinking said pull up current. Preferably said pull up current is of a magnitude of 80-100 milliamps, such as to generate 80-100 millivolts across a one ohm resistor.
Preferably said reconfigurable modules are connected in a daisy chain manner and standard LLN Bus arbitration rules apply for selecting modules from the daisy chain. Preferably said pull up current only flows whilst said module is selected.
Ln an alternative embodiment said module further comprises a random code generator for generating a random code of a plurality of bits in length to identify the module as an alternative to the CLN code. The number of bits in the code is chosen to minimize the possibility of two modules having the same random code.
Preferably said LLN Bus system comprises a plurality of non-configured reconfigurable modules connected together in a daisy chain manner. Additionally, a plurality of standard LLN bus modules may also be connected to the bus. n order to configure each of the non-configured reconfigurable modules in a desired manner it is necessary to identify the position of each of the non-configured reconfigurable modules on the bus.
Preferably, the bus master interrogates all non-configured reconfigurable modules which each respond by transmitting a reply consisting of their unique code.
Preferably, standard LLN bus arbitration rules apply, wherein active states win over recessive states, and one non-configured reconfigurable module is thus selected. This module will act as a current sink.
Preferably, the bus master then re-interrogates all non-configured reconfigurable modules, all of which except the sink module respond by transmitting a reply consisting of their unique code. Preferably, standard LLN bus arbitration rules apply, wherein active states win over recessive states, and one non-configured reconfigurable module is thus selected. This module will now act as a current source.
Preferably, the selected source module then forces a current onto the bus, which is conducted to the sink module. Non-configured reconfigurable modules positioned between the source and the sink detect the flow of this current through their series resistors and increment or decrement their counters accordingly. This is then repeated until each module, except the current sink module, has been selected to act as the current source module.
Preferably, each modules counter is incremented on each occasion that a current is detected in its series resistor flowing in a first direction and decremented on each occasion that a current is detected in its series resistor flowing in a second direction, said second direction being opposite to said first direction. Preferably, the position counter on particular non-configured reconfigurable module is not incremented or decremented when the particular non-configured reconfigurable module is itself the source module.
In this manner after each module in the daisy chain has been selected in turn, the position counter of each module holds a unique value indicative of its position in the daisy chain. The counter will show a positive count value for those modules on one side of the sink module and a negative count value for those modules on the other side of the sink module.
The unique position counter value can then be used to select a module and configure it for use in the system. Preferably the position in the chain can be used by the bus master to configure each module by allocating an LD to each module as a function of its position within the daisy chain.
The benefit of this system is that only one module forces current on to the bus at a time. This simplifies the task of determining that a current is flowing by reducing the accuracy required for this measurement. Additionally, the forced current can be higher than the currents normally associated with the bus since the current sinking ability of a slave module can be higher than the current sinking ability of a master module as defined under LLN bus rules. A larger forced current has the benefit of being easier to detect.
According to a second aspect of the present invention there is provided a method of configuring a LLN Bus system comprising a plurality of non-configured reconfigurable modules each having a unique code associated therewith but having no unique identification address associated therewith, the modules being connected in a daisy chain manner comprising the steps of: interrogating all non-configured modules; selecting one module from the daisy chain to act as a current sink; selecting another non-configured module from the daisy chain, to act as a source module, the selected current source module forcing a current onto the bus, which is conducted to the current sink module; and repeating the above step until each non-configured module, other than the current sink module, has been selected wherein each module detects said current when not selected and increments or decrements a counter accordingly. The method of the second aspect of the invention may be used in conjunction with a system according to the first aspect of the invention and may incorporate any features of the first aspect of the present invention as desired or appropriate.
In order to select a sink module the bus master may interrogate all non- configured reconfigurable modules which each respond by transmitting a reply consisting of their unique code, hi such circumstances, standard LLN bus arbitration rales apply, wherein active states win over recessive states, and one non-configured reconfigurable module is thus selected.
In order to select a source module the bus master may re-interrogate all non- configured reconfigurable modules, all of which except the sink module respond by transmitting a reply consisting of their unique code. Ln such circumstances standard LLN bus arbitration rules apply, wherein active states win over recessive states, and one non-configured reconfigurable module is thus selected.
Non-configured reconfigurable modules positioned between the source and the sink may detect the flow of current through their series resistors and increment or decrement their counters accordingly. Preferably, each modules counter is incremented on each occasion that a current is detected flowing in a first direction and decremented on each occasion that a current is detected flowing in a second direction, said second direction being opposite to said first direction. The counter in each module will thus hold a unique value indicative of the position of the module within the daisy chain. The counter will show a positive count value for those modules on one side of the sink module and a negative count value for those modules on the other side of the sink module.
The unique position counter value can then be used to select a module and configure it for use in the system. Preferably the position in the chain can be used by
- li the bus master to configure each module by allocating an LD to each module as a function of its position within the daisy chain.
Ln order that the invention be more clearly understood, one embodiment will now be described further herein and with reference to the accompanying drawings in which: -
Figure 1 is a block diagram of a reconfigurable module according to the present invention showing its interface with a series resistance;
Figure 2 shows a plurality of such reconfigurable modules connected to a common signal line; and Figure 3 illustrates how the position of each module within the daisy chain is determined.
Referring now to figure 1 a reconfigurable module comprises a normal LLN bus interface pin spilt into a LLN_H pin, 101, and a LLNJ pin, 102, connected by a series resistor Rac, 103, of typically 1 ohm. This enables modules to be connected as a daisy chain of slave nodes on the LLN bus. The module further comprises a pull up resistor 104 and a pull up current source lac, 105, which can be activated during auto- configuration. During normal communication this current source is always off and has therefore no influence. This current source has a typical value of 80 - 100mA,
During the auto-configuration procedure the voltage across the resistor Rac is monitored by amplifier means, 107. The LLN pull up resistor, 104, can also be switched off during the auto-configuration process.
Figure 2 shows an example of a daisy-chained LLN bus for auto-configuration.
The master module, 201, is located at one end of the bus. The modules 1 to n, 211, ..., 21n, are slave nodes with auto-configuration capability. The modules are daisy- chained by connecting the LLN_H pin, 101, on one module to the LLNJL pin, 102, on an adjacent module, in the case shown in figure 2, the module adjacent and to the right.
Modules n+1, ... are standard slave modules, not reconfigurable modules according to the invention and as such they can be connected anywhere on the LLN bus. There may be any desired combination of reconfigurable slave modules and standard slaves connected to the bus, including slaves connected in a tree structure as long as the reconfigurable slave modules are connected in a daisy chain.
The reconfigurable modules can have following auto-configuration states:
• Unaddressed: the node is not identified (i.e. the node has not assigned an LD and can thus not be assessed for normal messages requiring the LD of a node). • Selected: the node has been selected during the on-going auto-configuration interrogation message. It will switch to the addressed state at the end of the message.
• Addressed: the node has been addressed during the auto-configuration procedure. It is waiting the end of the auto-configuration procedure to get assigned his node LD.
• Identified: the node has received his proper LD (which is written in eeprom) and can be accessed for all application messages.
A module that has never been identified has LD=0 written in non-volatile memory NVM, such a module will enter the unaddressed state after power on/reset. Additionally, a module that is not in the identified state will enter the unaddressed state after power on/reset. The module has a unique chip identification number (CLN) code built in at manufacture. This code can be any code, except a code consisting of all zeros. Ln practice this code consists of data defining batch No., wafer No and die position on the wafer. Typically the CLN has a total of 48 bits (6 bytes) of unique code.
No special hardware is required for the master. Any micro-processor equipped with a regular full duplex Uart, associated with a standard Lin physical interface circuit (such as the TH8082 available from Melexis) can be used. The software running on the master must be able to send the frame items (Uart bytes) in a different way than for the regular frames.
The auto-configuration system makes use of the user defied extended frame message (Id 0x3 E). The advantages of this use of the extended frame message are that it leaves the regular LLN identifiers untouched and available, the number of bytes is free and can thus be optimized for each message, and the byte containing the error flag can be located at the end of the frame, after the checksum (to allow for signaling of checksum errors, by the master as well as the slaves). Figure 3 illustrates how the auto-configuration of said reconfigurable modules is achieved. The bus connects a master node 300 with nine reconfigurable slave modules, 301 - 309. Standard slave modules have no effect
on the reconfiguration process and are not shown but may be connected to the bus at any point in accordance with the LLN standard rules.
Each of the reconfigurable slave modules is selected in turn by the master node 300. Ln the example the order is 304, 303, 306, 308, 302, 309, 305, 307, 301 and the modules are selected in order of their CLN codes.
The first selected module 304 is selected to be a current sink module and will turn on its pull down transistor during the relevant portion of the auto- configuration to sink any current applied to the bus. Each subsequently selected module is selected to act, in turn, as a current source during the relevant portion of the auto-confϊguration.
When a module is acting as a current source it forces a current on to the bus where it is then conducted along the bus to the current sink module 304. Each module positioned between the selected current source module and the current sink module is able to detect the flow of current through their series resistors 103. upon detecting such a current each of these modules subsequently either increments or decrements their internal counters. The position counters are incremented or decremented depending on the direction of current flow. In figure 3, current flow from left to right results in increment of the counters and current flow from right to left results in decrement of the counters. This is repeated until each module other than the current sink module 304 has been selected as the current source module.
The values held in each modules counter after each selection of a different current source module are shown in figure 3. It can be clearly seen that when the
configuration process is completed, the internal counter (PosCnt) of each slave module holds a value indicative of its position in the daisy chain. This value is used to identify each module so that it may be suitably configured for its intended application. The value held in the position counter will be positive or negative dependant upon the position of a module relative to the position of the sink module. In figure 3, modules 301-303 are positioned to the left of the current sink module 304 and thus have a positive count value. Modules 305-309 are positioned to the right of the current sink module 304 and have negative count values.
The module position in the chain can be calculated from the count value. If the module was not the sink module and has a positive count value then the count value is equal to the module position within the daisy chain. If the module was the sink module then the module position within the chain is the count value plus one. If the count value is negative, then the module position is equal to the count value plus the total number of modules. The total number of modules may be deduced by counting the total number of completed cycles in the auto configuration sequence.
In an alternative embodiment the CLN code (which is stored in eeprom) can also be replaced by a random generated code of x bits. The right value for x is calculated to minimize the risk of different modules within the daisy chain having identical codes. In such embodiments, a random code generator is incorporated
into the module. At the beginning of an auto-configuration sequence each module creates a random generated code to act as a CLN.
If however the situation should arise that two modules have identical codes, this can be overcome. Lf two modules have identical codes, both will be selected simultaneously and they will both activate their current source. If both modules are on the same side there are two alternatives by which this can be dealt with. Firstly, the selected module closest to the sink module will detect a current flowing through its resistor and therefore will recognize that it is not the only module selected and will consequently react as if not selected. Secondly and alternatively, an error flag can by generated either by the sink module or by the selected module closest to the sink module, the effect of the error flag being to restart the procedure.
If the two selected current source modules are on opposite sides of the current sink module the counters will be automatically correct since the currents flowing along the bus from each source module to the sink module will not interfere with each other. The advantage of this embodiment is that there is no need for non-volatile memory to be incorporated into the module and thus the auto-configuration sequence can be run on each power on/reset.
In further alternative embodiments, the first selected module can be selected to be a current source module and the remaining modules may be selected in turn to be current sink modules. These embodiments would otherwise function as described above.
It is of course to be understood that the invention is not intended to be restricted to the details of the above embodiments which is described by way of example only.