Summary of the invention
Technical matters to be solved by this invention provides collecting method and a kind of touch-screen system of a kind of data collector of touch-screen, a kind of touch-screen, with taking of minimizing resources of chip, and effectively improves the acquisition rate of contact data.
In order to solve the problems of the technologies described above, the embodiment of the invention discloses a kind of data collector of touch-screen, described data collector is connected with the region of memory of control chip and preset size, and this device specifically comprises:
Data acquisition controller comprises first controlling sub and second controlling sub, and described first controlling sub is connected with touch panel unit, is used to dispose the sampling order and the sampling interval of current contact; Described second controlling sub is connected with data transmission module, is used for the data volume threshold value of configuration notification chip;
Touch panel unit is used for gathering the contact data according to described sampling order and sampling interval;
Data transmission module comprises that internal memory writes submodule and chip informing submodule, and described internal memory writes submodule and is used for the described number of contacts mode write memory zone of DMA according to this; When the data volume that described chip informing submodule is used for current write memory zone satisfied the data volume threshold value of described notice chip, the notice control chip was handled.
Preferably, second controlling sub of described data acquisition controller also is used to dispose the data volume threshold value of described region of memory, and described data transmission module also comprises:
Internal memory write-back submodule is used for when the data that region of memory has been deposited satisfy described region of memory data volume threshold value, and the reference position of returning described region of memory writes.
Preferably, described device also comprises:
Calling module is connected with described control chip and region of memory, be used for according to current demand call corresponding algorithm or the instruction corresponding contacts data of region of memory are handled.
Preferably, described touch-screen is a resistive touch screen, and described touch panel unit comprises:
Touch panel;
Touch screen controller is used for sampling order and sampling interval according to the configuration of described data acquisition controller, determines to give the order that powers up direction of touch panel and powers up frequency and the corresponding voltage that applies, with the simulating signal of acquisition contact data;
AD converter is used for described analog signal conversion is become digital signal, and exports to data transmission module.
Preferably, described contact data comprise contact coordinate data and contact force data, and described control chip is MCU.
The embodiment of the invention also discloses a kind of collecting method of touch-screen, described touch-screen is connected with control chip, and described method comprises:
A certain size region of memory of predistribution presets the sampling order and the sampling interval of current contact, and, preset the data volume threshold value of notice chip;
Gather the contact data according to described sampling order and sampling interval;
With the described number of contacts mode write memory zone of DMA according to this;
If the data volume in current write memory zone satisfies the data volume threshold value of described notice chip, then notify the control chip of described touch-screen to handle.
Preferably, the described step that presets also comprises: the data volume threshold value that presets described region of memory;
Described method also comprises:
If the data of having deposited in the region of memory satisfy the data volume threshold value of described region of memory, the reference position of then returning described region of memory writes.
Preferably, being treated to of the control chip of described touch-screen called corresponding algorithm or instruction is handled the corresponding contacts data in the region of memory according to current demand.
Preferably, described touch-screen is a resistive touch screen, and the step of described collection contact data specifically comprises:
According to the sampling order and the sampling interval of described configuration, determine to give the order that powers up direction of touch panel and power up frequency and the corresponding voltage that applies, with the simulating signal of acquisition contact data;
Described analog signal conversion is become digital signal.
The embodiment of the invention also discloses a kind of touch-screen system, comprising:
The Memory Allocation unit is used to distribute the region of memory of preset size;
Control chip is connected with calling module, is used for calling corresponding algorithm or instruction according to current demand, and the corresponding contacts data in the region of memory are handled;
The data collector that links to each other with described region of memory and control chip specifically comprises with lower member:
Data acquisition controller comprises first control sub unit and second control sub unit, and described first control sub unit is connected with touch panel unit, is used to dispose the sampling order and the sampling interval of current contact; Second control sub unit is connected with data transmission unit, is used for the data volume threshold value of configuration notification chip;
Touch panel unit is used for gathering the contact data according to described sampling order and sampling interval;
Data transmission module comprises that internal memory writes subelement and chip informing subelement, and described internal memory writes subelement and is used for the described number of contacts mode write memory zone of DMA according to this; Described chip informing subelement is used for when the current data amount satisfies the data volume of described notice chip, and the notice control chip is handled.
Preferably, second controlling sub of described data acquisition controller also is used to dispose the data volume threshold value of described region of memory, and described data transmission module also comprises:
Internal memory write-back submodule is used for when the data that region of memory has been deposited satisfy described region of memory data volume threshold value, and the reference position of returning described region of memory writes.
Preferably, described touch-screen is a resistive touch screen, and described touch panel unit comprises:
Touch panel;
Touch screen controller is used for sampling order and sampling interval according to the configuration of described data acquisition controller, determines to give the order that powers up direction of touch panel and powers up frequency and the corresponding voltage that applies, with the simulating signal of acquisition contact data;
AD converter is used for described analog signal conversion is become digital signal, and exports to data transmission module.
Preferably, described contact data comprise contact coordinate data and contact force data, and described control chip is MCU.
Compared with prior art, the present invention has the following advantages:
The present invention utilizes the characteristic of this DMA transmission in data transmission module, the contact data that touch panel unit is collected write described region of memory, and based on the data volume threshold value of the notice chip of second controlling sub of described data acquisition controller configuration, when the data volume in current region of memory reaches this threshold value, initiate once to interrupt, the notice chip is handled.Promptly in embodiments of the present invention, chip need not expensive resource and does this part thing of real-time data acquisition, and only need the related data in the internal memory be handled according to the interrupt notification of DMA, thereby has effectively reduced taking of resources of chip.
The present invention is for the speed of data acquisition, can in data acquisition controller, be configured, and need not finish the collection of data by software, therefore can gather with higher rate, correspondingly offer control chip to carry out the data of algorithm or instruction calls also many, also can improve the accuracy of identification of touch-screen simultaneously.Moreover, the present invention also can directly deposit data automatically according to demand, can directly be used on the algorithm, also can original data be upgraded automatically by the write-back mechanism of internal memory simultaneously, not only save memory source, also further improved the accuracy of identification of touch-screen.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
With reference to figure 1, show the structured flowchart of the data collector embodiment of a kind of touch-screen of the present invention, wherein, described data collector 11 is connected with the region of memory 13 of control chip 12 and preset size, and this data collector 11 specifically can comprise with lower member:
Data acquisition controller 101 comprises first controlling sub and second controlling sub, and wherein, described first controlling sub is connected with touch panel unit 102, is used to dispose the sampling order and the sampling interval of current contact; Described second controlling sub is connected with data transmission module 103, is used for the data volume threshold value of configuration notification chip;
Touch panel unit 102 is used for gathering the contact data according to described sampling order and sampling interval;
Data transmission module 103 comprises that internal memory writes submodule and chip informing submodule, and described internal memory writes submodule and is used for from the number of contacts of the described touch panel unit 102 mode write memory zone of DMA according to this; When the data volume that described chip informing submodule is used for current write memory zone satisfied the data volume threshold value of described notice chip, the notice control chip was handled.
In specific implementation, can be according to the application demand of current touch-screen, operate identification, graphing etc. as handwriting recognition, movement tendency judgement, user, first controlling sub by data acquisition controller, the speed that the sampling interval of configuration data is gathered with flexible control data, for example, every 5ms or every 10ms gather one group of contact data, and the configuration sampling order is with the order of control data write memory.
With the resistive touch screen is example, in a preferred embodiment of the present invention, described touch panel unit can comprise touch panel and AD converter, wherein, described touch screen controller can be according to the sampling order and the sampling interval of described configuration, determine to give the order that powers up direction of touch panel and power up frequency and the corresponding voltage that applies, with the simulating signal of acquisition contact data; AD converter is used for described analog signal conversion is become digital signal, and exports to data transmission module.
Generally speaking, the touch panel unit contact data of gathering comprise contact coordinate data and contact force data.For making those skilled in the art understand the present invention better, simply introduce the ultimate principle that resistive touch screen is gathered the contact data below in conjunction with Fig. 2.
Fig. 2 A is the synoptic diagram of resistive touch screen when single-point touches, Fig. 2 B is the equivalent circuit diagram of the resistive touch screen shown in Fig. 2 A, this example is a four-wire ohm touch-screen, comprising X conductive layer panel and Y conductive layer panel are arranged, P1 represents a touch point, R1, R3 represent the equivalent resistance that X layer conductive layer panel is divided into two parts, R4, R6 represent the equivalent resistance that Y layer conductive layer panel is divided into two parts, Rz represents the touch resistance of P1, and Xp, Xn, Yp, Yn are respectively the electric connecting terminal of the X conductive layer panel and the Y conductive layer panel of this resistive touch screen.
In concrete the application, the all-in resistance Xplate of X layer conductive layer panel and the all-in resistance Yplate of Y layer are known; According to the relation that voltage is directly proportional with resistance, if the anodal VT (reference voltage) of Yp termination voltage, Yn ground connection then can have following relation at the voltage V1 that the Xp end records:
In like manner, if the anodal VT of Xp termination voltage, Xn ground connection, then the voltage V3 that records at the Yp end has following relation:
Because the resistance of X layer conductive layer panel and Y layer conductive layer panel is uniformly, so be easy to obtain by resistance value the coordinate figure of touch point directions X and Y direction, promptly obtains the position of touch point on touch-screen.
In practice, can also be in the process that above-mentioned contact coordinate obtains by pressure transducer, measure the pressure data of corresponding contact in the lump, show visually on touch-screen with the foundation actual demand, more then person's handwriting is thicker as pressure, and the less then person's handwriting of pressure more carefully waits the display effect that meets user's impression.
Be well known that, DMA (direct memory access) has behind a collection of Data Transfer Done, characteristic by interrupt mode notice chip, the embodiment of the invention is utilized the characteristic of this DMA transmission just in data transmission module, the contact data that touch panel unit is collected write described region of memory, and, then notify control chip one time after promptly gathering m group data based on the data volume threshold value m of the notice chip of second controlling sub of described data acquisition controller configuration; When the data volume in current region of memory reaches this threshold value, initiate once to interrupt, the notice chip is handled.In practice, described m can dispose arbitrarily according to the current application situation, for example, in the application of handwriting recognition, configuration m=5 is in the application that track is judged, configuration m=1, promptly those skilled in the art that m is configured to arbitrary natural number average is passable, the present invention does not limit this.As can be seen, in embodiments of the present invention, chip need not expensive resource and does this part thing of real-time data acquisition, and only need the related data in the internal memory be handled according to the interrupt notification of DMA, thereby has effectively reduced taking of resources of chip.
For further saving memory source, in a preferred embodiment of the present invention, second controlling sub of described data acquisition controller can also be used for the data volume threshold value n in allocate memory zone, and in this case, described data transmission module can also comprise following submodule:
Internal memory write-back submodule is used for when the data that region of memory has been deposited satisfy described region of memory data volume threshold value, and the reference position of returning described region of memory writes.
Use present embodiment, in region of memory, preserve n group data after, can return the start address of this region of memory automatically and restart to write, thereby need not region of memory is defined too much, help saving memory source, improve the chip handling property.Need to prove that in practice, this data volume threshold value n does not define too smallly, to such an extent as to the data that before write are not processed as yet, just the data that write have later covered.
In specific implementation, the present invention can also comprise as lower module:
Calling module is connected with described control chip and region of memory, be used for according to current demand call corresponding algorithm or the instruction corresponding contacts data of region of memory are handled.
For example, in handwriting recognition, dispose current 5-10ms and gather one group of data, every 5-10 group data notification control chip once, to carry out calling of a stroke recognizer, 20 strokes are formed a Chinese character, reinform control chip so adopt 100-200 group data, discern with the calling word algorithm.Can also be provided with simultaneously and carry out once wraparound automatically in the internal memory after 300 groups of data of reservation, to improve the accuracy rate of recognizer.
As a kind of preferred application, described control chip can be MCU (Micro ControlUnit), Chinese is a micro-control unit, claim one chip microcomputer (Single ChipMicrocomputer) or single-chip microcomputer again, be meant appearance and development thereof along with large scale integrated circuit, CPU, RAM, ROM, timing number device and the multiple I/O interface of computing machine are integrated on a slice chip, form the computing machine of chip-scale, for doing various combination control in different application scenarios.Certainly, in conjunction with concrete actual demand, it also is feasible that those skilled in the art adopt the CPU, chip of other kind etc., and the present invention does not limit this.
With reference to figure 3, show the process flow diagram of the collecting method embodiment of a kind of touch-screen of the present invention, described touch-screen is connected with control chip, and present embodiment specifically can may further comprise the steps:
A certain size region of memory of step 201, predistribution presets the sampling order and the sampling interval of current contact, and, preset the data volume threshold value of notice chip;
Step 202, the described sampling order of foundation and sampling interval are gathered the contact data;
Step 203, with the described number of contacts mode write memory zone of DMA according to this;
Step 204, if the data volume in current write memory zone satisfies the data volume threshold value of described notice chip, then notify the control chip of described touch-screen to handle.
In a preferred embodiment of the present invention, being treated to of the control chip of described touch-screen called corresponding algorithm or instruction is handled the corresponding contacts data in the region of memory according to current demand.
In specific implementation, described touch-screen can be resistive touch screen, and the step of described collection contact data specifically can comprise following substep:
Substep S1, according to the sampling order and the sampling interval of described configuration, determine to give the order that powers up direction of touch panel and power up frequency and the corresponding voltage that applies, with the simulating signal of acquisition contact data;
Substep S2, described analog signal conversion is become digital signal.
For further saving memory source, improve the handling property of chip, in a preferred embodiment of the present invention, the described step 201 that presets can also comprise following substep:
Preset the data volume threshold value of described region of memory;
In this case, present embodiment can also comprise the steps:
Step 205, if when the data volume of having deposited satisfies the data volume threshold value of described region of memory in the region of memory, the reference position of then returning described region of memory writes.
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.For example, step 204 and step 205 can be carried out simultaneously or transposing is carried out in proper order.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
Because present embodiment is substantially corresponding to the function of corresponding component among the device embodiment shown in Figure 1, so not detailed part in the description of present embodiment can just not given unnecessary details at this referring to the related description in embodiment illustrated in fig. 1.
With reference to figure 4, show the structured flowchart of a kind of touch-screen system embodiment of the present invention, specifically can comprise:
The Memory Allocation unit is used to distribute the region of memory 41 of preset size;
Control chip 42 is connected with calling module 43, is used for calling corresponding algorithm or instruction according to current demand, and the corresponding contacts data in the region of memory are handled;
With the data collector that described region of memory 41 and control chip 42 link to each other, specifically comprise with lower member:
Data acquisition controller 44 comprises first control sub unit and second control sub unit, and described first control sub unit is connected with touch panel unit, is used to dispose the sampling order and the sampling interval of current contact; Second control sub unit is connected with data transmission unit, is used for the data volume threshold value of configuration notification chip, and, dispose the data volume threshold value of described region of memory;
Touch panel unit is used for gathering the contact data according to described sampling order and sampling interval;
Data transmission module 45 comprises that internal memory writes subelement, internal memory write-back subunit and chip informing subelement, and described internal memory writes subelement and is used for the described number of contacts mode write memory zone of DMA according to this; Described internal memory write-back subunit is used for when the data that region of memory has been deposited satisfy described region of memory data volume threshold value, and the reference position of returning described region of memory writes; Described chip informing subelement is used for data volume in current write memory zone when satisfying the data volume of described notice chip, and the notice control chip is handled.
In specific implementation, described touch-screen can be resistive touch screen, and described touch panel unit can comprise with lower member:
Touch panel 46;
Touch screen controller 47 is used for sampling order and sampling interval according to the configuration of described data acquisition controller, determines to give the order that powers up direction of touch panel and powers up frequency and the corresponding voltage that applies, with the simulating signal of acquisition contact data;
AD converter (ADC) 48 is used for described analog signal conversion is become digital signal, and exports to data transmission module.
Described data transmission module can be realized by dma controller (DMAC).Be well known that DMAC can take over control to bus fully from chip, exchanges data is without chip, and directly carries out between internal memory and external memory.In the inside of DMAC, several registers are arranged: address register, the memory unit address of store data when depositing the DMA transmission; Byte counter is deposited the byte number of DMA transmission; Control register is deposited the DMA transmission mode of being set by CPU, control command etc.; Status register: deposit the current state of DMAC, comprise having or not the DMA request, whether finish etc.When requiring access one batch data, send out a signal by DMAC and give CPU, after CPU obtains this signal, abdicate the control of bus, at this moment DMAC just obtains bus control right, afterwards, begins to carry out data and transmits; Behind a collection of Data Transfer Done, data transmission module notice CPU can use internal memory, and bus control right is given back CPU.
As a kind of preferred application, described contact data can comprise contact coordinate data and contact force data, and described control chip can be MCU.
For system embodiment, because it is similar substantially to device embodiment shown in Figure 1, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
At last, also need to prove, in this article, relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint and have the relation of any this reality or in proper order between these entities or the operation.
More than collecting method and a kind of touch-screen system of the data collector of a kind of touch-screen provided by the present invention, a kind of touch-screen is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.