Programmable display key array device based on domestic microcontroller

文档序号:1686771 发布日期:2020-01-03 浏览:8次 中文

阅读说明:本技术 一种基于国产化微控制器的可编程显示按键阵列装置 (Programmable display key array device based on domestic microcontroller ) 是由 阎哲 袁晓光 常玉增 于 2019-09-23 设计创作,主要内容包括:本发明涉及一种基于国产化微控制器的可编程显示按键阵列装置,涉及信息安全系统技术领域。本发明可以极大减少设备按键数量,从而有效降低整台设备成本和减少操作台面积。本发明使得当前设备中按键的固定显示内容和固定开关功能,都可以被编程修改。这种使用方法,可以实现按键复用,即一个按键实现多种功能,有效的减少了传统设备中按键太多的缺点,极大地降低了设备成本和对操作台面空间的占用,增加了每个按键的使用率。(The invention relates to a programmable display key array device based on a domestic microcontroller, relating to the technical field of information security systems. The invention can greatly reduce the number of keys of the equipment, thereby effectively reducing the cost of the whole equipment and reducing the area of the operating floor. The invention can make the fixed display content and the fixed switch function of the key in the current equipment be programmed and modified. The use method can realize key reuse, namely one key realizes multiple functions, effectively reduces the defect of too many keys in the traditional equipment, greatly reduces the equipment cost and the occupation of the space of an operation table top, and increases the utilization rate of each key.)

1. A programmable display key array device based on a localization microcontroller, comprising:

matrix key array can be displayed: each key is used for receiving commands and data transmitted by the microcontroller to operate and display, and can be pressed down or bounced to complete basic switch operation; each key is a displayable key with an OLED screen, one of the array is set as a menu switching key, when the key is pressed down, the function of the key matrix is switched, and after the key is powered up, each key is required to be initialized and display an initialization picture under the control of the microcontroller; the key can be turned on or off under the control of the microcontroller; the switch state obtained by pressing or bouncing the switch can be monitored by the microcontroller, and the microcontroller generates a command code and sends the command code to the main control computer to complete corresponding operation;

microcontroller of Cortex-M4 core: for controlling the plurality of keys;

and the SD card is used for storing the graphic information content required to be displayed by each key.

2. The apparatus of claim 1, wherein the microprocessor has peripheral devices: UART, SPI bus, SDIO controller, GPIO serial port, USB interface;

UART: the microcontroller analyzes the key position information of the key switch to generate an appointed command code, the appointed command code is sent to a main control computer of the display control device through a UART interface, and the main control computer analyzes the information to complete corresponding operation;

SPI bus: the microcontroller controls all peripheral keys by using an SPI bus, and the SPI bus is responsible for sending command information and data information to each key;

SDIO controller: the microcontroller reads and writes each key display picture data stored in the memory card through the SDIO controller, and the content of the SD card can be read and written by the main control computer through the USB interface;

GPIO serial port: the microcontroller is responsible for monitoring the on or off state of all the pressed or bounced information of the keys, and after each key is pressed, the microcontroller generates a corresponding command code according to a defined function and transmits the command code to a main control computer of the display control device through a GPIO serial port of the communication serial port; the microcontroller realizes communication and control with the displayable matrix key array through the SPI bus and the GPIO serial port;

USB interface: the microcontroller is used for connecting with a main control computer and reading and writing the picture files stored by the SD card; the main control computer can replace the picture information in the SD card through the USB interface.

3. The device as claimed in claim 2, wherein the microcontroller stores control program for function control and key position command code generation matching different working menus, and a debugging serial port is arranged between the microcontroller and the main control computer for updating the control program in the microcontroller, including initialization of keys and key definition analysis function, and the user can use the debugging serial port to complete program modification and update.

4. The apparatus of claim 1, further comprising a power supply for secondarily transforming and decomposing an externally supplied reference voltage into various voltages required by hardware of the apparatus.

