Control method and storage medium of universal vehicle computer

By optimizing the heartbeat process between the MCU and ARM in the vehicle computer system, the problem of vehicle crash caused by unstable jumping process in the existing technology is solved, and higher system stability and user experience are achieved.

CN114740775BActive Publication Date: 2025-04-01WITSTEK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210376907.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2025-04-01
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

The heartbeat process between the existing MCU and ARM is not stable enough, which may cause the car to crash and cannot automatically recover, affecting the user experience.

Method used

By performing inspection operations after the MCU is powered on, a serial communication mechanism is established, and signals from the general input and output interface are collected in the heartbeat process, the status of the ARM is judged, and the heartbeat process is optimized to improve system stability.

Benefits of technology

It improves the system stability and reliability between the MCU and ARM, avoids the crash of the car and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114740775B_ABST
    Figure CN114740775B_ABST
Patent Text Reader

Abstract

The present invention discloses a control method and storage medium for a universal vehicle computer. The control method for the universal vehicle computer comprises: after the MCU is powered on, a corresponding inspection operation is performed; the MCU controls the ARM to power on, establishes a serial communication mechanism with the ARM, and starts a heartbeat process; in the heartbeat process, the MCU determines the upper control state of the ARM by collecting signals from a universal input / output interface connected to the ARM, and assigns a value to a judgment flag bit to accurately identify the state of the ARM; the MCU performs corresponding heartbeat process operations according to the state of the ARM. The present invention optimizes the overall process of the universal vehicle computer, making the whole machine run very stably.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle computer control, and in particular to a control method for a universal vehicle computer. Background Art

[0002] With the development of computers and the Internet, the control of car computers has become more and more perfect and intelligent. The MCU of the car computer system is responsible for the implementation of the underlying logic. At the same time, the MCU will also exchange data with the ARM. The ARM is responsible for the intelligent processing of the car computer, including but not limited to display, audio and video, and data interaction with the MCU.

[0003] The existing heartbeat process between MCU and ARM is not stable enough. If the MCU is unstable when working with ARM, it may cause the car computer to crash in extreme cases, and the car computer cannot recover automatically, causing the user to be unable to use the car computer for a long time during driving, resulting in a poor user experience.

[0004] Therefore, how to provide a control method for a universal vehicle computer with better stability is a technical problem that needs to be solved urgently in the industry. Summary of the invention

[0005] In order to solve the technical problem that the control system of a universal vehicle computer is not stable enough in the prior art, the present invention proposes a control method and a storage medium for a universal vehicle computer.

[0006] The control method of the universal vehicle computer proposed by the present invention includes:

[0007] After the MCU is powered on, perform the corresponding inspection operations;

[0008] The MCU controls the ARM to power on, establishes a serial communication mechanism with the ARM, and starts the heartbeat process;

[0009] In the heartbeat process, the MCU determines the upper control state of the ARM by collecting the signal of the general input and output interface connected to the ARM, and assigns a value to a judgment flag bit to accurately identify the state of the ARM;

[0010] The MCU performs corresponding heartbeat process operations according to the state of ARM.

[0011] Further, when the MCU enters the heartbeat process for the first time, the signal collected from the general input / output interface connected to the ARM is at a high level, and a value is assigned to the judgment flag to indicate the Debug state. At this time, the MCU does not judge the heartbeat signal of the ARM.

[0012] Further, when ARM enters the upper control state and the upper control ARM IO is at a high level, the MCU collects a signal from the general input and output interface connected to ARM as a low level, and determines whether there is a handshake with ARM and a heartbeat is established. If a heartbeat is established, the judgment flag is assigned a value to indicate that the MCU has received the ARM heartbeat, and the MCU enters the heartbeat detection process; if no heartbeat is established, the judgment flag is assigned a value to indicate the waiting handshake heartbeat state, and the heartbeat not established process is entered.

[0013] Further, when ARM enters the upper control state and the upper control ARM IO is at a low level, the MCU collects a high level signal from the general input and output interface connected to ARM, enters the Debug mode, and sets the corresponding flag variable, which is named Par.User.HeartBeatStart_FLAG in the present invention.

[0014] Furthermore, the serial port communication mechanism established between the MCU and the ARM is a serial port communication retransmission mechanism.

[0015] Further, the checking operation includes sequentially executing the MCU self-check firmware operation, determining whether the power supply voltage is operating normally, and the ACC connection status operation;

[0016] When the result of the MCU self-check firmware operation is that the firmware is abnormal, the subsequent check operation is suspended and the firmware forced upgrade process is entered;

[0017] When the result of judging whether the power supply voltage is normal is that the power supply voltage is abnormal, the subsequent checking operation is suspended to wait for the power supply voltage to be normal;

[0018] When the result of the operation of determining the connection state of the ACC is that the connection state of the ACC is disconnected, the MCU enters sleep mode and waits for the connection state of the ACC to be connected.

[0019] Furthermore, during the heartbeat process, the MCU performs a corresponding cyclic check operation, and enters a corresponding processing flow based on the difference in the cyclic check operation.

[0020] Further, the cyclic checking operation includes sequentially executing the connection status operation of the ACC, the information reception confirmation operation of the square control and the knob, the information reception confirmation operation of USART2 or USART3, judging whether the power supply voltage is operating normally, and other information reception confirmation operations.

[0021] The computer-readable storage medium proposed in the present invention is used to store a computer program, and when the computer program is run, the control method of the universal vehicle computer described in the above technical solution is executed.

[0022] The present invention optimizes the process between MCU and ARM, making the system more stable and more adaptable, and assisting the firmware self-checking function of MCU to improve the reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The present invention is described in detail below with reference to the embodiments and accompanying drawings, wherein:

[0024] Figure 1 It is the overall flow chart of the present invention.

[0025] Figure 2 It is a schematic diagram of the main state switching of the MCU of the present invention.

[0026] Figure 3 It is a serial port protocol analysis flow chart of the present invention.

[0027] Figure 4 It is a processing flow chart of the serial port retransmission mechanism between the MCU and the ARM of the present invention.

[0028] Figure 5 It is a heartbeat flow chart of the present invention.

[0029] Figure 6 It is a sleep control flow chart of the MCU of the present invention.

[0030] Figure 7 It is a key detection flow chart of the MCU of the present invention.

[0031] Figure 8 It is a power supply voltage detection flow chart of the MCU of the present invention. DETAILED DESCRIPTION

[0032] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0033] Thus, a feature indicated in this specification will be used to illustrate one of the features of an embodiment of the present invention, rather than implying that each embodiment of the present invention must have the described feature. In addition, it should be noted that this specification describes many features. Although some features can be combined together to illustrate possible system designs, these features can also be used in other combinations that are not explicitly described. Thus, unless otherwise stated, the described combinations are not intended to be limiting.

[0034] The external devices (referred to as peripherals) used by the MCU used in the control method of the universal vehicle machine of the present invention include: a general input and output interface (GPIO) connected to ARM, EXIT, ADC (analog / digital converter), TIMER, a universal synchronous / asynchronous serial transceiver module (including USART1-USART3 in the present invention), FLASH, RTC, etc. The following functions of the present invention are all implemented based on one or more peripherals. The specific peripherals are described in the specific functions.

[0035] After the MCU is powered on, the corresponding inspection operation is performed first. If the results of the inspection operation are normal, the MCU controls the ARM to power on, the MCU and ARM establish a serial port communication mechanism, and start the heartbeat process.

[0036] In the heartbeat process, the MCU collects the signal of the general input and output interface connected to the ARM, determines the upper control state of the ARM, and assigns a judgment flag bit to accurately identify the state of the ARM. Then the MCU performs the corresponding heartbeat process operation according to the state of the ARM.

[0037] During the heartbeat process, the MCU will also perform corresponding cyclic checking operations. Based on the different cyclic checking operations, the MCU enters the corresponding processing flow.

[0038] Figure 1 It is the overall flow chart of the present invention. When the power is turned on, the MCU is executed first. The MCU inspection operation includes the MCU self-test firmware operation, the power supply voltage judgment whether the operation is normal, and the ACC connection status operation.

[0039] If the result of the MCU self-check firmware operation is that the firmware is abnormal, the subsequent check operation is suspended and the firmware forced upgrade process is entered. If the result of the MCU self-check firmware operation is that the firmware is normal, the power supply voltage is judged. If the power supply voltage is between 10 and 16V, it means that the voltage is normal, and the MCU performs other check operations. If the power supply voltage is lower than 10V or higher than 16V, it will wait for the voltage to be normal to check the operation. When the power is turned on, the MCU will detect the connection status of ACC. If ACC is ON (the harness ACC is connected to 12V), the MCU will perform other steps and turn on ARM. If ACC is OFF (the harness ACC is not connected to 12V), the MCU will power off ARM and the MCU will enter the sleep state again. Until ACC is ON.

