Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A Method of Extending the Hardware Timer of Single Chip Microcomputer

A hardware timer and single-chip technology, applied in instruments, simulators, computer control, etc., can solve the problems of cluttered software structure and difficult software maintenance, and achieve the goal of writing software code with simple structure, flexible use, and meeting the needs of time control. Effect

Active Publication Date: 2017-07-28
SICHUAN TIANYI COMHEART TELECOM
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

If the process task is directly processed in the hardware timer interrupt, the software structure will appear messy, which will bring difficulties to software maintenance

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A Method of Extending the Hardware Timer of Single Chip Microcomputer
  • A Method of Extending the Hardware Timer of Single Chip Microcomputer

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] The technical solution of the present invention will be further described in detail below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following description.

[0023] A method for extending a single-chip hardware timer, comprising the following steps:

[0024] S1: Define the timing information structure type. The timing information type is a structure type including time value variables and message value variables. It is agreed that when the message value variable is 0, it means that the timing information is invalid;

[0025] S2: Define a timing information array for storing timing information. When initializing the timing information array, set the message value variable of each component to 0;

[0026] S3: Define the reference time variable, which is used to add 1 in the hardware timer interrupt service routine as the reference time for the entire timer extension;

[0027] S4: Set the interru...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for extending a single chip microcomputer hardware timer. The method is used together with a message queue based single chip microcomputer operating system and can provide timer trigger information needed by different tasks for the tasks. According to the method, an array for storing timing information and a reference time variable serving as reference time are distributed in advance; interruption of a certain period is generated by the hardware timer; finally, extension of the timer is completed in an interruption service program. During each calling of the interruption service program, 1 is added to the reference time variable, the sum is compared with each timing value, and a message specified by the timing information is sent if the sum is identical to each timing value. The method has the advantages that only one hardware timer is used in the method, compiling software is simple in code structure and high in operation efficiency, the method is flexible to use when the message queue based single chip microcomputer operating system performs multi-task design related to time, and requirements of each task progress on time control can be met.

Description

technical field [0001] The invention relates to a method for extending a single chip microcomputer hardware timer. Background technique [0002] In the software design of single-chip microcomputer, it is often necessary to develop the design task process in chronological order, while the standard model 51 series single-chip microcomputer only has 4 hardware timers, and some timers are also occupied by some peripheral components, such as UART, etc., which can be used as Time-controlled timers are very rare. If the process task is directly processed in the interrupt of the hardware timer, the software structure will appear messy, which will bring difficulties to software maintenance. Contents of the invention [0003] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method for expanding the hardware timer of the single-chip microcomputer. The present invention is used in conjunction with the single-chip microcomputer operat...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G05B19/042
CPCG05B19/0426
Inventor 李俊画马剑朱永莫平勇
Owner SICHUAN TIANYI COMHEART TELECOM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products