Operational Modes
12.4 Operational Modes
The sequencer is completely controlled by software and behaves accordingly to how the Step Registers
are programmed. A step is the general term for sampling a channel input. It is defined by the programmer
who decides which input values to send to the AFE (via the StepConfig register), and also how (via
StepConfig register) and when (via StepDelay register) to sample a channel input.
A step consists of these three registers:
•
StepEnable: Enables or disables the step
•
StepConfig: Controls the input values to the ADC (the reference voltages, the pull up/down transistor
biasing, which input channel to sample, differential control, HW synchronized or SW enabled,
averaging, and which FIFO group to save the data)
•
StepDelay: Controls the OpenDelay (the time between driving the AFE inputs until sending the SOC
signal to the AFE), and also controls the SampleDelay (the time for the ADC to sample the input
signal)
The sequencer supports a total of 16 programmable steps, a touchscreen Charge step, and an Idle step.
Each step consists of the three registers above (StepEnable, StepConfig, and StepDelay), except the Idle
step does not have a StepEnable bit (it must always be on), and it also does not have a StepDelay
register. Also, during the Idle and touchscreen Charge steps, the ADC does not actually sample a
channel.
Assuming all the steps are were configured as general purpose mode (no touchscreen), then the steps
would be configured as SW enabled. When the TSC_ADC_SS is first enabled, the sequencer will always
start in the Idle step and then wait for a StepEnable[n] bit to turn on. After a step is enabled, the
sequencer will start with the lowest step (1) and continue until step (16). If a step is not enabled, then
sequencer will skip to the next step. If all steps are disabled, then the sequencer will remain in the IDLE
state and continue to apply the Idle StepConfig settings.
Assuming a touchscreen-only mode (no general-purpose channels) the steps could be configured as HW
synchronized triggered (mapped to the Pen event). The sequencer would wait in the IDLE state until a HW
pen down event occurred and then begin the HW step conversions. The touchscreen Charge step occurs
after the last HW step before going back to the Idle state (the TS Charge step is needed to charge touch
screen capacitance which allows the controller to detect subsequent Pen touch events).
Assuming a mixed mode application (touchscreen and general purpose channels), the user can configure
the steps as either HW triggered (mapped to Pen event) or SW enabled. If the sequencer is in the IDLE
state and a HW pen event occurs, then the HW steps (from lowest to highest) are always scheduled first,
followed by the TS Charge step. If there is no HW event, then the SW enabled steps are scheduled
instead
If a HW event occurs while the sequencer is in the middle of scheduling the SW steps, the user can
program the scheduler to allow preemption. If the HW preempt control bit is enabled, the sequencer will
allow the current SW step to finish and then schedule the HW steps. After the last HW step and TS
Charge step are completed, the sequencer will continue from the next SW step (before the preemption
occurred). If the HW preemption is disabled, then the touch event will be ignored until the last software
step is completed; if the touch event is removed before the last software step is finished, then the touch
event will be missed.
Even if a touchscreen is not present, the user can still configure the steps to be HW-synchronized by
mapping to the HW event input signal. This HW event input signal could be driven at the SOC level from a
timer interrupt or some other IP and can be used to start a channel conversion.
When mapping is set for the input HW event signal, then the TSC_ADC_SS will wait for a rising edge
transition (from low to high) before starting. The input HW event signal is captured on the internal L4 OCP
clock domain. The HW event input signal should be held for at least 2 TSC_ADC_SS OCP clocks (L4
frequency).
An END_OF_SEQUENCE interrupt is generated after the last active step is completed before going back
to the IDLE state. The END_OF_SEQUENCE interrupt does not mean data is in the FIFO (should use the
FIFO interrupts and word count reg)
1029
SPRUH73H – October 2011 – Revised April 2013
Touchscreen Controller
Copyright © 2011–2013, Texas Instruments Incorporated