[0040] The MCU needs to do various things at different times on a general vehicle computer, so it is necessary to increase the configuration of the time base so that the MCU can process a certain thing at a specified time without interfering with other times. The present invention adds a time unit to the MCU, which regularly triggers the MCU to process the corresponding things at the corresponding time, so that the MCU will not have cross confusion when processing various functions. For example, the detection time points of each state of the heartbeat are different, and the polling time points of the system's voltage detection, knob detection and other functions are also different. The basic principle of implementation is to generate a timer interrupt every 1ms through the timer, count in the interrupt, and realize the processing of 1ms, 2ms, 5ms...4s, 5s time periods. By using this method, such as sending data every 2s / detecting ADC every 1s, etc. can be easily realized. In the general vehicle computer MCU, the above logic is processed by TIMER4. TIMER4 is a timing unit that comes with the chip, and the timing unit will be called when the MCU is working.

[0041] Since the ARM may undergo upgrade, restart, sleep, shutdown and other operations during the operation of the vehicle computer, the MCU may also have different states such as normal operation and sleep. Therefore, the MCU of the present invention has multiple states. In a specific embodiment, the MCU may have six states, and the MCU operation in different situations is realized by switching the MCU STATUS state similar to a state machine.

[0042] In the MCU software of the general vehicle computer, the MCU is set to switch between the following six states:

[0043]

[0044] Table 1 Six states of MCU

[0045] The main four state switching of the MCU of the present invention is as follows Figure 2 As shown. Start means start, MainLoop means the loop check operation of MCU, and Need Shut ARM means shutting down ARM. These three do not belong to the state of MCU. In a specific embodiment of the present invention, the loop check operation includes the connection state operation of ACC, the information reception confirmation operation of the square control and the knob, the information reception confirmation operation of USART2 or USART3, the operation of judging whether the power supply voltage is normal, and other information reception confirmation operations.

[0046] like Figure 2As shown in the figure, after the MCU is powered on and detects the power supply voltage and ACC OK, it will power on the ARM. So it will directly jump to the STATUS_PWRON state and execute downward. In the STATUS_SELF_LEARNING state, when it is necessary to power off and restart the ARM (such as the power supply voltage is too low and the ARM is powered off, etc.), it will jump to the STATUS_INIT_ARM state.

[0047] The serial communication between MCU and ARM uses a universal synchronous / asynchronous serial transceiver module, specifically USART1. The serial port includes TX and RX. The frame configuration is a conventional 8-bit data bit, 1 stop bit, no parity bit, and full-duplex. The general vehicle MCU configures both RX and TX to be in interrupt mode. The interrupt reception mode is achieved by the MCU automatically setting the register inside its chip. The IDLE flag of the register can be used to determine whether the data has been received.

[0048] The analysis of the serial port protocol between MCU and ARM is also processed through similar state switching. Figure 3 As shown, the MCU will cycle the protocol parsing operation in the STATUS_SELF_LEARNING state. First, determine whether USART1 has interrupted and received the data. If the data has been received, determine whether there is a protocol currently being parsed. If so, wait for the parsing of the previous protocol to be completed. Otherwise, start parsing the data of the current protocol and determine whether the data of the current protocol conforms to the protocol header. If not, parse it as an error protocol and do not process it. Otherwise, determine the protocol type of the current protocol, then verify the protocol data, determine whether the verification result is correct, and if it is correct, write and execute the protocol operation and return a response. Otherwise, parse it as an error protocol and do not process it. In a specific embodiment, the protocol data can be verified in a checksum manner.

[0049] In order to prevent the protocol transmission error between MCU and ARM and the MCU reporting error, the present invention adds a serial port retransmission mechanism between MCU and ARM, that is, the serial port communication mechanism established between MCU and ARM is a serial port communication retransmission mechanism. Figure 4As shown, MCU reports data and enters the waiting ACK process, and detects the serial port RX every 2ms. When USART1 receives ACK, it exits the detection. If ACK is not received, it determines whether NACK is received (ACK and nACK are the response protocols of the serial port, sent by ARM to MCU). If so, it resends the report information. When resending the report information, it determines whether the resending report information exceeds the preset number of times. If it exceeds, it exits the waiting ACK process. If it does not exceed, it continues to wait for the ACK process. If ACK is not received, no action is performed and the waiting ACK process continues. If NACK is not received (that is, when neither ACK nor nACK is received), the detection number is increased by 1, and the detection number of retransmissions exceeds the preset number, for example, whether it exceeds 10 times. If so, it is determined whether ACK or NACK is not received in 10 detections. If so, the report information is resent once, and then the waiting ACK process is exited. If NACK is received, the report information is resent and it is determined whether the current retransmission number exceeds 10 times. If the retransmission exceeds 10 times, the retransmission detection is exited. If the number of retransmissions does not exceed 10, re-enter the retransmission detection process.

[0050] The USART2 and USART3 serial communication of the MCU are two independent channels, but since both are used for information transmission and the software processing methods are basically the same, the two are combined here. The configuration of the USART2 and USART3 serial port peripherals is the same as the serial port configuration between the MCU and ARM. The MCU receives the data transmitted by ARM to USART2 or USART3, and transmits the data directly through USART2 or USART3 without any processing. The MCU receives the data from USART2 or USART3, encapsulates the data according to the communication protocol between MCU and ARM, and then transmits it to ARM. Because the external devices of USART2 and USART3 are different, the baud rate of communication must be different. In view of this situation, a protocol for configuring the baud rate of USART2 and USART3 is added, and the baud rate of USARTx of the MCU can be configured by ARM. At the same time, the MCU will also save the configuration value to FLASH.

[0051] like Figure 5 As shown, the heartbeat function of the universal vehicle computer MCU is based on the premise of MCU-ARM serial port communication. The so-called heartbeat is to send specified data at a specified time interval like a heartbeat. In the universal vehicle computer, the present invention is defined as sending a heartbeat protocol from ARM to MCU every 1s to notify MCU that ARM is alive at this time.

[0052] Since the heartbeat involves the judgment of whether ARM is alive, the processing of the heartbeat needs to be complete and reasonable. Combined with the many scenarios that ARM may exist in; such as: running, sleeping, software upgrade, etc. If you only judge whether ARM is alive by serial port data, there will be many loopholes. Therefore, the present invention adds the ARM_STATUS flag GPIO to synchronize the status of ARM-MCU, that is, MCU collects the signal of the general input and output interface connected to ARM to participate in the status of ARM and MCU.

[0053] MCU reads the GPIO level of ARM_STATUS. If it reads a high level, it means that the upper layer does not control the ARM state or actively sets the ARM state to low. At this time, the MCU will not power off and restart the ARM. It can be understood that it is in the Debug state at this time.

[0054] If the ARM_STATUS level is read as low, it means that the upper layer has a control status, which means that ARM is running at this time, and the MCU will also enter the heartbeat detection process at this time.

[0055] In order to switch between debug and run states, the MCU adds the Is_Have_HB_For_ARM judgment flag, which is defined as follows:

[0056] 0 Initial state, MCU powers on ARM, waiting for handshake heartbeat 1 MCU receives ARM heartbeat 2 ARM is being upgraded, not used 3 ARM is restarting, not used 4 In debug state, MCU does not detect heartbeat 5 ARM Hibernation

[0057] When the MCU first enters the heartbeat process, the signal of the general input and output interface connected to ARM is collected as high level, and the corresponding judgment flag is assigned to indicate the debug state. At this time, the MCU does not judge the heartbeat signal of ARM. In specific implementation, the MCU first enters the heartbeat detection process code. At this time, the upper layer does not control ARM_STATUS, the ARM IO port is low, and the MCU detects that ARM_STATUS is high. Set Is_Have_HB_For_ARM to 4, enter Debug mode, and do not detect heartbeat.

[0058] When ARM enters the upper control state and the upper control ARM IO is high, the MCU collects the signal of the general input and output interface connected to ARM as low, and judges whether there is a handshake with ARM and a heartbeat is established. If a heartbeat is established, the corresponding judgment flag is assigned to indicate that the MCU receives the ARM heartbeat. At this time, the MCU enters the heartbeat detection process; if the heartbeat is not established, the corresponding judgment flag is assigned to indicate the waiting handshake heartbeat state, and the heartbeat process is not established. In specific implementation, after booting up, enter the main screen. At this time, the upper layer runs and controls the ARM IO port to be high. The MCU detects that ARM_STATUS is low, and judges whether there is a handshake with ARM and a heartbeat is established. If a heartbeat is established, set Is_Have_HB_For_ARM to 1 and enter the heartbeat detection process. If a heartbeat is not established, set Is_Have_HB_For_ARM to 0 and enter the heartbeat process.

[0059] When ARM enters the upper-layer control state and the upper-layer controls ARM IO to a low level, the MCU collects the signal of the general input and output interface connected to ARM as a high level, enters the debug mode, and sets the Par.User.HeartBeatStart_FLAG flag. In specific implementation, if the upper layer needs to process events of uncertain time during operation. The upper layer controls the ARM IO port to a low level, the MCU detects that ARM_STATUS is high, and enters debug mode. Set Par.User.HeartBeatStart_FLAG. When the upper layer completes the event processing, it controls the ARM IO port to a high level, the MCU detects that ARM_STATUS is low, and continues to enter the heartbeat detection process.

[0060] MCU upgrade includes normal upgrade and forced upgrade. When the MCU is in the upgrade state, it will automatically jump to the MCUbootloader partition. During this period, the MCU does not detect the heartbeat. At the same time, ARM should also stop sending heartbeats to prevent serial port data confusion. After the MCU upgrade is completed, it will automatically restart, and synchronization will also drive the restart of ARM. Re-enter the power-on state.

[0061] Currently, after the MCU is powered on, there are some contents that need to be configured by ARM, which can be understood as "initializing the MCU". For example: handshake, setting the pull-up of the side control, initializing the side control, etc. These configuration contents are only sent once after the system is powered on. The heartbeat should be sent after these "initialization" configurations are completed, and combined with the serial port retransmission mechanism to prevent errors.

[0062] When the machine ACC is OFF, that is, the universal car machine needs to sleep after the engine is turned off, ARM will tell the MCU to sleep through the serial port. In this case, ARM should first switch ARM_STATUS, that is, switch from low level to high level, then stop sending heartbeats, and finally tell the MCU to go into sleep.

[0063] In order to achieve the requirement of dormancy and wake-up through external or internal means in MCU, the Active-Halt module function (i.e. active halt mode) is used. Active-Halt can be configured to wake up by external GPIO interrupt or internal RTC timing. In general car computers, both wake-up methods are used.

[0064] like Figure 6 As shown, the MCU will cyclically detect the IO port level of ACC in the STATUS_SELF_LEARNING state. When the IO level of ACC changes, it is ready to start the sleep operation. The MCU detects ACC OFF, receives the sleep information from ARM, and ARM_STATUS is high. It waits for a period of time to enter the ACC OFF state process, such as waiting for 30 seconds to enter. Then the MCU configures the peripheral status, such as setting the frequency to 1M, turning off the serial port, timer, and ADC peripherals, configuring the GPIO level status, setting the ACC pin as an interrupt input, configuring the RTC to wake up every 20s, etc. After that, the MCU enters the Active-Halt mode (active shutdown mode) to determine whether there is an ACC ON interrupt signal. If so, it determines whether the power supply voltage is normal, etc. The MCU Figure 1 The process exits the low power mode and waits for the heartbeat of ARM. If not, it wakes up at regular intervals, such as every 20 seconds. After waking up, it determines whether the power supply voltage is lower than 10V. If so, it cuts off the ARM power supply and forces the shutdown. The MCU will not wake up again. If the power supply voltage is greater than 10V, it determines whether the user has set the automatic shutdown of sleep mode and the set time has arrived. If so, it also cuts off the ARM power supply and forces the shutdown. The MCU will not wake up again. Otherwise, it will re-enter the Active-Halt mode.

[0065] like Figure 7 As shown, the button is processed by reading the voltage value through ADC. Different buttons have different voltage divider resistors, and the voltage detected by MCU after pressing is also different. MCU reads the ADC of the button at intervals. If a button is pressed, it will first debounce, and then determine whether a button is pressed. If so, the serial port sends the corresponding button ADC to ARM. If it is detected that no button is pressed, it determines whether the button has been pressed and released. If so, the serial port sends the button release to ARM.