5. The apparatus of claim 3, wherein the SPI bus of the plurality of keys is connected in parallel to the SPI bus of the microcontroller, the maximum number of keys each microcontroller can connect to depends on the load capacity of the SPI bus and the number of available GPIO pins, the SPI bus transmits the operation command or the image data, the communication process of which complies with the SPI communication specification, and each key further has a command or data enable signal also connected in parallel to a GPIO pin of the microcontroller for identifying whether the data transmitted on the SPI bus is data or command: when the enable signal is high, image data required to be displayed by a key is transmitted on the SPI bus; when the enable signal is low, a command is transmitted on the SPI bus; the keys can complete self initialization, display, on-off operation according to the commands.

6. The device as claimed in claim 5, wherein the switch pin of each key has one end pulling up high level or pulling down low level, the other end is connected to GPIO of the microcontroller, the GPIO monitors the state of the key being pressed or bouncing up, and the pull-up or pull-down of all switches are connected in parallel, when the display content of the key is changed, the state judgment of GPIO detection is not changed, only the command code generated by the microcontroller according to the key position information is corresponding to the new content displayed by the key, one of the keys is set as a menu switching key in the key array, when the key is pressed, the display content of each key of the whole key matrix except the menu switching key is switched, and simultaneously the key position analysis and the command code generation also complete the switching of the corresponding relation.

7. The apparatus of claim 6, wherein the SD card is connected to the SDIO interface of the microcontroller, wherein the image data to be displayed by the keys is stored in several folders, each folder corresponds to the image file to be displayed by all the keys in a key matrix state, and thus the SD card has a plurality of folders; the method comprises the steps that picture data needing to be displayed by all keys in the current state are arranged under each folder, after the device is powered on, the keys are initialized, the microcontroller reads picture information needing to be displayed by each key from the initialization folder through the SDIO interface and sends the picture information to each key through the SPI bus to enable the keys to be displayed, at the moment, key position analysis and command code generation functions are consistent with the current state, when the key functions need to be switched, a menu switching key is pressed, the microcontroller reads the picture information needing to be displayed by each key from the corresponding state folder through the SDIO interface and sends the picture information to the corresponding keys through the SPI bus to complete display, and meanwhile, the key position analysis and command code generation functions are also switched and correspond to the current display content.

8. The apparatus as claimed in claim 7, wherein the contents of the SD card can be modified through a USB interface connecting the host computer and the apparatus, the apparatus is identified as a USB flash disk under a USB bus of the host computer, only the picture files under the folder in the corresponding state need to be modified, the apparatus can use new pictures after being powered on again, the files in the folder are stored according to the format of the.bin, and the pictures in different formats need to be firstly converted into the format.

9. A method of operating a device according to any one of claims 1 to 8, including a power-up initialisation display operation comprising the steps of:

s10: electrifying: powering on the device;

s11: initializing a processor: loading a working program by the microcontroller;

s12: a step of reading data by the microcontroller: the microcontroller reads picture data needing to be displayed by key initialization;

s13: displaying a key initialization command step: the microcontroller sends an initialization command to the key through the SPI chip selection signal and the command data signal;

s14: displaying key initialization data: the microcontroller sends picture data to be displayed by the key;

s15: a display key lighting step: after the picture data is sent, the microcontroller sends a key lightening command;

s16: display key cycle initialization step: after the current key finishes the display operation, continuing to perform the initialization operation of the next key until all keys finish initialization;

s17: a monitoring step of the microcontroller: the microcontroller operates in a key status monitoring STATE with a monitoring function of STATE 0.

10. A method of operating a device according to any one of claims 1 to 8, including a key press processing operation comprising the steps of:

s20: the key pressing step: the key array is pressed down by keys;

s21: key position receiving step: the microcontroller receives the pressed key number;

s22: switching key and common key judging steps: the microcontroller judges whether the pressed key is a key function switching key according to the key position number, if so, the step S23 is executed, and if not, the step S25 is executed;

