Disclosure of Invention
In view of the foregoing, an object of the present invention is to provide a scan control device, a scan control method, and a touch chip for a touch panel, in which two-stage analysis is performed on a scan scheme, slot control in a scan stage and a non-scan stage are respectively implemented, and a scan control signal is generated, so as to flexibly configure the scan scheme and simplify a circuit structure of a control signal generating circuit.
According to one aspect of the invention, a scanning control device for a touch panel is provided, which comprises a microprocessor, a descriptor parser and a control signal generation circuit, wherein the microprocessor selects a scanning scheme according to a touch state, the descriptor parser is connected with the microprocessor and is used for parsing a descriptor linked list according to the scanning scheme to generate a scanning task sequence, and the control signal generation circuit is connected with the descriptor parser and is used for parsing the scanning task sequence to generate a scanning control signal.
Optionally, the descriptor linked list comprises a plurality of descriptors connected in series through address pointers, wherein the plurality of descriptors are selected from any one of time control descriptors used for defining time slots of a scanning stage and a non-scanning stage, touch scanning descriptors used for defining a scanning task sequence and flow control descriptors used for executing branch control of different scanning modes.
Optionally, the descriptor linked list employs a word-aligned linear address layout, each descriptor consisting of 1-4 consecutive 32-bit words, the first word containing a 4-bit descriptor type field and an interrupt enable flag.
Optionally, the descriptor parser comprises a finite state machine for reading and parsing the descriptor linked list in sequence, and a counter comprising a down counter and an up counter for counting down or up according to the time control descriptor.
Optionally, the time control descriptor includes a timing descriptor, a delay descriptor and a waiting descriptor, the down-counting counter loads an initial value corresponding to load data in the timing descriptor and starts to count down, so as to realize down-timing, the down-counting counter reloads a next initial value until the count value is zero, after each time the down-counting counter loads the initial value, the descriptor parser executes analysis of the next descriptor to realize time slot control of a scanning stage and a non-scanning stage, the delay descriptor is used for inserting a preset delay between adjacent scanning stages, the up-counting counter counts up from zero when the delay descriptor starts to execute, until the count value reaches a first preset value, the up-counting counter returns a signal for completing the delay, the up-counting counter also counts up from zero when the waiting descriptor starts to execute, so as to realize up-timing, until the time slot control of the external event is received, the delay descriptor is used for inserting a preset delay between adjacent scanning stages, the up-counting counter counts up until the count value reaches a preset value, or the up-counting counter returns a signal when the count value reaches a preset value, and the up-counting counter returns a signal when the count value reaches a preset value, and the up-counting counter reaches a preset value.
Optionally, the flow control descriptor comprises a termination descriptor for indicating that the descriptor parser stops parsing and triggers an interrupt, and a comparison descriptor for comparing a value of a specified address in a data address space with a preset threshold and selecting an address pointer of a next descriptor according to a comparison result to realize branch jump.
Optionally, the touch scanning descriptor comprises a task field for defining a scanning task sequence, an increment field for indicating the control signal generating circuit to automatically increment a scanning sequence number and continuously execute a plurality of scanning commands according to the same scanning mode, and a sharing field for indicating sharing establishment time and/or recovery time between adjacent scanning stages.
Optionally, a plurality of scanning tasks are defined in the task field, each scanning task comprises a scanning mode subfield for defining any one of the following basic scanning modes, namely, active pen line scanning, active pen column scanning, active pen noise scanning, finger line scanning, finger column scanning, finger noise scanning, finger grouping scanning, active pen uplink sending, short circuit detection scanning, a scanning sequence number subfield for defining a touch electrode grouping number corresponding to a scanning command, and a scanning behavior subfield for defining any one of the following scanning behaviors, namely, capacitance compensation value preparation, capacitance compensation value updating and scanning execution.
The control signal generating circuit comprises a channel selection signal generating module, an integration control signal generating module, a capacitance compensation preparation module and a data statistics storage module, wherein the channel selection signal generating module is used for generating a channel selection signal of a multiplexer according to the scanning task sequence, the integration control signal generating module is used for generating an integration control signal of an analog front-end circuit and controlling charge and discharge of a capacitor to realize charge-to-voltage conversion, the capacitance compensation preparation module is used for reading a compensation value from a capacitance compensation value address space and preloading the capacitance compensation value before a scanning command is executed, the capacitance compensation updating module is used for latching the preloaded compensation value to the capacitance compensation module when a scanning task starts, and the data statistics storage module is used for writing detection data output by an analog-to-digital converter of the analog front-end circuit into a detection data storage address space and performing statistics operation.
According to another aspect of the invention, a scanning control method for a touch panel is provided, which comprises the steps of selecting a scanning scheme according to a touch state of the touch panel, acquiring a descriptor linked list according to the scanning scheme, performing first-stage analysis on the descriptor linked list to generate a scanning task sequence, and performing second-stage analysis on the scanning task sequence to generate a scanning control signal.
Optionally, the descriptor linked list comprises a plurality of descriptors connected in series through address pointers, wherein the plurality of descriptors are selected from any one of time control descriptors used for defining time slots of a scanning stage and a non-scanning stage, touch scanning descriptors used for defining a scanning task sequence and flow control descriptors used for executing branch control of different scanning modes.
Optionally, the descriptor linked list employs a word-aligned linear address layout, each descriptor consisting of 1-4 consecutive 32-bit words, the first word containing a 4-bit descriptor type field and an interrupt enable flag.
Optionally, the first level parsing includes sequentially reading and parsing the descriptor linked list using a finite state machine, and performing down-clocking or up-clocking using a counter to complete time slot control defined by a time control descriptor.
The time control descriptor comprises a timing descriptor, a delay descriptor and a waiting descriptor, wherein the time control descriptor comprises loading initial values corresponding to load data of the timing descriptor by using a counter which counts down and starting to count down, the next initial value is not reloaded until the count value reaches zero, and after each time the initial values are loaded by the counter which counts down, the descriptor parser can execute the parsing of the next descriptor to realize time slot control of a scanning stage and a non-scanning stage, the delay descriptor comprises the steps of realizing the counting up from zero by using the counter which counts up, returning a signal with the completion of delay, then carrying out the parsing of the next descriptor to insert a preset delay between adjacent scanning stages, and the waiting descriptor comprises the steps of carrying out the parsing of the next descriptor after the count up is started by using the counter which counts up when the waiting descriptor starts to execute, and stopping counting up until the trigger of an external event is received, or carrying out the parsing of the next descriptor after the trigger signal which is not received by using the counter which counts up when the count up reaches the preset count value reaches the preset value, and the next waiting time of the next waiting descriptor is not counted up when the trigger signal which reaches the corresponding to count up in the next waiting stage.
Optionally, the flow control descriptor comprises a termination descriptor for indicating to stop analysis and triggering interruption, and a comparison descriptor for comparing the value of the designated address in the data address space with a preset threshold value and selecting an address pointer of the next descriptor according to the comparison result to realize branch jump.
Optionally, the touch scanning descriptor comprises a task field for defining a scanning task sequence, an increment field for indicating that the scanning sequence number is automatically incremented and a plurality of scanning commands are continuously executed in the same scanning mode, and a sharing field for indicating sharing establishment time and/or recovery time between adjacent scanning stages.
Optionally, the task field defines a plurality of scanning tasks, and each scanning task comprises a scanning mode subfield for defining any one of the following basic scanning modes, namely, active pen line scanning, active pen column scanning, active pen noise scanning, finger line scanning, finger column scanning, finger noise scanning, finger grouping scanning, active pen uplink sending, short circuit detection scanning, a scanning sequence number subfield for defining a touch electrode grouping number corresponding to a scanning command, and a scanning behavior subfield for defining any one of the following scanning behaviors, namely, capacitance compensation value preparation, capacitance compensation value updating and scanning execution.
Optionally, the second-stage analysis includes generating a channel selection signal of the multiplexer according to the scanning task sequence, generating an integral control signal of the analog front-end circuit, controlling charge and discharge of the capacitor to achieve conversion of charge to voltage, reading compensation values from a capacitor compensation value address space and preloading the compensation values before executing a scanning command, latching the preloaded compensation values to the capacitor compensation module when the scanning task starts, and writing detection data output by an analog-to-digital converter of the analog front-end circuit into a detection data storage address space and performing statistical operation.
According to another aspect of the present invention, a touch chip integrated with the scan control device is provided.
According to the scanning control device provided by the embodiment of the invention, two-stage analysis is performed on the scanning scheme. The basic scanning mode is packaged into descriptors, and a descriptor linked list is established for different scanning strategies, so that decoupling of the scanning strategies and the hardware structure of the control signal generating circuit can be realized, and the scanning scheme can be flexibly configured. Compared with the prior art that the control signal generating circuit directly generates the fixed scanning time sequence of the whole scanning strategy, the scanning control scheme of the invention has the advantages that the control signal generating circuit can analyze the scanning task sequence only by a small amount of configuration parameters, so that the circuit structure of the control signal generating circuit can be simplified.
In a preferred embodiment, the descriptor parser parses multiple descriptors in the descriptor linked list using a finite state machine, performs downward timing using a counter to achieve slot control of a scan phase and a non-scan phase, performs upward timing to insert a predetermined delay between adjacent scan phases or wait for an external event to occur, thereby achieving complex timing control of the scan phases and achieving precise frame period and intra-frame time allocation.
In a preferred embodiment, the descriptor parser compares the statistics of the touch scan (the value of the specified address in the data address space) to a preset threshold. And selecting an address pointer of the next touch scanning descriptor according to the comparison result to realize branch control of different scanning modes, thereby dynamically adjusting the subsequent scanning modes and realizing real-time modification of the scanning scheme.
Detailed Description
The invention will be described in more detail below with reference to the accompanying drawings. Like elements are denoted by like reference numerals throughout the various figures. For clarity, the various features of the drawings are not drawn to scale. Furthermore, some well-known portions may not be shown.
Fig. 1 shows a schematic structure of a touch system 100. The touch system includes a touch panel 110, a plurality of touch chips 120, and a plurality of signal lines 101 connecting the touch panel 110 and the touch chips 120. The touch panel 110 includes a plurality of touch electrodes 102, which are typically made of a transparent conductive material (e.g., indium tin oxide, ITO), each having dimensions of about 5mm x 5mm. The signal line 101 is used for transmitting a touch driving signal and collecting a touch sensing signal.
In practical applications, the touch system 100 and the display system are integrated into a whole to form a display touch device. As the size of the display panel increases, the size of the touch panel 110 also increases, and the number of the touch electrodes 102 increases accordingly. In a large-size application scenario, such as a tablet computer or a vehicle-mounted display screen, two or more touch chips 120 are generally configured to cooperate in a cascade manner, so as to realize complete detection coverage of the entire touch panel.
The touch panel 110 supports various touch modes including a touch operation by the finger 103 and a touch operation by the active capacitive pen 104. To detect a touch operation by a finger, the touch chip 120 provides a driving signal to the touch electrode 102 and detects a capacitance change on the touch electrode 102. In order to detect the touch operation of the active capacitive stylus, the touch chip 120 transmits an uplink communication signal to the active capacitive stylus 104 through the touch electrode 102, and the signal is encoded by using a direct sequence spread spectrum (DSSS, direct Sequence Spread Spectrum) technology, so as to enhance the anti-interference capability and the communication reliability. After receiving the uplink signal, the active capacitive pen 104 returns a downlink signal through the touch panel 110 within a specific time window according to a preset protocol, where the downlink signal adopts a Binary Phase Shift Keying (BPSK) or Quadrature Phase Shift Keying (QPSK) modulation mode to transmit data such as a pressure sensing value, a button state, and a battery state. After receiving the downlink signal, an Analog Front End (AFE) of the touch chip 120 extracts the content of the data packet through the demodulation module, and transmits the parsed data to the microprocessor (MCU, microcontroller Unit) for subsequent processing.
Fig. 2a to 2c show a scanning strategy of a hybrid touch detection of a finger and an active capacitive pen in a touch system.
In the touch system of the hybrid touch detection, different active pen protocols have differences in time slot requirements of uplink and downlink signals, and finger touch scanning needs to be dynamically coordinated with the active pen communication time slot, and the touch chip 120 adjusts scanning time sequences in real time at different stages of the approach, contact and departure of the active pen to the touch panel 110 to avoid signal collision. For example, when the active capacitive stylus 104 is in a contact state, the touch chip 120 needs to preferentially ensure a receiving window of a downlink signal, and meanwhile, capacitive detection of finger touch is completed in a non-communication period by using a time division multiplexing (TDM, time Division Multiplexing) technology, so that synchronous execution of touch positioning and active stylus communication is realized.
However, due to significant differences in hardware architecture, communication protocol and parameter configuration of different manufacturers, the touch chip needs to cope with diversified scan policy requirements. For example, the uplink communication time slot of the active pen may generate millisecond-level time offset due to different protocol versions, the electrode driving frequency of the finger scanning needs to be dynamically adjusted according to the panel material characteristics, and the sampling period of the noise detection needs to be matched with the environmental interference characteristics. These differences make it difficult for conventional fixed timing scan control schemes to meet compatibility requirements in complex scenarios.
The inventors have noted that in a touch system, different scanning strategies are combined from a plurality of scanning phases, each of which can be defined as a respective basic scanning pattern.
Referring to fig. 2a, in the detection state of the touch panel, each scan frame includes a continuous pen up transmission stage, a finger scan stage, a pen down detection stage, a noise detection stage, and a blank stage. The scanning strategy is used for detecting whether touch operation exists, and the purpose of saving electricity can be achieved because a blank stage exists in the scanning frame.
Referring to fig. 2b, in the state of detecting the hand scanning and pen suspension, each scanning frame includes a repeated pen up transmission phase, finger scanning phase, and pen down detection phase. The scanning frame time allocation in the scanning strategy is the priority of the finger scanning stage, namely, the time slot of the finger scanning stage is longer than the time slots of the pen uplink transmission stage and the pen downlink detection stage. The scanning strategy can ensure the high response speed requirement of finger touch control and detect whether the touch control operation of the active capacitance pen exists.
Referring to fig. 2c, in a state that hand scanning and pen contact are detected, each scanning frame includes a repeated pen up transmission stage, finger scanning stage, pen down detection stage, and a noise detection stage is inserted in the scanning frame. The scanning frame time allocation in the scanning main strategy is still the priority of the finger scanning stage, but the time slot of the pen downlink detection stage is prolonged relative to the pen suspension state, and the time slot of the finger scanning stage is correspondingly reduced. The scanning strategy can meet the response speed requirements of finger touch and active capacitive pen touch.
The inventor proposes that the basic scanning mode is packaged into descriptors, and a descriptor linked list is established for different scanning strategies, so that decoupling of the hardware structure of the scanning strategies and the control signal generating circuit can be realized, and the scanning scheme can be flexibly configured. Further, two-stage analysis is performed on the descriptor linked list, for example, a finite state machine is used for performing a first-stage analysis on the time control descriptor, so that time slot control of a scanning stage and a non-scanning stage is realized, a control signal generating circuit is used for performing a second-stage analysis, a scanning control signal is generated, accurate frame period and intra-frame time allocation can be realized, and the circuit structure of the control signal generating circuit is simplified.
Fig. 3 shows a schematic circuit diagram of a capacitance detection channel in a touch system. The capacitance detection channel 10 includes a multiplexer MUX (Multiplexer), an Analog front end circuit AFE, and an Analog-to-digital converter ADC (Analog-to-Digital Converter).
Referring to fig. 1 and 3, the equivalent circuit of the plurality of touch electrodes 102 in the touch panel 110 is represented as a capacitance Cf or Cp, which represents a capacitance change caused by a finger touch and an inherent capacitance of the touch panel, respectively.
The plurality of touch electrodes 102 are connected to a multiplexer MUX in the touch chip 120 via the plurality of signal lines 101. The multiplexer MUX includes a plurality of single pole, triple throw switches S1 for selectively connecting the touch electrode 102 to the analog front end circuit AFE, or for receiving the stimulus signal Vstim, or to ground, depending on the channel select signal. The single-pole three-throw switch S1 can be realized by a MOS tube, and the MOS tube is used as a switching tube to realize on and off control.
In the self-capacitance detection scheme, the plurality of touch electrodes 102 are scanned individually, and whether a finger is approaching is determined by measuring the capacitance change to ground. The multiplexer MUX connects the selected touch electrode 102 to the analog front-end circuit AFE, grounds the unselected touch electrodes 102 or receives the excitation signal Vstim.
In the mutual capacitance detection scheme, a plurality of touch electrodes 102 are arranged in pairs in such a manner that the transmitting electrode Tx and the receiving electrode Rx. The multiplexer MUX supplies the excitation signal Vstim to the selected transmit electrode, connects the selected receive electrode to the analog front-end circuit AFE, and grounds the unselected transmit and receive electrodes.
The analog front-end circuit AFE includes a capacitance compensation module 11, an operational amplifier 12, a buffer 13, a feedback capacitance Cfb, and a second switch S2 and a third switch S3. The second switch S2 is connected to the inverting input terminal of the operational amplifier 12, and is configured to provide the touch electrode signal selected by the multiplexer MUX to the inverting input terminal of the operational amplifier 12. The capacitance compensation module 11 receives the capacitance compensation value, and is configured to generate a corresponding capacitance compensation signal according to the position of the selected touch electrode, so as to compensate the parasitic capacitance of the touch electrode at different positions. The feedback capacitor Cfb and the third switch S3 are connected in parallel between the inverting input terminal and the output terminal of the operational amplifier 12.
The analog front-end circuit AFE receives an integration control signal for controlling the switching states of the second switch S2 and the third switch S3. The charge and discharge control of the capacitor Cfb is realized, the charge on the capacitor is converted into voltage, and the measurement of the capacitor is realized through the change of the measured voltage.
In the self-capacitance detection scheme, the non-inverting input of the operational amplifier 12 is grounded. The touch electrode signal is directly integrated to generate the detection signal Vout. In the mutual capacitance detection scheme, the non-inverting input of operational amplifier 12 receives the stimulus signal Vstim. The differential signal of the touch electrode signal and the driving signal Vstim is integrated to generate the detection signal Vout.
The buffer 13 performs impedance matching and signal enhancement processing on the detection signal Vout to ensure the integrity of the analog signal during transmission. The buffer is for example a unity gain amplifying structure with its input connected to the output of the operational amplifier 12 and its output connected to the input of the analog to digital converter ADC. The buffer 13 can effectively isolate the load effect on the front-end integrating circuit when the subsequent analog-digital converter ADC is sampled, and avoid signal distortion caused by mismatching of the internal resistance of a signal source and the input impedance of the analog-digital converter ADC.
The analog-to-digital converter ADC performs analog-to-digital conversion on the detection signal Vout to obtain detection data.
In the above capacitive detection channel, a time-division multiplexing manner is adopted, so that the front-end circuit AFE and the analog-to-digital converter ADC can be shared by the plurality of touch electrodes 102.
Fig. 4 shows a schematic block diagram of a scanning control device according to a first embodiment of the invention. The scan control device 20 includes a microprocessor 21, a descriptor parser 22, a control signal generation circuit 23, a configuration module 24, and a data address space 25, which are connected via a high-performance system bus (e.g., an AHB bus of ARM corporation).
A descriptor linked list address space, a capacitance offset address space, and a detection data storage address space are allocated in the data address space 25.
In the descriptor linked list address space, the memory structure of the descriptor linked list address space adopts a word-aligned linear address layout. A list of compensation values associated with the touch electrode locations is stored in a capacitance compensation value address space. The detection data obtained by the analog-to-digital converter ADC in the capacitance detection channel is stored in the detection data storage address space.
The memory structure of the descriptor consists of 1 to 4 consecutive 32-bit words. The first Word (Word 0) contains a 4-bit encoded field (bits 31 to 28) for identifying the descriptor type, e.g. TIMER, WAITN, SCAN etc., where bit 27 is set to the interrupt enable flag bit (I) and when this bit is high, the descriptor parser will trigger an MCU Interrupt Request (IRQ) by a hardware signal after completion of the descriptor corresponding operation. The last word (WordN) stores the physical address pointer of the next descriptor, which points to the first word address of another descriptor, forming a chained structure.
In the scan control device 20, the microprocessor 21 selects a scan scheme according to the touch state of the touch panel. For example, one of the scanning schemes shown in fig. 2a, 2b and 2 c.
The descriptor parser 22 obtains a corresponding descriptor linked list according to a scanning scheme, performs a first level parsing of the scanning scheme, implements slot control of a scanning stage and a non-scanning stage according to a time control descriptor, and parses a touch scanning descriptor into a scanning task sequence.
Specifically, the descriptor parser 22 includes a control module, a count-up module, a count-down module, a comparison logic module, a decoding module, and a buffer management module.
In the descriptor parser 22, the control module parses the descriptor linked list to generate a scan task sequence. The descriptor linked list includes a plurality of descriptors formed by address pointers connected in series, the plurality of descriptors includes any one of a time control descriptor (timing descriptor TIMER, delay descriptor WAITN, wait descriptor WAITX), a flow control descriptor (termination descriptor TMNT, compare descriptor COMP) and a touch SCAN descriptor SCAN, wherein the touch SCAN descriptor is used for defining a SCAN task sequence, the time control descriptor is used for controlling a time slot (time slot) of a SCAN stage and a non-SCAN stage, and the flow control descriptor is used for executing branch control of different SCAN modes.
The down-counting module constructs a tick clock domain based on a stable clock source like an external quartz crystal oscillator, a phase-locked loop, an oscillator and the like, and realizes the accurate time limit length defined by a timing descriptor TIMER in a down-counting mode. The up-count module builds the tick clock domain based on the stable clock source described above, using up-count to achieve the precise delay time defined by delay descriptor WAITN and the precise latency defined by latency descriptor WAITX.
The comparison logic module accesses the designated address in the detection data address space through the AHB bus, carries out numerical operation on the numerical value of the read detection data and a preset threshold value in the descriptor, and selectively jumps to the linked list branch address according to the comparison result.
The decoding module identifies the descriptor type by analyzing the 31-28 bit coding field of the first word of the descriptor, extracts the interrupt enable flag bit I, and triggers the MCU interrupt request through a hardware signal when the bit is valid and the current descriptor is executed.
The buffer management module is responsible for data interaction between the AHB bus and the FIFO buffer and supports register configuration updating and data migration operation.
The control signal generating circuit 23 parses the scan task sequence to generate scan control signals of the capacitance detection channels, including the channel selection signal of the multiplexer MUX shown in fig. 3, the capacitance compensation value of the analog front-end circuit AFE, and the integration control signal.
Specifically, the control signal generating circuit 23 includes a channel selection signal generating module, an integral control signal generating module, a capacitance compensation preparing module, a capacitance compensation updating module, and a data statistics storing module.
The channel selection signal generating module generates a channel selection signal of the multiplexer MUX according to the scan task sequence, and the channel selection signal is divided into two kinds, namely a sel_rx signal and a sel_stim signal. The sel_rx signal is used to select the receive electrode and the sel_stim signal is used to select the transmit electrode to apply the stimulus signal Vstim.
The integration control signal generation module generates an integration control signal of the analog front end circuit AFE according to the scanning task sequence, and the integration control signal is used for controlling the time sequence of the second switch S2 and the third switch S3. The integrating circuit is formed by the operational amplifier 12 and the feedback capacitor Cfb by closing S2 and opening S3 in the integrating stage, and the feedback capacitor Cfb is discharged by opening S2 and closing S3 in the resetting stage. The charge-to-voltage conversion process is achieved by charging and discharging the capacitor Cfb.
The capacitance compensation preparation module reads compensation parameters of the corresponding touch electrode from a capacitance compensation value address space according to the capacitance compensation value address in the descriptor, and preloads the compensation parameters to the compensation register through capacitance compensation preparation operation. When the scanning task starts, the capacitance compensation updating module latches the preloaded compensation value to the capacitance compensation module 11, and the parasitic capacitance difference of the touch electrode is eliminated by dynamically adjusting the equivalent value of the feedback capacitance Cfb.
The data statistics storage module receives detection data output by the analog-to-digital converter ADC, writes the detection data into a detection data storage address space according to a storage address specified by the descriptor, and calculates state parameters of the touch panel, including the maximum value, the average value and the noise intensity of the capacitance value, through the data statistics storage module.
The configuration module 24 is used for setting configuration parameters of the control signal generating circuit 23, such as adjusting timing parameters of the integrated control signal, modifying mapping relation of the capacitance compensation value address space, and configuring sampling window length of the data statistics storage module. Due to the dynamic configuration capability of the configuration module 24 to the control signal generating circuit 23, the scan control device 20 can load parameter sets matched with the active pen protocol and adapt to the physical characteristic differences of different touch panels.
Further, the configuration module 24 obtains the status parameters of the touch panel from the data statistics storage module of the control signal generating circuit 23, and the microprocessor 21 analyzes the status parameters of the touch panel obtained from the configuration module 24 through the AHB bus to obtain the touch status of the touch panel. In addition, the descriptor parser 22 typically also obtains state parameters from the configuration module 24 via the AHB bus when executing the subsequent comparison descriptor COMP.
Fig. 5 shows a schematic circuit diagram of a descriptor parser in the scan control apparatus shown in fig. 4. The descriptor parser 22 includes a finite state machine FSM (Finite State Machine) and a Counter CNT (Counter). The finite state machine FSM is located, for example, in the control module for sequentially reading and parsing the descriptor linked list. The counter CNT includes two sets of counters, one set is a counter for counting down, and counting down is implemented by counting down, and the other set is a counter for counting up, and counting up is implemented by counting up.
The down-counting module constructs a tick clock domain based on the stable clock source, comprises a down-counting counter (TICK DN CNT), and realizes the accurate time limit length defined by the timing descriptor TIMER in a down-counting mode. The up-count module is based on a tick clock domain built by an external crystal oscillator, and comprises a counter (tick up cnt) for counting up in order to achieve the precise delay defined by the delay descriptor WAITN and the precise wait defined by the wait descriptor WAITX.
In fig. 5, a counter for counting down is taken as an example. The timing descriptor TIMER uses a counter (TICK DN CNT) that counts down, and the longest count can reach 0x7ff_ffff cycles. The timing descriptor TIMER is used to give a specified time (the time counted down from the initial value to 0). The finite state machine FSM parses the timing descriptor TIMER after receiving the timing descriptor TIMER, loads an initial value corresponding to the load data in the timing descriptor as long as the down-count counter (TICK DN CNT) is idle, returns a "load complete" signal, and starts down-counting from the initial value. And each time after loading the initial value is completed, the descriptor parser may perform the next descriptor parsing. However, after the initial value is loaded and the count is started, the new initial value cannot be continuously loaded unless the count is zero, and the next initial value is not reloaded until the count value reaches 0. That is, the descriptor parser cannot perform the next counting process until the current counting process is completed, but may perform other types of tasks characterized by descriptors, such as scanning, branching (or copying), etc. Then the count command corresponding to the next timing descriptor TIMER can only wait for the end of the last count command and load the next initial value when the count down to 0. That is, after the initial value corresponding to the timing descriptor TIMER is loaded by the counter counting down, the descriptor parser can perform the next descriptor parsing. If the count value is not zero, reloading is not performed, so that the descriptor parser needs to wait for the countdown of the countdown to finish, and the next descriptor can be parsed after reloading, thereby realizing time slot control and ensuring the continuity and compactness of the countdown.
Referring to fig. 6a, if the next timing descriptor TIMER has been parsed (the t_timer_ rld _req signal is received) before the counting of the last timing descriptor TIMER has ended, the descriptor parser needs to wait for the last counter to count down to 0, then reload a new initial value, return the t_timer_ rld _ack signal (load complete signal), and start a new round of counting and descriptor parsing. During the loading of the whole counter, the preparation of data is performed by the tick clock domain, TICK DN CNT can perform one-down or one-up loading of the count value at each tick clock edge, so that the time slot length can be precisely controlled by using the timing descriptor. Referring to FIG. 6b, in the case of an exception, it may occur that TICK DN CNT, when performing a countdown to 0, still does not receive the t_timer_ rld _req signal sent from the ahb clock domain after the synchronization logic processing, in which case a flag bit of "TIMER run over" needs to be set, which indicates that errors occur in parallel processing and executing other descriptors by the descriptor parser within a time frame defined by the timing descriptor TIMER, resulting in tasks not being completed within a specified time.
Both the latency descriptor WAITN and the wait descriptor WAITX use up-count counters (tick up cnt), the longest count can reach 0xff_ffff cycles, since both commands call the same tick up cnt, they can only be executed in sequence. Delay descriptor WAITN is used to insert a predetermined delay between adjacent scan phases, which is achieved by counting up. Wait descriptor WAITX also implements wait by counting up and waits for the triggering of an external event to stop counting. Because the descriptor parser is operating in ahb clock domains of the system bus and the tick up cnt is operating in the tick clock domain, the t_ waitn _req/t_ waitx _req signal sent from ahb clock domain to the tick clock domain, and the h_ waitn _ack/h_ waitx _ack/h_ waitx _tout signal sent from the tick clock domain to ahb clock domain, all require synchronous logic for signal synchronization of the asynchronous clock domain, which results in both descriptors WAITN and WAITX being controlled for slightly longer than specified.
Referring to fig. 7a, the up-count counter tick up cnt completes the delay time defined by the delay descriptor WAITN according to two signals t_ waitn _req and t_ waitn _ack. That is, after the delay descriptor WAITN is parsed, the counter that counts up first obtains the first preset value corresponding to the load data in the delay descriptor WAITN, counts up from zero until the first preset value is reached, so as to complete the delay, returns a "delay complete" signal, corresponds to the t_ waitn _ack signal, and then the descriptor parser executes the next descriptor parsing. Similarly, after the analysis of the wait descriptor WAITX is completed, the t_ waitx _req signal is valid, and then the up-counting is started, the up-counting counter firstly obtains a second preset value corresponding to the load data of WAITX in the wait descriptor, and the up-counting is started from zero, that is, the count value is accumulated from 0 to the second preset value, so as to realize up-timing. In this process, if the t_ext_evt_sync signal is received, it indicates that a specified external event is received, that is, in the process of counting up from zero, the up-counting is terminated in advance when the trigger of the external event is received, and the t_ waitx _ack signal is returned, that is, a "waiting for success" signal is returned, and the next descriptor is continued to be parsed. Referring to fig. 7b, if the up-count counter does not receive the t_ext_evt_sync signal of the tick clock domain for the whole waiting time range from zero to the second preset value, indicating that no trigger for an external event has been received, the t_ waitx _tout signal is returned, i.e. the "wait timeout" signal is returned, an erroneous flag is recorded, and the descriptor parser will proceed with the parsing of the next descriptor. Note that here t_ waitx _tout/t_ waitx _ack is mutually exclusive, can only be generated by one signal, and is synchronized to the ahb clock domain, returning the waiting result to the descriptor parser.
The two descriptors of up-counting are performed sequentially without causing a conflict when using up-counting counters. The first preset value and the second preset value are set according to actual requirements and can be the same or different.
Fig. 8 shows a schematic data structure of a time control descriptor.
In this example, the time control descriptors include a timing descriptor TIMER, a delay descriptor WAITN, and a wait descriptor WAITX.
The timing descriptor TIMER consists of 2 words, and sequentially includes a 4-bit descriptor type field CMD, a 1-bit interrupt enable flag bit I, a 27-bit valid data field payoad, and an address field ptr_ next (pointer next) of a last word (WordN).
The initial value of the count down is stored in the valid data field payoad of the timing descriptor TIMER.
The latency descriptor WAITN and the wait descriptor WAITX are each composed of 2 words, and include, in order, a 4-bit descriptor type field CMD, a 1-bit interrupt enable flag I, a 3-bit control option field cmd_opt, a 24-bit valid data field payoad, and an address field ptr_ next (pointer next) of the last word (WordN).
The valid data field payoad of the delay descriptor WAITN stores a count value corresponding to a predetermined delay, and the valid data field payoad of the wait descriptor WAITX stores a preset value of the count up.
Fig. 9 shows a schematic data structure of a flow control descriptor.
In this example, the flow control descriptors include a termination descriptor TMNT and a comparison descriptor COMP. The termination descriptor TMNT is used to instruct the descriptor parser 22 to stop parsing and trigger an interrupt. The comparison descriptor COMP is used for comparing the value of the specified address in the data address space with a preset threshold value, and selecting an address pointer of the next descriptor according to the comparison result to realize branch jump.
The termination descriptor TMNT consists of 1 word, and sequentially includes a 4-bit descriptor type field CMD, a 1-bit interrupt enable flag bit I, and a 27-bit reserved field Rsvd.
Termination descriptor TMNT indicates that the descriptor parser is required to stop working, typically with the interrupt enable flag bit I set. When this descriptor is executed, an interrupt request is issued to the microprocessor 21.
The comparison descriptor COMP consists of 4 words, comprising in order a 4-bit descriptor type field CMD, a 1-bit interrupt enable flag bit I, a 3-bit reserved field Rsvd, a 24-bit a address field, a 32-bit first descriptor physical address pointer, a 32-bit B data field, and a 32-bit second descriptor physical address pointer.
When the descriptor parser 22 parses the comparison descriptor COMP, the data address space is accessed according to the a address field to obtain the value of a, the value of B is directly obtained from the B data field, and then the a and the B are compared, where B is the above mentioned preset threshold. In case a is smaller than B, the first descriptor physical address pointer is selected as the next descriptor physical address pointer. And in the case that A is greater than or equal to B, selecting the second descriptor physical address pointer as the next descriptor physical address pointer. Thus, the compare descriptor COMP may implement branching and jumping functions.
Fig. 10 shows a schematic data structure of a touch scan descriptor.
In this example, the touch SCAN descriptor SCAN is composed of 3 words, including, in order, a 4-bit descriptor type field CMD, a 1-bit interrupt enable flag bit I, a 3-bit control option field cmd_opt, a 2-bit shared field SHARE, a 2-bit reserved field Rsvd, a 4-bit increment field INC, a 3-bit reserved field Rsvd, a 13-bit first task field job_1st, a 3-bit reserved field Rsvd, a 13-bit third task field job_3RD, a 3-bit reserved field Rsvd, a 13-bit second task field job_2ND, and an address field ptr_ next (pointer next) of a last word (WordN) for storing a next descriptor physical address pointer.
1) Task field JOB in touch SCAN descriptor SCAN
The task fields of the touch SCAN descriptor SCAN are used for defining a SCAN task sequence, and include a first task field job_1st, a second task field job_2nd, and a third task field job_3rd. Each task field comprises a plurality of scanning tasks, and each scanning task comprises a plurality of subfields, namely a scanning mode subfield CMD_SC, a scanning behavior subfield CMD_EXE and a scanning sequence number subfield CMD_ID. The touch SCAN descriptor SCAN is used for defining a SCAN task sequence of a SCAN command, and the SCAN task sequence may include at least one task among the first to third tasks according to contents of three task fields.
Among the subfields of the task field, the scan mode subfield cmd_sc is used to define a basic scan mode of one scan stage in a scan frame. In the touch system supporting the hybrid touch mode, a scanning mode subfield cmd_sc defines 9 basic scanning modes in total, namely an active pen line scanning PR, an active pen line scanning PC, an active pen noise scanning NP, a finger line scanning FR, a finger line scanning FC, a finger noise scanning NF, a finger group scanning GS, an active pen uplink transmission UP, and a short circuit detection scanning SD.
In the subfields of the task fields, the scan sequence number subfield cmd_id is used to define a touch electrode packet number corresponding to a scan command in the scan stage. Among a plurality of scan tasks of one scan command, different group numbers may be assigned to different scan tasks. The scan sequence number subfield cmd_id is used to set real-time scan parameters of the control signal generating circuit, including a channel select signal (sel_rx signal/sel_stim signal), a read address of the capacitance compensation value address space, and a write address of the detection data storage space.
In the subfields of the task fields described above, the scan behavior subfield cmd_exe is used to define the scan behavior of a scan command in the scan phase. A scan command is a sequence of up to 3 scan tasks, in each of which a scan action is performed, including capacitance compensation value preparation SFT (cneg shift), capacitance compensation value update LAT (cneg latch), scan execution EXE (scan_exe).
Referring to fig. 3 and 4, the capacitance compensation update module in the control signal generating circuit 23 latches the preloaded compensation value into the capacitance compensation module 11 of the capacitance detection channel 10 at the start of a scan job before each scan command is executed. During execution of each scan command, the channel selection signal generated by the control signal generating circuit 23 is used to control switching actions of the second switch S2 and the third switch S3 in the multiplexer MUX, each touch electrode 102 is selectively connected to the analog front end circuit AFE while the discharging process is completed, then the integration control signal generated by the control signal generating circuit 23 is used to control switching actions in the analog front end circuit AFE to control integration and reset timing, and at the same time, the analog-to-digital converter ADC of the capacitance detection channel 10 converts the detection signal into detection data, and finally stores the detection data into the detection data storage address space. After the capacitance compensation value is updated, preparation of the capacitance compensation value required for the next scan can be performed.
In the case where the SCAN mode subfield cmd_sc of the touch SCAN descriptor SCAN is the finger column SCAN FC, the following SCAN command may be issued to the control signal generating circuit simultaneously in the third finger column SCAN:
the first task is that the finger column scans for the third capacitive offset update cmd_sc=fc, cmd_id=3, cmd_exe=lat.
The second task is that the third scan of the finger column scan is performed with cmd_sc=fc, cmd_id=3, cmd_exe=exe.
The third task is that the finger column scans for the fourth capacitive compensation value preparation cmd_sc=fc, cmd_id=4, cmd_exe=sft.
Referring to fig. 11, a SCAN mode cmd_sc of the touch SCAN descriptor SCAN is a finger column SCAN FC. The descriptor parser 22 parses a descriptor linked list of touch descriptors to generate successive scan commands. Each scan command is used for driving the touch electrode 102 of a corresponding column to perform finger column scanning, and the position scanning of the whole screen can be realized by repeating the finger column scanning for a plurality of times.
In fig. 11, the scan control signals include channel selection signals corresponding to sel_rx <0:4> and sel_stim <0:4> in the drawing, and a channel ground signal sel_vcom for setting the switch states of the plurality of single-pole three-throw switches S1 in the multiplexer MUX, and the column-by-column selection touch electrode 102 is connected to the analog front-end circuit AFE. The scan control signal also includes a stimulus signal Vstim and a detection data adc_dat. Taking the touch panel including 5 rows of touch electrodes 102 as an example, a descriptor linked list formed by 5 touch descriptors is adopted, and capacitance detection signals of the 5 rows of touch electrodes 102 can be respectively obtained in finger touch scanning time, so that the position of a finger on the touch panel is obtained.
Referring to fig. 12, a SCAN mode cmd_sc of the touch SCAN descriptor SCAN is a finger group SCAN GS. The descriptor parser 22 parses a descriptor linked list of touch descriptors to generate successive scan commands. Each scan command is used to connect the columns of touch electrodes 102 together in a capacitive sense channel to form a plurality of groupings. The multi-column touch electrode 102 is driven to conduct finger grouping scanning, and the position scanning of the whole screen can be achieved through repeating the finger grouping scanning for a plurality of times or only once. The grouping scanning can be adopted to achieve acquisition of capacitance change values on a screen in a short time, whether a finger is in contact with the touch panel is simply confirmed, and specific finger positions cannot be resolved in detail.
In fig. 12, the scan control signals include channel selection signals corresponding to sel_rx <0:4> and sel_stim <0:4> in the drawing, and channel ground signals sel_vcom for setting the switch states of the plurality of single-pole three-throw switches S1 in the multiplexer MUX, and commonly connect the multi-column touch electrodes 102 to the analog front end circuit AFE. The scan control signal also includes a stimulus signal Vstim and a detection data adc_dat. Taking the touch panel including 5 rows of touch electrodes 102 as an example, a descriptor linked list formed by 1 touch descriptor is adopted, and capacitance detection signals of the 5 rows of touch electrodes 102 can be obtained in a grouping touch scanning time, so that a judgment result of whether fingers touch the touch panel is obtained.
2) Incremental field INC in touch SCAN descriptor SCAN
According to the application condition of the control signal generating circuit, an increment field INC is arranged in the touch SCAN descriptor SCAN for instructing the control signal generating circuit 23 to automatically increment the SCAN sequence number, and multiple SCAN commands can be continuously executed according to the same SCAN mode by adopting a single touch SCAN descriptor SCAN. In the case where the SCAN mode subfield cmd_sc of the touch SCAN descriptor SCAN is the finger column SCAN FC and the SCAN behavior subfield cmd_exe is the SCAN execution EXE, the increment field inc=4 is set. After receiving the single touch SCAN descriptor SCAN, the control signal generating circuit 23 automatically accumulates the SCAN sequence number subfield cmd_id and automatically loads a new capacitance compensation value to generate a SCAN control signal for 5 SCANs, which is equivalent to sequentially executing the following 5 SCAN commands.
0. Capacitance compensation value update+scan execution of finger column scan 0+capacitance compensation value preparation of finger column scan 1;
1. capacitance compensation value update + scan execution of finger column scan 1 + capacitance compensation value preparation of finger column scan 2;
2. Capacitance compensation value update + scan execution of finger column scan 2 + capacitance compensation value preparation of finger column scan 3;
3. capacitance compensation value update + scan execution of finger column scan 3 + capacitance compensation value preparation of finger column scan 4;
4. capacitance compensation value update + scan execution of finger column scan 4 + capacitance compensation value preparation of finger column scan 0.
By adopting the increment field INC in the touch scanning descriptor SCAN to analyze the single touch scanning descriptor to realize a column-by-column scanning scheme, the maintenance work of the touch scanning descriptor SCAN can be greatly simplified, and the preparation time and the ending time required by the control signal generating circuit to respectively execute a plurality of scanning commands can be saved.
3) Shared field in touch SCAN descriptor SCAN
Referring to fig. 11 and 12, in the waveform of the scan control signal, a setup time is required for the start of any one scan stage alone, in addition to a scan time, and a recovery time is required for the end.
However, when a plurality of scan phases of different scan patterns are arranged in succession, in some cases, setup time corresponding to discharge preparation of the scan and recovery time at the end may be saved, so a shared field SHARE is added to indicate sharing of setup time and/or recovery time between adjacent scan phases. The first scan phase cannot omit the setup time and the last scan phase cannot omit the recovery time. Then the SCAN control logic can get flexible SCAN command combinations under the combination of different touch SCAN descriptors SCAN.
As shown in fig. 13, taking the combination of the finger group scan GS and the finger column scan FC as an example, using share=first/AMONG/LAST in the descriptor linked list combining the two scan phases can flexibly save the setup time and recovery time of the adjacent scan phases. Specifically, the recovery time in the finger grouping scanning phase and the setup time in the finger column scanning phase are saved relative to fig. 11 and 12, and the two scanning phases share the same setup time and the same recovery time.
FIG. 14 illustrates a dynamic data structure of descriptor links.
As shown in fig. 14, the first touch SCAN description Fu Chenwei is a first touch SCAN descriptor SCAN, and the SCAN mode subfield cmd_sc in the first touch SCAN descriptor SCAN is the finger grouping SCAN GS, whose address pointer points to the comparison descriptor COMP. After the completion of the execution of the SCAN command of the first touch SCAN descriptor SCAN, the descriptor parser 22 compares the maximum value (corresponding to the numerical value of the specified address in the data address space) in the statistical result of the group touch SCAN with the finger detection threshold (corresponding to the preset threshold). And selecting an address pointer of the next touch scanning descriptor SCAN according to the comparison result to realize branch control of different scanning modes, thereby dynamically adjusting the subsequent scanning modes.
And if the maximum value in the statistics results of the previous group touch scanning is found to be larger than the finger detection threshold value, determining that the state of the touch panel is finger touch. The next touch SCAN descriptor is the second touch SCAN descriptor SCAN. The SCAN mode subfield cmd_sc in the second touch SCAN descriptor SCAN is the finger column SCAN FC, whose address pointer points to the third touch SCAN descriptor SCAN. The scanning mode subfield cmd_sc in the third touch SCAN descriptor SCAN is the finger group SCAN GS. The descriptor chain formed by the first to third touch scanning descriptors defines a scanning strategy of finger grouping scanning GS+finger column scanning FC+finger grouping scanning GS, wherein the rough position of the finger is acquired by adopting the finger grouping scanning GS, and the accurate position of the finger is acquired by adopting the finger column scanning FC.
And if the maximum value in the statistics results of the previous group touch scanning is found to be smaller than the finger detection threshold value, determining that the state of the touch panel is a non-touch state. The next touch SCAN descriptor is a fourth touch SCAN descriptor SCAN. The SCAN mode subfield cmd_sc in the fourth touch SCAN descriptor SCAN is the finger noise SCAN NF. The descriptor chain formed by the first touch scanning descriptor and the fourth touch scanning descriptor defines a scanning strategy of finger grouping scanning GS+finger noise scanning NF, wherein whether the state of the touch panel is a touch state is detected rapidly by adopting the finger grouping scanning GS, and the finger noise scanning NF obtains environmental noise baseline data to optimize the subsequent scanning strategy.
Fig. 15 shows a flowchart of a touch panel scan control method according to a second embodiment of the present invention.
In step S11, a scanning scheme is selected according to the touch state of the touch panel.
In this step, the microprocessor detects the current state of the touch panel, such as finger touch, active pen suspension, active pen contact or noise level, and dynamically selects one of a plurality of preset scanning schemes according to the current state, and determines the start address of the corresponding descriptor linked list.
In step S12, a descriptor linked list is obtained according to a scanning scheme, and a first-stage parsing is performed on the descriptor linked list to generate a scanning task sequence.
The descriptor parser obtains a descriptor linked list, and sequentially reads each descriptor composed of one to four 32-bit words through an address pointer. The 4-bit descriptor type field in the first word indicates the category of the descriptor, if the descriptor is a time control descriptor, the counter which counts downwards is utilized to decrement to zero from an initial value corresponding to load data so as to precisely control the time slot of the current scanning stage, or the counter which counts upwards is utilized to increment to a set count value so as to insert fixed delay between adjacent stages, or the counter which counts upwards from zero to a preset value corresponding to the load data, the trigger of an external event is waited in the counting process or the wait is finished after the counting is finished, if the descriptor is a touch control scanning descriptor, a task field is extracted, one or more scanning tasks are generated according to a scanning mode subfield, a scanning sequence number subfield and a scanning behavior subfield, the same scanning mode is continuously executed when the increment field is effective, the adjacent scanning tasks share the establishment time and/or the recovery time when the sharing field is effective, and finally all the scanning tasks after the processes are orderly arranged into a scanning task sequence, if the descriptor is controlled, the process is stopped when the descriptor is stopped, the interrupt process is triggered, or the comparison process is stopped when the descriptor is read, the comparison is completed, the comparison result is realized with the preset address space, and the comparison of the address is realized according to the comparison of the preset address space address of the descriptor.
In step S13, a second level of analysis is performed on the scan task sequence to generate a scan control signal.
The control signal generating circuit performs a second level of analysis on the scan task sequence. And generating a channel selection signal required by the multiplexer according to the scanning mode and the scanning sequence number in the scanning task. And outputting integration control signals such as starting, stopping or resetting of the analog front-end integrator according to the scanning mode and the integration duration parameter. Before the scan command is executed, the capacitance compensation preparation module reads the corresponding compensation value from the capacitance compensation value address space and preloads the compensation value. The preloaded compensation value is latched to the capacitive compensation module by the capacitive compensation update module at the beginning of the current scan session. After the analog-to-digital converter outputs the detection data, the data statistics storage module writes the detection data into the detection data storage address space and performs operations such as averaging, peak statistics and the like.
The scan control method of the present embodiment is based on the scan control device described above, so details already described in the above embodiments are not described here, but those skilled in the art may apply the working principle of the above embodiments to the scan control method of the present embodiment.
Embodiments in accordance with the present invention, as described above, are not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention and various modifications as are suited to the particular use contemplated. The invention is limited only by the claims and the full scope and equivalents thereof.