NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Sitara ADC/Touchscreen Overview

From Texas Instruments Wiki
Jump to: navigation, search

Supported Platforms[edit]

This document details information regarding the touchscreen and ADC subsystem for AM335x. For AM437x, the same concepts applies to ADC0.


Simplified Hardware Overview[edit]

This page and the below diagram knowingly excludes and simplifies the various blocks that are a part of the Touchscreen/ADC subsystem. A detailed description of the ADC/Touchscreen IP can be found in the AM335x and AM437x Technical Reference Manual. The purpose of this page is to provide a brief overview of the IP as it relates to the customer usage of the touchscreen and general purpose ADC driver.

Sitara-adcsubsystem.png

The first thing to take away from the diagram is that the ADC and resistive touchscreen subsystem is handled by a single IP block. There are also two FIFOs that can be used to store values. This will be discussed some more in the software overview section. Also the 8 ADC pins are muxed together and connected to a single Analog Front End (AFE). This means even when trying to sample multiple channels together (resistive touchscreen or ADC continuous mode) the hardware will sample each channel sequentially rather than in parallel. Therefore, the more channels being sampled at a time the longer the total sample conversion will be.

Simplified Software Overview[edit]

Sitara-touchscreenadc-drivers.png

Although the touchscreen and ADC are handled by a single block of IP three separate drivers are needed to properly support using a resistive touchscreen, general purpose ADC and synchronizing access of the IP between the two drivers.

  1. Touchscreen Driver – Handles configuration of IP based on touchscreen usage. Handles the various touch events. Passes touch coordinates pressure and touch events to higher level kernel input layer.
    • Driver Location: <kernel src>/drivers/input/touchscreen/ti_am335x_tsc.c
  2. ADC Driver – Used to handle traditional adc usage. Uses the IIO framework to support reading the ADC using one shot mode ( reading a single channel once ) and continuous mode ( read one or more channels repeatedly times).
    • Driver Location: <kernel src>/drivers/iio/adc/ti_am335x_adc.c
  3. Multi-Function Driver (MFD) – The multi-function driver is used to coordinate actions between the touchscreen and adc driver. Since both of these drivers utilize the same IP the MFD driver needs to insure that only one driver has access to the IP at a single time.
    • Driver Location: <kernel src>/drivers/mfd/ti_am335x_tscadc.c

Part of the challenge of having one IP supporting two different functionalities is that additional care must be taken to insure that adc samples requested by one driver isn’t mixed in with samples from the other driver. For example using the generic ADC driver to read channel X but then having its value being mixed in with the touchscreen driver trying to calculate the x and y coordinate will cause all sorts of problems. To avoid the above issue each driver only uses one of the two FIFOs within the ADC. FIFO0 is used only by the touchscreen driver and FIFO1 is used by the ADC driver.

Facts and Limitations[edit]

Based on the simplified software and hardware overview several limitations exist that can affect usage and performance of the driver.

  1. IRQ for touchscreen and general purpose ADC are shared so any interrupts enabled by one driver will cause the interrupt service routine (ISR) for both drivers to run if they are both enabled..
  2. Since ADC channels are muxed, the total conversion time scales based on the total amount of ADC channels being read at one time.
  3. Settings in the CTRL register like ADC_ClkDiv will affect both the ADC and touchscreen.
  4. Since the touchscreen driver uses asynchronous hardware trigger (finger/stylus), the general purpose ADC driver can be interrupted to process touch events which can delay receiving ADC results.
  5. If both of the drivers attempt to use the ADC subsystem at the same time the driver that requested access last may be delayed until the other driver has completed its operation. If the touchscreen driver ends up being delayed then pen down events may be missed. Although, unless some kind of drawing or paint application is being used these missed events are not noticed. If the ADC driver ends up being delayed then the amount of time required to get its results may increase.
  6. When using one shot mode only a single channel can be sampled at a time. An error will be given if there is any attempt to read any channel before the previous request has been completed.
  7. External hardware events can trigger an ADC conversion. However, if the resistive touchscreen is used no hardware event can be used to trigger the start of conversion for the general purpose ADC.
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Sitara ADC/Touchscreen Overview here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Sitara ADC/Touchscreen Overview here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Sitara ADC/Touchscreen Overview here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Sitara ADC/Touchscreen Overview here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Sitara ADC/Touchscreen Overview here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Sitara ADC/Touchscreen Overview here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Sitara ADC/Touchscreen Overview here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Sitara ADC/Touchscreen Overview here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Sitara ADC/Touchscreen Overview here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity