Touch screen displays are common choice in many microcontroller projects. Touch capability won’t take additional space – it sits on top of LCD where you can directly interact with objects you see on screen. In order to get this working touch screen coordinates must match screen coordinates. So could be sure when you touch the point on screen you point where you want.
Touch screen is analog device. It is made of two flexible resistive sheets with gap between. When screen is touched, a connection between sheets is made and thus measurement of voltage drop is taken. Normally resistive touch screen has four wire configuration. And normally there is a specialized IC used to take measurements and send data to MCU for processing. In our case we are dealing with ADS7843 touch screen controller, but in other systems this works pretty same way.
The fact is that touch screen controller reads screen ADC values and simply passes them via SPI interface. So all you get is raw ADC readings that are not lined up with LCD coordinates. As you know LCD screens can be different resolution, different orientation, so data gathered from resistive touch screen must be scaled down to match all those circumstances. And this is done in different ways. One of the method I tried before was simple mathematical-empirical approach, when you know the ADC readings on screen edges. Then you can calculate what is ADC value per pixel size and thus calculate the coordinates using simple formula: (more…)