s23: a key initialization step: the microcontroller reinitializes the keys according to the steps S12-S16;

s24: and a monitoring function skipping step: the microcontroller jumps to a new monitoring function STATE 0-STATEN and executes step S27;

s25: a command code generation step: the microcontroller generates corresponding command codes under the control of corresponding monitoring functions STATE 0-STATEN according to the pressed key position number;

s26: a command code sending step: the microcontroller sends the generated command code to the main control computer and executes step S27;

s27: a monitoring step of the microcontroller: the microcontroller works in a key monitoring state, and the monitoring function is a current function.

Technical Field

The invention relates to the technical field of information security systems, in particular to a programmable display key array device based on a domestic microcontroller.

Background

At present, information technology is developed at a high speed, and home-made components are more and more important in information security systems, especially in use environments with high requirements on information security and operation security. In addition, in order to prevent the neck-sticking problem caused by the forbidden operation of components, it is necessary to use the domestic components in the domestic equipment. The invention selects a processor of a Cortex-M4 inner core of an ARM architecture which is easy to innovate by a domestic component manufacturer as a control core of the whole device.

The keys are widely used in industrial display and control equipment and military equipment and are mainly used for controlling key signals, such as power-off switches, transmitting switches, emergency calls and the like on the equipment. These keys are switches with specific functions. The current mainstream using method is to define the function for the key in advance, and then the key manufacturer carves the corresponding characters as the function identification. Meanwhile, in order to facilitate the processing core to receive the corresponding control signal to complete the operation, the connection relationship between the processor and the keys needs to be solidified on the circuit board, and the functions are fixed. In addition, for the use environment with more control signals, a plurality of keys are required to form a key array for the convenience of operation of a human operator.

For the existing key control environment, the optimizable aspects of the use method are as follows: 1. the number of keys is reduced by 2. the key functions and identifiers can be modified. Both of these problems can be realized with the programmable display key array designed by the device: 1. the key function identification may be modified or redefined, whether dynamic or static. 2. The key function can be adaptively changed along with the new function of the identifier, so that the unification of the identifier and the function is achieved. Therefore, the optimized key array can be multiplexed in multiple functions, so that the aims of one key for multiple purposes and reduction of the number of keys of the operating table are fulfilled. Meanwhile, the operating table with limited space can be used for leaving more positions for placing other devices.

Disclosure of Invention

Technical problem to be solved

The technical problem to be solved by the invention is as follows: how to realize a programmable display key array device is used for realizing the key switch function, and a user can customize the display content and the key function through programming of an external main control computer.

(II) technical scheme

In order to solve the above technical problem, the present invention provides a programmable display key array device based on a localization microcontroller, comprising:

matrix key array can be displayed: each key is used for receiving commands and data transmitted by the microcontroller to operate and display, and can be pressed down or bounced to complete basic switch operation; each key is a displayable key with an OLED screen, one of the array is set as a menu switching key, when the key is pressed down, the function of the key matrix is switched, and after the key is powered up, each key is required to be initialized and display an initialization picture under the control of the microcontroller; the key can be turned on or off under the control of the microcontroller; the switch state obtained by pressing or bouncing the switch can be monitored by the microcontroller, and the microcontroller generates a command code and sends the command code to the main control computer to complete corresponding operation;

microcontroller of Cortex-M4 core: for controlling the plurality of keys;

and the SD card is used for storing the graphic information content required to be displayed by each key.

Preferably, the microprocessor has peripheral devices: UART, SPI bus, SDIO controller, GPIO serial port, USB interface;

UART: the microcontroller analyzes the key position information of the key switch to generate an appointed command code, the appointed command code is sent to a main control computer of the display control device through a UART interface, and the main control computer analyzes the information to complete corresponding operation;

SPI bus: the microcontroller controls all peripheral keys by using an SPI bus, and the SPI bus is responsible for sending command information and data information to each key;