[0066] The buttons include the square control and the panel. The difference between the two is that the pull-up resistor of the panel is fixed, and the pull-up resistor of the square control can be configured to 1K / 10 / 100K. The square control pull-up resistor is set to be configurable to adapt to different external physical buttons. For example: the pull-down resistor value of the external square control button is in the range of 1K and 2K. At this time, the square control pull-up can be configured to 1K, so that the ADC values ​​of different voltage divider resistors can be dispersed. If the pull-up is configured to 100K by mistake. The ADC values ​​recognized by the two buttons may be very close, resulting in confusion of the buttons.

[0067] The knob of the universal car computer connects the AB phase signals of the knob encoder together and connects them to the GPIO port of the MCU. The MCU uses the ADC to detect the level changes of the GPIO port to analyze whether the knob is currently rotating forward or reverse.

[0068] The power supply of the universal car machine is provided by the car battery. The MCU needs to detect the power supply and mute and shut down the ARM when the power supply is too high / too low. After the voltage returns to normal, the ARM will be powered on again.

[0069] In MCU, power supply voltage detection includes three parts: power supply voltage detection at startup, power supply voltage detection during normal operation, and power supply voltage detection during ACC OFF sleep. The power supply voltage detection at startup and the power supply voltage detection during ACC OFF sleep have been described above, and the power supply voltage detection during normal operation is described here.

[0070] During the cyclic check operation, the MCU queries the power supply voltage at regular intervals, for example, once every 1 second. If the power supply voltage is normal, it is determined whether it has recovered from the abnormal voltage state. If so, the MCU sends a voltage recovery protocol to the ARM. If the power supply voltage is abnormal, it is determined whether the corresponding continuous preset time is higher than the preset maximum value. The corresponding preset time and the preset maximum value can be set according to the situation, for example, higher than 16V for 10 consecutive seconds. If not, it is determined whether the corresponding continuous preset time is lower than the preset minimum value. The corresponding preset time and the preset minimum value can also be set according to the situation, for example, lower than 9V for 10 consecutive seconds. If not, it is determined whether the power supply voltage is lower than the second minimum value corresponding to the preset time. The corresponding preset time and the second minimum value can also be set according to the situation, for example, lower than 10V for 10 consecutive seconds. If so, the MCU sends two low voltage warnings to the ARM, followed by MCU MUTE PA. MCU MUTE PA represents the MCU muting the car computer, that is, the MCU muting amplifier in the following example. Reduce the power consumption of the car computer when the voltage is low. If the power supply voltage is continuously greater than the preset maximum value for the preset time, the MCU sends a voltage abnormality shutdown countdown to the ARM, and then the MCU forces the ARM to shut down. After the voltage returns to normal, the MCU continues to cycle and check the operation process.

[0071] In one embodiment, when the power supply voltage is between 9V and 10V, it is determined to be in a low voltage state. At this time, in order to reduce battery consumption, the MCU will mute the power amplifier.

[0072] The infrared function of the general car MCU includes infrared reception and infrared transmission (infrared transmission and reception both use the standard NEC protocol). Infrared transmission is divided into infrared carrier transmission and infrared direct transmission. Infrared carrier transmission is that the car device is connected to the infrared transmitter for wireless infrared transmission, and infrared direct transmission is to omit the transmitter and directly connect the infrared receiving signal from the device to the car computer, and transmit it directly through the signal line.

[0073] In decoding, after recognizing a 4.5ms high level, the address code is judged. If the received address code and the address inverse code do have a complementary relationship, the data code is judged. If the received data code and the data inverse code do have a complementary relationship, the receiving protocol is judged to be received correctly. The MCU packages the data code into the communication protocol between the MCU and ARM, and informs ARM which key is currently pressed on the remote control. Generally, remote controls have a long-press function. When long-pressed, the remote control will continue to send a long-press code. The MCU will continue to detect the long-press code after completing the NEC protocol detection until the detection times out (no long-press code is detected for more than 200ms), and the MCU notifies ARM that the remote control button is released.

[0074] The difference between infrared carrier transmission and infrared direct transmission is that the high level of the carrier transmission protocol is replaced by a 38KHz carrier. The logic of the two is basically the same, so they are explained here together. According to the NEC protocol, MCU requires ARM to provide address code, address inverse code, data code, and data inverse code, and then integrate these 4 contents according to the protocol, add 9ms, 4.5ms and the end waveform before sending. At present, the infrared transmission of MCU only performs NEC protocol transmission, and long press code transmission is not yet performed.

