Wake-up signal detection method and control device
By configuring different valid transition edges on the signal receiving pin of the Lin channel and counting the duration of the wake-up signal, the problem of inaccurate wake-up signal judgment in the existing technology is solved, the reliability of the wake-up signal is improved, and errors are avoided. wake.
Patent Information
- Application Number
- CN202310317641.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-01
AI Technical Summary
It is difficult to effectively judge the reliability of the wake-up signal with the existing technology, causing the main module and Lin channel to be woken up by mistake, especially in application scenarios with high clock frequencies.
By configuring different valid transition edges on the target signal receiving pin, the start and end of the wake-up signal are counted, and the validity of the wake-up signal is judged based on the counting duration to ensure the reliability of the judgment.
It improves the reliability of wake-up signal validity judgment and avoids false wake-ups, especially in high-frequency scenarios, ensuring accurate wake-up and sleep state transition of the Lin channel.
Smart Images

Figure CN118740540A_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the fields of automatic control and computer technology, and in particular to a detection method and a control device for a wake-up signal. Background Art
[0002] Lin (Local Interconnect Network) is a low-cost serial communication network. The Lin communication network includes a master module and at least one slave module (the slave module is also usually called a Lin channel). The master module and each Lin channel are coupled through a Lin bus.
[0003] The Lin bus includes at least two states: working state (Operation) and sleeping state (Sleep). When the Lin bus is in the sleeping state, the main module and / or the Lin channel will also be in the sleeping state. When the main module and / or the Lin channel detects a valid wake-up signal on the Lin bus, it can jump from the sleeping state to the working state.
[0004] Based on this, how to ensure the reliability of the judgment on the validity of the wake-up signal to avoid the main module and / or the Lin channel being woken up by mistake is a problem that needs to be solved at present. Summary of the invention
[0005] In order to solve the above problems or other problems, the present invention provides the following technical solutions.
[0006] In a first aspect, the present invention provides a wake-up signal detection method, which is applied to a Lin driver module, wherein the Lin driver module includes a Lin bus and at least one Lin channel, wherein the Lin bus is coupled to each of the Lin channels, and each of the Lin channels has a corresponding signal receiving pin, wherein the at least one Lin channel includes a target Lin channel, and the target Lin channel has a target signal receiving pin, and the detection method at least includes:
[0007] When the target Lin channel is in a dormant state, configuring a first valid transition edge for the target signal receiving pin, wherein the first valid transition edge is used to indicate the start of counting;
[0008] In the process that the target signal receiving pin receives the wake-up signal from the Lin bus, when the first valid transition edge appears in the wake-up signal, the counting is started, and a second valid transition edge is configured for the target signal receiving pin, wherein the second valid transition edge is different from the first valid transition edge and is used to indicate the end of the counting; and
[0009] When the wake-up signal has the second valid transition edge, the counting is ended, and the duration of the counting is calculated at least based on the start and the end, and the validity of the wake-up signal is determined according to the duration.
[0010] According to the detection method of the embodiment of the present invention, the detection method further includes:
[0011] When the target Lin channel enters the dormant state, enabling a transition edge detection interrupt;
[0012] When the first valid transition edge appears in the wake-up signal, the transition edge detection interrupt corresponding to the target Lin channel is entered to start the counting; and
[0013] When the second valid transition edge appears in the wake-up signal, the transition edge detection interrupt corresponding to the target Lin channel is entered to end the counting and disable the transition edge detection interrupt.
[0014] According to the detection method of the embodiment of the present invention, the target Lin channel is mapped to the target control register, wherein:
[0015] The step of configuring the target signal receiving pin with a first valid transition edge at least comprises: configuring the value in the target control register to be a first preset value, so that the target signal receiving pin determines the first valid transition edge in the wake-up signal according to the first preset value;
[0016] The step of configuring the target signal receiving pin with a second valid transition edge at least includes: configuring the value in the target control register to a second preset value, so that the target signal receiving pin determines the second valid transition edge in the wake-up signal according to the second preset value.
[0017] According to the detection method of the embodiment of the present invention, the target Lin channel is mapped to the target status register, and the step of configuring the target Lin channel to enter the transition edge detection interruption at least includes:
[0018] The value in the target status register is configured to trigger entry into the transition edge detection interrupt under the indication of the value.
[0019] According to the detection method of the embodiment of the present invention, each of the Lin channels includes a Lin controller, and the signal receiving pin is arranged on the Lin controller, wherein the Lin controller is implemented by non-Lin protocol controller hardware.
[0020] According to the detection method of the embodiment of the present invention, the Lin controller is configured to perform the counting.
[0021] According to the detection method of the embodiment of the present invention, the Lin controller is further configured to perform the calculation.
[0022] According to the detection method of the embodiment of the present invention, the first valid transition edge is a falling edge, and the second valid transition edge is a rising edge.
[0023] According to the detection method of the embodiment of the present invention, the detection method further includes:
[0024] When the result of the determination indicates that the wake-up signal is valid, the preset macro is configured to a first state, so that the target Lin channel enters a working state from the sleep state.
[0025] According to the detection method of the embodiment of the present invention, the step of judging the validity of the wake-up signal according to the duration at least includes:
[0026] When the duration is greater than 150 microseconds, it is determined that the wake-up signal is valid.
[0027] In a second aspect, the present invention provides a control device, the control device at least comprising:
[0028] A Lin driver module as described in any one of the above items; and
[0029] A processor is coupled to the Lin driving module and is configured to execute any of the above-mentioned wake-up signal detection methods.
[0030] According to the control device of the embodiment of the present invention, each of the Lin channels includes a Lin controller, and the signal receiving pin is arranged on the Lin controller, wherein the Lin controller is implemented by non-Lin protocol controller hardware.
[0031] According to the control device of the embodiment of the present invention, the control device further includes a timer module, and the timer module is configured to perform the counting.
[0032] The beneficial effects of the present invention include at least: the present invention provides a method for detecting a wake-up signal and a control device, wherein the method for detecting a wake-up signal is applied to a Lin driver module, the Lin driver module includes a Lin bus and at least one Lin channel, the Lin bus is coupled to each Lin channel, each Lin channel has a corresponding signal receiving pin, wherein at least one Lin channel includes a target Lin channel, the target Lin channel has a target signal receiving pin, and the detection method includes at least: when the target Lin channel is in a dormant state, configuring a first valid transition edge for the target signal receiving pin, the first valid transition edge is used to indicate the start of counting; in the process of the target signal receiving pin receiving the wake-up signal from the Lin bus, when the wake-up signal has the first valid transition edge , start counting, and configure a second valid transition edge for the target signal receiving pin, the second valid transition edge is different from the first valid transition edge and is used to indicate the end of counting; thereafter, when the second valid transition edge appears in the wake-up signal, end counting, and calculate the duration of the count at least based on the start and end, and judge the validity of the wake-up signal according to the duration. The present invention configures different valid transition edges for the target signal receiving pin before and after the first valid transition edge appears in the wake-up signal to control the start and end of counting the duration of a certain potential in the wake-up signal, so that the calculated duration is more accurate. Therefore, the reliability of the judgment on the validity of the wake-up signal is guaranteed, and the wake-up signal is avoided from being misjudged in application scenarios with high clock frequencies, thereby causing the target Lin channel to be mistakenly awakened. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the description of each embodiment according to the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 FIG. 4 is a flow chart of a method for detecting a wake-up signal provided in an embodiment of the present invention.
[0035] Figure 2 1 is a further flowchart of a method for detecting a wake-up signal provided in an embodiment of the present invention.
[0036] Figure 3 FIG. 4 is a timing diagram of a method for detecting a wake-up signal provided in an embodiment of the present invention.
[0037] Figure 4 Schematic diagram of the structure of a Lin driver module provided in an embodiment according to the present invention.
[0038] Figure 5Schematic diagram of the structure of a control device provided in an embodiment according to the present invention.
[0039] Figure 6a and Figure 6b It is a schematic diagram of the bit fields corresponding to the control register and the status register provided in an embodiment according to the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0041] See also Figure 1 and Figure 4 ,in, Figure 1 FIG. 1 is a flow chart of a method for detecting a wake-up signal according to an embodiment of the present invention. The method for detecting a wake-up signal is applied to a Lin driver module 100. Figure 4 A schematic structural diagram of a Lin driver module 100 provided in an embodiment according to the present invention is shown, from which the general steps of the above detection method as well as the components of the Lin driver module 100 and their relative positional relationships can be seen.
[0042] Specifically, the Lin driver module includes a Lin bus and at least one Lin channel. Figure 4 In the example, the Lin driver module 100 includes a Lin bus 110 and three Lin channels (respectively labeled as 120a, 120b and 120c), wherein the Lin bus 110 is coupled to each Lin channel (120a, 120b and 120c), and each Lin channel (120a, 120b and 120c) has a corresponding signal receiving pin (respectively labeled as Rxa, Rxb and Rxc).
[0043] Furthermore, when the Lin channels (120a, 120b, and 120c) are in the sleep state (Sleep) described above, when a certain Lin channel needs to be awakened from the sleep state to the operation state (Operation) to perform a corresponding operation at a certain moment, the Lin channel is the target Lin channel at that moment. That is, the at least one Lin channel ( Figure 4 In the example, “three Lin channels”) include a target Lin channel, and accordingly, the target Lin channel has a target signal receiving pin.
[0044] Next, in Figure 4The Lin channel marked as "120a" in the figure is the target Lin channel, and Figure 4 Taking the signal receiving pin marked as “Rxa” in the figure as the target signal receiving pin as an example, the detection method of the wake-up signal is described in detail. Specifically, the above detection method at least includes the following steps:
[0045] First configuration step S101: when the target Lin channel 120a is in a dormant state, a first valid transition edge is configured for the target signal receiving pin Rxa, where the first valid transition edge is used to indicate the start of counting;
[0046] The second configuration step S102: in the process of the target signal receiving pin Rxa receiving the wake-up signal S1 from the Lin bus 110, when the wake-up signal S1 has a first valid transition edge, the counting starts, and the target signal receiving pin Rxa is configured with a second valid transition edge, the second valid transition edge is different from the first valid transition edge, and is used to indicate the end of the counting;
[0047] Determining step S103: when the second valid transition edge of the wake-up signal S1 appears, the counting is ended, and the duration of the counting is calculated at least based on the start and end, and the validity of the wake-up signal S1 is determined according to the duration.
[0048] For details, please continue to refer to Figure 4 ,like Figure 4 As shown, each Lin channel (120a, 120b and 120c) includes a corresponding Lin controller (130a, 130b and 130c), and each signal receiving pin (Rxa, Rxb and Rxc) is arranged on the corresponding Lin controller. Further, in some embodiments, the "counting" and "calculation" in the above detection method are performed by the Lin controller.
[0049] Specifically, the effective wake-up signal S1 is a signal that lasts for a certain period of time at a certain potential. Exemplarily, the effective wake-up signal S1 on the Lin bus 110 may be a low-level signal that lasts for 250 microseconds (um) to 5 milliseconds (ms).
[0050] Furthermore, the determination of “determining the validity of the wake-up signal S1 according to the duration” in step S103 may be performed with a threshold of 150 microseconds as the duration, and at least includes the following steps:
[0051] When the duration is greater than 150 microseconds, the wake-up signal S1 is determined to be valid.
[0052] It should be noted that, in some implementations, "whether the target Lin channel in the sleep state receives a frame of data" is used as a sign of "whether the duration reaches 150 microseconds".
[0053] Specifically, one frame of data includes several bytes of data. When the target Lin channel 120a is in a dormant state and a working state, its target signal receiving pin Rxa can receive data.
[0054] Further, in this embodiment, when the target signal receiving pin Rxa receives a byte of data, a receiving buffer non-empty interrupt (also called "RXNE interrupt") is generated to determine whether the target Lin channel 120a is in a dormant state in the corresponding interrupt processing function, and when it is determined that the target Lin channel 120a is in a dormant state, an idle interrupt (also called "idle interrupt") is enabled. The idle interrupt is used to indicate the end of a frame of data transmission. When the target signal receiving pin Rxa receives a frame of data, an idle interrupt is generated. That is, in this embodiment, when an RXNE interrupt and an idle interrupt are generated successively, it indicates that a frame of data has been transmitted, that is, it indicates that the duration has reached 150 microseconds, and thus, the target Lin channel 120a is awakened.
[0055] However, in this implementation, on the one hand, if the transmission frequency of a frame of data received on the target signal receiving pin Rxa corresponding to the target Lin channel 120a in the dormant state is too high (such as greater than 10k Hz), then the processor will mistakenly judge a frame of data that lasts less than a predetermined standard (such as 150 microseconds) as a valid wake-up signal S1, thereby causing the target Lin channel 120a to be mistakenly awakened. On the other hand, this implementation requires that the Lin driver module 100 can detect whether the transmission of a frame of data is completed and generate an idle interrupt after receiving a frame of data completely. Since some hardware (such as a Lin controller that is not a Lin protocol) does not support the above detection and the generation of the above idle interrupt, the applicability of this implementation is not high.
[0056] Now return to continue reference Figure 1 and Figure 4 In an embodiment of the present invention, in response to the above problem, the inventor of this case proposes that for a Lin controller that is not a Lin protocol, the duration of a certain potential appearing in the wake-up signal S1 can be counted, and the corresponding duration can be calculated. Thus, the processor can directly use the "length of the duration" as the basis for judging "whether the duration reaches the threshold", making the reliability of the judgment step higher.
[0057] Further, in the embodiment of the present invention, the Lin controller (130a, 130b and 130c) is implemented in hardware by a non-Lin protocol controller. Specifically, the Lin controller can be based on the hardware implementation of a Universal Synchronous Asynchronous Receiver Transmitter (UART), or based on the hardware implementation of a controller of a Serial Communication Interface (SCI) protocol.
[0058] Furthermore, the inventor of the present case also proposed that, since the transition edges of the signal at the two nodes of "starting to maintain a certain potential" and "ending to maintain a certain potential" are different, different valid transition edges can be configured for the target signal receiving pin Rxa before and after a certain transition edge appears in the wake-up signal S1. Different valid transition edges can trigger different counting operations (such as the start and end of counting). Therefore, in the process of the target signal receiving pin Rxa receiving the wake-up signal S1, the validity of different transition edges in the wake-up signal S1 at different nodes can be used to trigger the above-mentioned counting operation, so as to accurately locate the start node and the end node of the wake-up signal S1 maintaining a certain potential, thereby improving the accuracy of the time length corresponding to the count obtained by subsequent calculation, ensuring the reliability of the processor's judgment on the validity of the wake-up signal S1, and avoiding the target Lin channel 120a from being woken up by mistake.
[0059] For details, please refer to Figure 1 In the first configuration step S101 and the second configuration step S102, in the embodiment of the present invention, when the target Lin channel 120a is in a dormant state, the target signal receiving pin Rxa is configured with a first valid transition edge, and when the first valid transition edge of the wake-up signal S1 appears, counting is started, and the target signal receiving pin Rxa is configured with a second valid transition edge. That is to say, when the first valid transition edge of the wake-up signal S1 appears, it indicates that the wake-up signal S1 begins to maintain a certain potential, and the first valid transition edge triggers the processor to start counting the duration of the above-mentioned certain potential. Afterwards, when the second valid transition edge of the wake-up signal S1 appears, it indicates that the wake-up signal S1 ends maintaining the above-mentioned certain potential, and accordingly, the second valid transition edge triggers the processor to end the above-mentioned counting.
[0060] Furthermore, the above-mentioned “configuring the first valid transition edge / the second valid transition edge for the target signal receiving pin Rxa” can be implemented by configuring a register (Register) through software running on a processor.
[0061] For example, see Figure 5The structure diagram of the control device 200 provided according to the embodiment of the present invention is shown, and the control device 200 includes a target control register RG1 ( Figure 6a 1 shows a schematic diagram of the bit field corresponding to the target control register RG1). In the embodiment of the present invention, the target Lin channel 120a is mapped to the target control register RG1, wherein:
[0062] The step of "configuring a first valid transition edge for the target signal receiving pin Rxa" in the first configuration step S101 may at least include: configuring the value in the target control register RG1 to be a first preset value, so that the target signal receiving pin Rxa determines the first valid transition edge in the wake-up signal S1 according to the first preset value;
[0063] The step of "configuring a second valid transition edge for the target signal receiving pin Rxa" in the above-mentioned second configuration step S102 may at least include: configuring the value in the target control register RG1 to a second preset value, so that the target signal receiving pin Rxa determines the second valid transition edge in the wake-up signal S1 according to the second preset value.
[0064] It should be noted that the first preset value can be 0, the second preset value can be 1, the low level in the wake-up signal S1 can correspond to the "0" value, and the high level in the wake-up signal S1 can correspond to the "1" value. In this configuration, the above-mentioned first valid transition edge is a falling edge, and the above-mentioned second valid transition edge is a rising edge.
[0065] For example, when the value in the target control register RG1 is configured as a "0" value, when the wake-up signal S1 has a falling edge, it will have a low level corresponding to the "0" value, so that the processor determines that the target signal receiving pin Rxa has received the falling edge of the wake-up signal S1 as the first valid transition edge. Correspondingly, when the value in the target control register RG1 is configured as a "1" value, when the wake-up signal S1 has a rising edge, it will have a high level corresponding to the "1" value, so that the processor determines that the target signal receiving pin Rxa has received the rising edge of the wake-up signal S1 as the second valid transition edge.
[0066] It should be understood that in other variations according to the present invention, when the first preset value is 0, the second preset value is 1, and the high level in the wake-up signal S1 corresponds to the value "0", and the low level in the wake-up signal S1 corresponds to the value "1", the first valid transition edge is a rising edge, and the second valid transition edge is a falling edge. Other configurations are not described in detail herein.
[0067] Furthermore, the inventor of the present case also proposed that, considering that when a wake-up signal S1 appears on the Lin bus 110, the processor may be in the process of processing other operations and cannot detect and judge the wake-up signal S1, therefore, in order to improve the timeliness of the target Lin channel 120a's response to the wake-up signal S1, a corresponding interrupt can be set to increase the priority of the processor's detection and judgment processing of the wake-up signal S1.
[0068] For example, see Figure 2 The schematic diagram of a further process of the detection method of the wake-up signal S1 provided according to the embodiment of the present invention is shown as follows: Figure 2 As shown, before the first configuration step S101, the detection method further includes an interrupt enabling step S104, which is as follows:
[0069] When the target Lin channel 120a enters the sleep state, the transition edge detection interrupt is enabled.
[0070] Furthermore, if Figure 2 As shown, when the wake-up signal S1 has a first valid transition edge, the second configuration step S102 further includes a first interruption step S1022, for example, entering the transition edge detection interrupt corresponding to the target Lin channel 120a to start counting. Correspondingly, when the wake-up signal S1 has a second valid transition edge, the determination step S103 further includes a second interruption step S1032, for example, entering the transition edge detection interrupt corresponding to the target Lin channel 120a to end counting.
[0071] Furthermore, if Figure 2 As shown, after the determination step S103, the detection method further includes an interruption disabling step S105, which is specifically as follows:
[0072] Disable edge detection interrupt.
[0073] It should be noted that the above-mentioned “configuring the target Lin channel 120a to enter the transition edge detection interrupt” can also be implemented by configuring a register (Register) through software running on a processor.
[0074] For example, see Figure 5 ,like Figure 5 As shown, the control device 200 also includes a target state register RG2 ( Figure 6b Schematic diagram showing the bit field corresponding to the target status register RG2). In an embodiment of the present invention, the target Lin channel 120a is mapped to the target status register RG2, and the above step of "configuring the target Lin channel 120a to enter the transition edge detection interrupt" may at least include:
[0075] The value in the target status register RG2 is configured to trigger an entry transition edge detection interrupt under the indication of the value.
[0076] Next, we will combine Figure 3 A timing diagram of a method for detecting a wake-up signal S1 according to an embodiment of the present invention is shown to fully describe the coordination between the various steps of the detection method mentioned above.
[0077] exist Figure 3 At time t1 shown, the target Lin channel 120a enters the sleep state from the working state. At this time, the processor (eg, through software running on the processor) configures the value in the target state register RG2 to enable the transition edge detection interrupt. Further, when the target Lin channel 120a is in a sleep state, the processor (for example, through the software running on the processor) configures the first valid transition edge of the target signal receiving pin Rxa based on the target control register RG1 (for example, write 0 in the target control register RG1 and configure the first valid transition edge as a falling edge). At time t2, the processor is triggered by the falling edge of the wake-up signal S1 received by the target signal receiving pin Rxa to suspend the processing of other operations, and enters the transition edge detection interrupt to start counting, and configures the second valid transition edge of the target signal receiving pin Rxa based on the target control register RG1 (for example, write 1 in the target control register RG1 and configure the second valid transition edge as a rising edge). At time t3, the processor (for example, through the software running on the processor) is triggered by the rising edge of the wake-up signal S1 received by the target signal receiving pin Rxa to suspend the processing of other operations, and enter the transition edge detection interrupt to end the counting, and then configure the value in the target status register RG2 to disable the transition edge detection interrupt. Afterwards, the duration of the count is calculated according to the start and end of the count, and the validity of the wake-up signal S1 is determined according to the duration.
[0078] Specifically, in some embodiments, combined with Figure 3 and Figure 2After the processor completes the configuration of the target status registers RG2 and RG1 in steps S104 and S101, the hardware of the Lin controller (130a, 130b or 130c) monitors the effective transition edge of the wake-up signal S1. Specifically, when the hardware of the Lin controller (130a, 130b or 130c) detects the falling edge in the wake-up signal S1 at time t2, an interrupt signal is generated to trigger the processor to enter the transition edge detection interrupt corresponding to the target Lin channel (120a, 120b or 120c) to execute the steps S1021 and S1022; when the hardware of the Lin controller (130a, 130b or 130c) detects the rising edge in the wake-up signal S1 at time t3, an interrupt signal is generated to trigger the processor to enter the transition edge detection interrupt corresponding to the target Lin channel (120a, 120b or 120c) to execute the steps S1031 and S1032. Specifically, in some implementations, the working state and sleep state of the Lin channel (120a, 120b, and 120c) are implemented based on macros. Therefore, multiple different states can be defined for the related macros. When the corresponding states are configured for the above-mentioned related macros, the Lin channel can be put into the working state or the sleep state.
[0079] For example, after determining step S103, the detection method may further include the following steps:
[0080] When the determination result indicates that the wake-up signal S1 is valid, the preset macro is configured to the first state, so that the target Lin channel 120a enters the working state from the sleep state.
[0081] Specifically, in some embodiments, when the Lin bus 110 is idle for more than a certain period of time, or when the main module (such as a processor) and / or the Lin channel (120a, 120b, and 120c) receives an instruction indicating that it needs to jump to a sleep state (for example, "Go to Sleep / Go to Sleep Internal"), it will jump from a working state to a sleep state.
[0082] Specifically, the above operation may also be implemented based on the configuration of a preset macro. For example, the detection method may further include the following steps:
[0083] When the target Lin channel 120a is in the working state, the preset macro is configured to the second state, so that the target Lin channel 120a enters the dormant state from the working state.
[0084] Furthermore, in some embodiments, when the hardware in the Lin channels (120a, 120b, and 120c) supports the low power consumption mode, the target Lin channel 120a can be configured to the low power consumption mode after the target Lin channel 120a enters the sleep state from the working state to further reduce the static power consumption of the target Lin channel 120a.
[0085] Furthermore, after the main module and / or the Lin channel enters the sleep state, the main module and / or the Lin channel may send a wake-up signal S1 to the Lin bus 110 .
[0086] See also Figure 5 , Figure 5 A schematic structural diagram of a control device 200 provided in accordance with an embodiment of the present invention is shown, from which various components of the control device 200 and the relative positional relationship of the various components can be seen.
[0087] like Figure 5 As shown, the control device 200 at least includes the Lin driver module 100 and the processor 210 as described above. Figure 5 , each component in the control device 200 is described in detail.
[0088] It should be noted that, in the embodiment of the present invention, the control device 200 can be a system on a chip that integrates a central processing unit (CPU), a random access memory (RAM), a read-only memory (ROM), a timer module and several input / output (I / O) interfaces, such as a micro-controller unit (MCU).
[0089] Specifically, the processor 210 may be the above-mentioned central processing unit, the processor 210 is coupled to the Lin driver module 100, and is configured to execute the steps in the wake-up signal detection method as described above, such as the first configuration step S101, the second configuration step S102 and the judgment step S103.
[0090] Further, in some embodiments, the above-mentioned operation of "counting the duration of a certain potential appearing in the wake-up signal S1" can be performed by the Lin controller (120a, 120b and 120c) in the Lin driver module 100, specifically, based on the counting module inside the Lin controller. In other embodiments, the above counting can also be performed by the timer module of the control device 200.
[0091] According to the foregoing content, an embodiment of the present invention provides a detection method and a control device for a wake-up signal, wherein the detection method for the wake-up signal is applied to a Lin driver module, the Lin driver module includes a Lin bus and at least one Lin channel, the Lin bus is coupled to each Lin channel, each Lin channel has a corresponding signal receiving pin, wherein at least one Lin channel includes a target Lin channel, and the target Lin channel has a target signal receiving pin. The detection method at least includes: when the target Lin channel is in a dormant state, a first valid transition edge is configured for the target signal receiving pin, and the first valid transition edge is used to indicate the start of counting; in the process of the target signal receiving pin receiving the wake-up signal from the Lin bus, when the wake-up signal has the first valid transition edge, the counting starts, and the target signal receiving pin is configured with a second valid transition edge, the second valid transition edge is different from the first valid transition edge, and is used to indicate the end of counting; thereafter, when the wake-up signal has the second valid transition edge, the counting ends, and the duration of the counting is calculated at least based on the start and end, and the validity of the wake-up signal is judged according to the duration. The present invention configures different valid transition edges for the target signal receiving pin before and after the first valid transition edge of the wake-up signal appears, so as to control the start and end of counting the duration of a certain potential in the wake-up signal, thereby making the calculated duration more accurate. Therefore, the reliability of judging the validity of the wake-up signal is ensured, and the wake-up signal is avoided from being misjudged in application scenarios with a high clock frequency, thereby causing the target Lin channel to be mistakenly awakened.
[0092] In addition to the above embodiments, the present invention may also have other implementations. Any technical solution formed by equivalent replacement or equivalent replacement falls within the protection scope required by the present invention.
[0093] In summary, although the preferred embodiments of the present invention have been disclosed as above, the above preferred embodiments are not intended to limit the present invention. A person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope defined in the claims.
Claims
1. A method for detecting a wake-up signal, characterized in that: Applied to a Lin driver module, the Lin driver module includes a Lin bus and at least one Lin channel, the Lin bus is coupled to each of the Lin channels, each of the Lin channels has a corresponding signal receiving pin, wherein the at least one Lin channel includes a target Lin channel, the target Lin channel has a target signal receiving pin, and the detection method at least includes: When the target Lin channel is in a dormant state, configuring a first valid transition edge for the target signal receiving pin, wherein the first valid transition edge is used to indicate the start of counting; In the process that the target signal receiving pin receives the wake-up signal from the Lin bus, when the first valid transition edge appears in the wake-up signal, the counting is started, and a second valid transition edge is configured for the target signal receiving pin, wherein the second valid transition edge is different from the first valid transition edge and is used to indicate the end of the counting; and When the wake-up signal has the second valid transition edge, the counting is ended, and the duration of the counting is calculated at least based on the start and the end, and the validity of the wake-up signal is determined according to the duration.
2. The detection method according to claim 1, characterized in that: The detection method further comprises: When the target Lin channel enters the dormant state, enabling a transition edge detection interrupt; When the first valid transition edge appears in the wake-up signal, the transition edge detection interrupt corresponding to the target Lin channel is entered to start the counting; and When the second valid transition edge appears in the wake-up signal, the transition edge detection interrupt corresponding to the target Lin channel is entered to end the counting and disable the transition edge detection interrupt.
3. The detection method according to claim 1, characterized in that: The target Lin channel is mapped to the target control register, where: The step of configuring the target signal receiving pin with a first valid transition edge at least comprises: configuring the value in the target control register to be a first preset value, so that the target signal receiving pin determines the first valid transition edge in the wake-up signal according to the first preset value; The step of configuring the target signal receiving pin with a second valid transition edge at least includes: configuring the value in the target control register to a second preset value, so that the target signal receiving pin determines the second valid transition edge in the wake-up signal according to the second preset value.
4. The detection method according to claim 2, characterized in that: The target Lin channel is mapped to the target status register, and the configuration makes the target Lin channel enter the transition edge detection interrupt step at least comprising: The value in the target status register is configured to trigger entry into the transition edge detection interrupt under the indication of the value.
5. The detection method according to claim 1, characterized in that: Each of the Lin channels includes a Lin controller, and the signal receiving pin is arranged on the Lin controller, wherein the Lin controller is implemented by non-Lin protocol controller hardware.
6. The detection method according to claim 5, characterized in that: The Lin controller is configured to perform the counting.
7. The detection method according to claim 5, characterized in that: The Lin controller is further configured to perform the calculation.
8. The detection method according to claim 1, characterized in that: The first valid transition edge is a falling edge, and the second valid transition edge is a rising edge.
9. The detection method according to claim 1, characterized in that: The detection method further comprises: When the result of the determination indicates that the wake-up signal is valid, the preset macro is configured to a first state, so that the target Lin channel enters a working state from the sleep state.
10. The detection method according to claim 1, characterized in that: The step of judging the validity of the wake-up signal according to the duration at least comprises: When the duration is greater than 150 microseconds, it is determined that the wake-up signal is valid.
11. A control device, characterized in that: The control device at least comprises: The Lin driver module according to any one of claims 1 to 10; and A processor is coupled to the Lin driving module and configured to execute the wake-up signal detection method according to any one of claims 1 to 12.
12. The control device according to claim 11, characterized in that: Each of the Lin channels includes a Lin controller, and the signal receiving pin is arranged on the Lin controller, wherein the Lin controller is implemented by non-Lin protocol controller hardware.
13. The control device according to claim 11, characterized in that: The control device further includes a timer module configured to perform the counting.
Citation Information
Cited By
Wake-up control method of charger and electric vehicle
CN119459377A
Charger wake-up control method and electric vehicle
CN119459377B