SDIO controller: the microcontroller reads and writes each key display picture data stored in the memory card through the SDIO controller, and the content of the SD card can be read and written by the main control computer through the USB interface;

GPIO serial port: the microcontroller is used for monitoring the on or off state of all the key pressing or bouncing information, and after each key is pressed, the microcontroller generates a corresponding command code according to a defined function and transmits the command code to a main control computer of the display control device through a GPIO serial port of the communication serial port; the microcontroller realizes communication and control with the displayable matrix key array through the SPI bus and the GPIO serial port;

USB interface: the microcontroller is used for connecting with a main control computer and reading and writing the picture files stored by the SD card; the main control computer can replace the picture information in the SD card through the USB interface;

preferably, a control program is stored in the microcontroller for function control and generation of key position command codes matched with different working menus, a debugging serial port is arranged between the microcontroller and the main control computer and used for updating the control program in the microcontroller, the debugging serial port comprises functions of key initialization and key definition analysis, and a user can use the debugging serial port to complete modification and updating of the program;

preferably, the device further comprises a power supply for performing secondary transformation decomposition on the externally supplied reference voltage into various voltages required by device hardware.

Preferably, the SPI bus of the plurality of keys is connected in parallel to the SPI bus of the microcontroller, the maximum number of keys each microcontroller can connect to depends on the load capacity of the SPI bus and the number of available GPIO pins, the SPI bus transmits operation commands or image data, the communication process of which complies with the SPI communication specification, and each key further has a command or data enable signal also connected in parallel to a GPIO pin of the microcontroller for identifying whether the data transmitted on the SPI bus is data or command: when the enable signal is high, image data required to be displayed by a key is transmitted on the SPI bus; when the enable signal is low, a command is transmitted on the SPI bus; the keys can complete self initialization, display, on-off operation according to the commands.

Preferably, one end of a switch pin of each key is pulled up to a high level or pulled down to a low level, the other end of the switch pin is connected to a GPIO of the microcontroller, the GPIO monitors the state of the pressed or bounced key, the pull-up or pull-down of all switches are connected in parallel, after the display content of the key is changed, the state judgment of the GPIO detection is not changed, only a command code generated by the microcontroller according to key position information can be correspondingly consistent with the new content displayed by the key, one key is set as a menu switching key in a key array, when the key is pressed, the display content of each key except the menu switching key of the whole key matrix is switched, and simultaneously, the key position analysis and the command code generation also complete the switching of the corresponding relation.

Preferably, the SD card is connected to the SDIO interface of the microcontroller, wherein the image data to be displayed by the keys are stored, and the data are stored in several folders, respectively, each folder corresponds to the image file to be displayed by all the keys in the key matrix state, so the SD card has a plurality of folders; the method comprises the steps that picture data needing to be displayed by all keys in the current state are arranged under each folder, after the device is powered on, the keys are initialized, the microcontroller reads picture information needing to be displayed by each key from the initialization folder through the SDIO interface and sends the picture information to each key through the SPI bus to enable the keys to be displayed, at the moment, key position analysis and command code generation functions are consistent with the current state, when the key functions need to be switched, a menu switching key is pressed, the microcontroller reads the picture information needing to be displayed by each key from the corresponding state folder through the SDIO interface and sends the picture information to the corresponding keys through the SPI bus to complete display, and meanwhile, the key position analysis and command code generation functions are also switched and correspond to the current display content.

Preferably, the content in the SD card can be modified through a USB interface connected with the main control computer and the device, the device is identified as a U disk under a USB bus of the main control computer, only the picture files under the folders in the corresponding states need to be modified, the device can use new pictures after being electrified again, the files in the folders are stored according to the format of the bins, and the pictures in different formats need to be firstly subjected to format conversion.

The invention also provides a working method of the device, which comprises the following steps of electrifying, initializing and displaying the device, wherein the operation comprises the following steps:

s10: electrifying: powering on the device;

s11: initializing a processor: loading a working program by the microcontroller;