[0075] During use, the MCU needs to save some data so that it can be directly read and configured when it is turned on next time. This requires the use of the internal data saving function. The MCU still saves data in the EEPROM and FLASH after power failure. The start and end addresses of the two are: EEPROM: 0x1000~0x10FF, FLASH: 0x8000~0x17FFF. Different MCU models have different addresses.

[0076] RGB tri-color light means that one LED contains three light-emitting diodes (red, green and blue). The three light-emitting diodes (red, green and blue) are controlled separately through three IO ports. Different PWM configurations of the three IO ports can realize the effect of the final LED displaying multiple colors.

[0077] The MCU of the present invention realizes different duty ratio configurations of three IO ports by simulating PWM. First, a timer reference time of 100us is set. After each timing time is reached, the count is performed and compared with the set duty ratio.

[0078] The MCU of the present invention has two hardware PWM output configurations, which are used to configure the AVDD and VCOM of the display screen respectively. The MCU is implemented by calling the TIMER configuration to PWM OUT, and the configuration is similar to the conventional configuration. The MCU firmware upgrade of the present invention includes a normal upgrade process and a firmware damage forced upgrade process.

[0079] The upper layer of the present invention refers to the system application layer of the vehicle computer.

[0080] The present invention also protects a corresponding computer-readable storage medium, which is used to store a computer program, and when the computer program is running, the control method of the universal vehicle computer of the above technical solution of the present invention is executed.

[0081] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A control method for a universal vehicle computer, characterized in that: include: After the MCU is powered on, perform the corresponding inspection operations; The MCU controls the ARM to power on, establishes a serial communication mechanism with the ARM, and starts the heartbeat process; In the heartbeat process, the MCU determines the upper control state of the ARM by collecting the signal of the general input and output interface connected to the ARM, and assigns a value to a judgment flag bit to accurately identify the state of the ARM; The MCU performs corresponding heartbeat process operations according to the state of ARM; When ARM enters the upper control state and the upper control ARM IO is high, the MCU collects a signal of a low level from the general input and output interface connected to ARM, and determines whether there is a handshake with ARM and a heartbeat is established. If a heartbeat is established, the judgment flag is assigned a value to indicate that the MCU has received the ARM heartbeat. At this time, the MCU enters the heartbeat detection process; If the heartbeat is not established, the determination flag is assigned a value to indicate a waiting handshake heartbeat state, and the heartbeat process is entered.

2. The control method of the universal vehicle computer according to claim 1, characterized in that: When the MCU first enters the heartbeat process, the signal collected from the general input and output interface connected to the ARM is high level, and the judgment flag is assigned a value to indicate the Debug state. At this time, the MCU does not judge the heartbeat signal of the ARM.

3. The control method of the universal vehicle computer according to claim 1, characterized in that: When ARM enters the upper control state and the upper control ARM IO is at a low level, the MCU collects a signal of a high level from the general input and output interface connected to ARM, enters the Debug mode, and sets the corresponding flag variable.

4. The control method of the universal vehicle computer according to any one of claims 1 to 3, characterized in that: The serial port communication mechanism established between the MCU and the ARM is a serial port communication retransmission mechanism.

5. The control method of the universal vehicle computer according to any one of claims 1 to 3, characterized in that: The checking operation includes sequentially executing the MCU self-check firmware operation, judging whether the power supply voltage is operating normally, and the ACC connection status operation; When the result of the MCU self-check firmware operation is that the firmware is abnormal, the subsequent check operation is suspended and the firmware forced upgrade process is entered; When the result of judging whether the power supply voltage is normal is that the power supply voltage is abnormal, the subsequent checking operation is suspended to wait for the power supply voltage to be normal; When the result of the operation of determining the connection state of the ACC is that the connection state of the ACC is disconnected, the MCU enters sleep mode and waits for the connection state of the ACC to be connected.

6. The control method of the universal vehicle computer according to any one of claims 1 to 3, characterized in that: During the heartbeat process, the MCU performs corresponding cyclic checking operations, and enters corresponding processing procedures based on the differences in the cyclic checking operations.

7. The control method of the universal vehicle computer according to claim 6, characterized in that: The cyclic checking operation includes sequentially executing the connection status operation of the ACC, the information reception confirmation operation of the square control and the knob, the information reception confirmation operation of USART2 or USART3, the operation of judging whether the power supply voltage is normal, and other information reception confirmation operations.

8. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is running, the control method of the universal vehicle computer as claimed in any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Automobile instrument design method based on function safety

    CN110781019A