Hello,
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
Can you please post labeled scope shots of the I2C transmissions to and from the TPS65070 throughout a touch event?
Daniel,
1. Is the 12ms-around ADC conversion time normal or exceedingly too too long?
2. could you advise in more detail how should the I2C transmission scope shots be taken?
As the code suggests, the majority of the time is spent the do-while loop, and judging from the 12-ms time I estimate that several dozens of register ADCONFIG reads have been attempted before conversion bit 6 is cleared, because I measured elsewhere in the same TPS6507x driver file that each I2C register read takes on the order of 1ms. Do you see any problem here?
I expect your scope shots to show the following process from the datasheet:
• Set TSCMODE to 101 to set TSC to TSC standby, so an interrupt is generated when the screen is touched
• Set Bit AD enable = 1 to provide power to the ADC
• Set input select for the ADC in register ADCONFIG to 1110 (AD_IN14 selected)
• In register INT, set MASK TSC = 1 to unmask the interrupt on a touch of the touch screen
• Read Bit TSC INT as it will be set after the TSC has been configured. Reading clears the interrupt.
• After a touch was detected, an interrupt is generated by INT pin going LOW
• Read Bit TSC INT to clear the interrupt
• Set TSCMODE to 000 to select x-position measurement
• Start an ADC conversion by setting CONVERSION START =1; wait until END OF CONVERSION = 1
• Read register ADRESULT_1 and AD_RESULT_2
• Set TSCMODE to 001 to select y-position measurement
• Start an ADC conversion by setting CONVERSION START =1; wait until END OF CONVERSION = 1
• Read register ADRESULT_1 and AD_RESULT_2
• Set TSCMODE to 101 to set TSC to TSC standby again
Daniel,
I think you are citing page 37 of the manual. However, this paragraph also stated in the second line that it is for the case of interrupt driven measurement.
The real problem I am facing is not the choice between interrupt driven or polling. In fact, I test both and both worked correctly. The problem is with the speed of ADC conversion. Since each conversion takes roughly 12ms, for a complete measurement (pressure + X + Y) I need around 36ms, then I am limited to less than 27 measurements per second.
I want to know typically how many measurements are done per second if polling is used?
Paul
As in the datasheet, you can to enable interrupt on /INT for when a touch is detected.
The interrupt on the /INT pin only indicates a touch occurred; it is then the master I2C device's job to handle clearing the interrupt and then to read each ADC touch parameter.
Looking at scope shots of your SCL and SDA lines will help you detect where you are going wrong. I expect the whole process outlined to take 1-2ms.
There are two bits seems both applicable to detect the end of AD conversion:
I have tested with B6 with correct result; what about B5, and is there any difference between using one vs another, particularly on the response time?
And has the estimated 1-2ms time been measured on tps65070 product?
The response of the TSC was fast enough. The 12ms time was due to 1ms delays added by default in the I2C driver for each read/write, and after removing that the TSC measurements takes approximately 1ms to complete.
Could you also confirm with http://e2e.ti.com/support/power_management/pmu/f/200/p/190858/684390.aspx#684316? I want to make sure I am querying the correct bit. Because although manual p.37 and your post above suggested using
END OF CONVERSION = 1
Some driver software uses
CONVERSION START =1
instead.
I tested and both worked. But is there any difference between them?