s12: a step of reading data by the microcontroller: the microcontroller reads picture data needing to be displayed by key initialization;

s13: displaying a key initialization command step: the microcontroller sends an initialization command to the key through the SPI chip selection signal and the command data signal;

s14: displaying key initialization data: the microcontroller sends picture data to be displayed by the key;

s15: a display key lighting step: after the picture data is sent, the microcontroller sends a key lightening command;

s16: display key cycle initialization step: after the current key finishes the display operation, continuing to perform the initialization operation of the next key until all keys finish initialization;

s17: a monitoring step of the microcontroller: the microcontroller operates in a key status monitoring STATE with a monitoring function of STATE 0.

The invention also provides a working method of the device, which comprises the key pressing processing operation, and the operation comprises the following steps:

s20: the key pressing step: the key array is pressed down by keys;

s21: key position receiving step: the microcontroller receives the pressed key number;

s22: switching key and common key judging steps: the microcontroller judges whether the pressed key is a key function switching key according to the key position number, if so, the step S23 is executed, and if not, the step S25 is executed;

s23: a key initialization step: the microcontroller reinitializes the keys according to the steps S12-S16;

s24: and a monitoring function skipping step: the microcontroller jumps to a new monitoring function STATE 0-STATEN and executes step S27;

s25: a command code generation step: the microcontroller generates corresponding command codes under the control of corresponding monitoring functions STATE 0-STATEN according to the pressed key position number;

s26: a command code sending step: the microcontroller sends the generated command code to the main control computer and executes step S27;

s27: a monitoring step of the microcontroller: the microcontroller works in a key monitoring state, and the monitoring function is a current function.

(III) advantageous effects

The invention is used for realizing the key switch function, and the user can customize the display content and the key function through the programming of the main control computer. In addition, the device can also send the collected key information to the main control computer by command codes in a certain format, and the main control computer completes corresponding operation. The device can also realize multi-menu switching of key functions under the working state, thereby achieving the purpose of one-key multi-use, greatly reducing the number of keys of the equipment, and effectively reducing the cost of the whole equipment and the area of the operating platform. Because the keys are provided with the OLED display screen, the display content can be modified; in addition, the key functions may also be modified. The invention can make the fixed display content and the fixed switch function of the key in the current equipment be programmed and modified. The use method can realize key reuse, namely one key realizes multiple functions, effectively reduces the defect of too many keys in the traditional equipment, greatly reduces the equipment cost and the occupation of the space of an operation table top, and increases the utilization rate of each key.

Drawings

FIG. 1 is a schematic view of the use of the apparatus of the present invention;

FIG. 2 is a schematic diagram of an internal structure of the programmable display key array device according to the present invention;

FIG. 3 is a flowchart illustrating a power-up initialization display operation according to the present invention;

FIG. 4 is a flow chart of the key press operation of the present invention.

Detailed Description

In order to make the objects, contents, and advantages of the present invention clearer, the following detailed description of the embodiments of the present invention will be made in conjunction with the accompanying drawings and examples.

The programmable display key array device based on the localization microcontroller uses the whole block diagram as shown in figure 1, the device generally needs to be connected with a main control computer for use, and the main components of the device comprise the following parts.

1. Matrix key array can be displayed: the micro-controller is composed of a plurality of keys, each key is used for receiving commands and data transmitted by the micro-controller to operate and display, and can be pressed or bounced to complete basic switch operation; each key is a displayable key with an OLED screen, one of the arrays is set as a menu switching key, and when the key is pressed, the function of the key matrix is switched. The array has the following three main characteristics: first, after power up, each key needs to be initialized and display the initialization picture under the control of the microcontroller, such as power-up switch, launch button, call-up, etc. Secondly, the key can be turned on or off under the control of the microcontroller. Thirdly, the switch state obtained by pressing or bouncing the switch can be monitored by the microcontroller, and the microcontroller generates a command code and sends the command code to the main control computer to complete corresponding operation.

Microcontroller of Cortex-M4 core: as the core of the device, the microprocessor has rich peripheral devices: UART, SPI bus, SDIO controller, GPIO serial port, USB interface, etc.

UART: the microcontroller analyzes the key position information of the key switch to generate an appointed command code, the appointed command code is sent to a main control computer of the display control device through the interface, and the main control computer analyzes the information to complete corresponding operation;

SPI bus: the microcontroller controls all peripheral keys by using an SPI bus, and the SPI bus is responsible for sending command information (lighting, extinguishing, initializing, display parameter adjusting and the like) and data information (display pictures) to each key;

SDIO controller: the microcontroller reads and writes each key display picture data stored in the memory card through the SDIO controller, and the content of the SD card can be read and written by the main control computer through the USB interface;

GPIO serial port: the microcontroller is used for monitoring the on or off state of all the key pressing or bouncing information, and after each key is pressed, the microcontroller generates a corresponding command code according to a defined function and transmits the command code to a main control computer of the display control device through a GPIO serial port of the communication serial port; the microcontroller realizes the communication and control with the displayable matrix key array through the SPI bus and the GPIO serial port.

USB interface: the microcontroller is used for being connected with the main control computer, can read and write the picture file stored by the SD card, and is convenient for quickly modifying the key display picture data; the main control computer can quickly change the picture information in the SD card through the USB interface, thereby realizing the change of the key display content.

The microcontroller stores control program for function control and generation of key position command codes matched with different working menus. A USB interface, a communication serial port and a debugging serial port are arranged between the main control computer and the main control computer. The debugging serial port is used for updating a control program in the microcontroller, and comprises functions of key initialization, key definition analysis and the like, and a user can finish the program modification and updating by using the serial port, so that the device function can be timely adjusted according to the requirements of the user. The communication serial port is used for transmitting the analyzed key information to the main control computer according to a certain data format, and the main control computer controls the relevant function module to complete the operation.

3. The SD card with data storage function is used to store the graphic information content to be displayed by each key, when the menu switching key is pressed, the microcontroller reads out the corresponding picture and sends the picture to the corresponding key, and the display is completed at the key. Meanwhile, the image data can be modified by the main control computer through a USB interface;

4. the power supply is used for carrying out secondary voltage transformation on the reference voltage supplied from the outside, decomposing the reference voltage into various voltages required by device hardware, such as 12V input, and converting the voltages into voltage commonly used by the devices, such as 3.3V, 5V and the like.

The main control computer is used for connecting the programmable display key array device and executing corresponding operation after receiving the key information transmitted by the microcontroller. If the brightness is adjusted, the backlight of the display is dimmed, the rotating speed of a cabinet fan is adjusted, and the like;

as shown in fig. 2, the SPI buses of the plurality of keys are connected in parallel to the SPI bus of the microcontroller, the maximum number of keys that each microcontroller can connect depends on the load capacity of the SPI bus and the number of available GPIO pins, and the SPI bus transmits the operation commands or the image data, and the communication process of the operation commands or the image data complies with the SPI communication specification. In addition, each key is also provided with a command/data enabling signal which is also connected to a GPIO pin of the microcontroller in parallel and used for identifying whether data transmitted on the SPI bus is data or a command: when the enable signal is high, image data required to be displayed by a key is transmitted on the SPI bus; when the enable signal is low, a command is transmitted on the SPI bus; the keys can complete the operations of self initialization, display, on/off and the like according to the commands.

One end of a switch pin of each key is pulled up to a high level or pulled down to a low level, the other end of the switch pin is connected to a GPIO of a microcontroller, the connection of the switch pin is consistent with that of a traditional switch, the GPIO monitors the state of the key when the key is pressed down or bounced, the pull-up or pull-down of all the switches are connected in parallel, after the display content of the key is changed, the state judgment of GPIO detection is not changed, and only a command code generated by the microcontroller according to key position information is consistent with the new content displayed by the key. For example, the function of the prior art is that a power switch at a certain position is analyzed to be turned on after being pressed down, the microcontroller generates a command code 0x45 and sends the command code to the main control computer through a serial port, and the main control computer informs the power-on unit to complete power-on of the specified position. When the key is displayed as a transmitting button, the key is analyzed to execute transmission after being pressed, the microcontroller generates a command code 0x32 and sends the command code to the main control computer through a serial port, and the main control computer informs the transmitting execution unit to finish transmission. In addition, one key in the key array is set as a menu switching key, when the key is pressed, the display content of each key in the whole key array is switched (except the menu switching key), and simultaneously, the key position analysis and the command code generation also complete the switching of the corresponding relation.

The SD card is connected with an SDIO interface of the microcontroller, wherein picture data required to be displayed by the keys are stored, and the data are respectively stored under several folders. Each folder corresponds to a picture file to be displayed by all keys in a key matrix state, so that the SD card is provided with a plurality of folders; and the picture data which needs to be displayed by all the keys in the current state is arranged under each folder. After the device is powered on, the keys start to be initialized, the microcontroller reads picture information required to be displayed by each key from the initialization folder through the SDIO interface and sends the picture information to each key through the SPI bus to enable the keys to finish displaying, and at the moment, key position analysis and command code generation functions are also consistent with the current state. When the key function needs to be switched, the menu switching key is pressed, the microcontroller reads the picture information to be displayed of each key from the corresponding state folder through the SDIO interface and sends the picture information to the corresponding key through the SPI bus to finish displaying, and meanwhile, the key position analysis and command code generation function also finishes switching and corresponds to the current display content.

The content in the SD card can be quickly modified through a USB interface connected between the main control computer and the device. The device is identified as a U disk under the USB bus of the main control computer, only the picture files under the folders in the corresponding states are needed to be modified, and new pictures can be used after the device is electrified again. It should be noted that the files in the folder are generally stored in the format of the bin, and the pictures in different formats need to be converted into the format first.

The working method of the device comprises two methods: 1. and (4) displaying power-on initialization 2. key pressing operation.

The power-on initialization display operation includes the following steps, as shown in fig. 3:

s10: electrifying: powering on the device;

s11: initializing a processor: loading a working program by the microcontroller;

s12: a step of reading data by the microcontroller: the microcontroller reads picture data needing to be displayed by key initialization;

s13: displaying a key initialization command step: the microcontroller sends an initialization command to the key through the SPI chip selection signal and the command data signal;

s14: displaying key initialization data: the microcontroller sends picture data to be displayed by the key;

s15: a display key lighting step: after the picture data is sent, the microcontroller sends a key lightening command;

s16: display key cycle initialization step: after the current key finishes the display operation, continuing to perform the initialization operation of the next key until all keys finish initialization;

s17: a monitoring step of the microcontroller: the microcontroller operates in a key status monitoring STATE with a monitoring function of STATE 0.

The key depression processing operation includes the following steps, as shown in fig. 4:

s20: the key pressing step: the key array is pressed down by keys;

s21: key position receiving step: the microcontroller receives the pressed key number;

s22: switching key and common key judging steps: the microcontroller judges whether the pressed key is a key function switching key according to the key position number, if so, the step S23 is executed, and if not, the step S25 is executed;

s23: a key initialization step: the microcontroller reinitializes the keys according to the steps S12-S16;

s24: and a monitoring function skipping step: the microcontroller jumps to a new monitoring function (STATE 0-STATEN) and executes step S27;

s25: a command code generation step: the microcontroller generates corresponding command codes under the control of corresponding monitoring functions (STATE 0-STATEN) according to the pressed key position numbers;

s26: a command code sending step: the microcontroller sends the generated command code to the main control computer and executes step S27;

s27: a monitoring step of the microcontroller: the microcontroller works in a key monitoring state, and the monitoring function is a current function.

The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种图片的显示方法、图片显示装置及移动终端

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类