2020-03-31 05:59 PM
The data sheet says the bits allow pressure range and accuracy to be configured, but I'm not seeing how these work. The STM32 Cube example code does not offer any clues. Also in the code, either the comment or setting is not consistent.
When the datasheet says the different bits set the fractional and whole parts, I would like to know parts of what. For example, if b2,b1,b0 are set to 111, the data sheet says the fractional part is 7 and the whole part is 1. Is this 1.7? If so, 1.7 of what? I would like to configure this for my touchscreen but it's hard when I don't know what they mean. Please shed some light on this.
Thanks-
Mary
2020-03-31 07:35 PM
The z-value reading is a 15-bit number internally. It only outputs 8 of those bits. This field selects which of the 8 bits it outputs. It is a gain setting. Set it too high and the value will overflow. Set it too low and your signal may be too small to get enough resolution.
0b000 -> 8 leftmost bits are output
0b001 -> first bit is dropped
0b010 -> first 2 bits is dropped
etc..
So if the actual value is:
0b000110110111111
With a value of 0b000, you would get 0b00011011.
With a value of 0b001, you would get 0b00110110.
With a value of 0b001, you would get 0b01101101.
I would leave it on 0b000 unless you need more resolution.
2020-03-31 10:06 PM
As it's a resistive touchscreen controller, Z is determined probably by measuring resistance between the two sheets. this on the majority of practical cases does not really change that much with pressure, it may decrease somewhat with increasing the area where the two sheets touch together (i.e. when you"flatten" a pressing finger). In other words, Z is not a very useful measurement, whatever is seeing is.
This is also AFAIK an obsolete chip. Are you trying to use the 'F429 DISCO?
JW
2020-04-02 02:11 PM
Hi Mary,
here you can find a binary for the 'F429 DISCO, where you can try how the Z sensing "works" on that particular touchscreen.
Short pressing the blue "USER" button changes the TSC_FRACTION_Z value (it also changes the selected "smoothing" algorithm used in my software, but that's irrelevant here) (long pressing of the USER button goes to calibration, that requires relatively long touches on the calib points).
Note that the Z value in fact shows the measured resistance, i.e. it *decreases* with the "force" of touch. At higher TSC_FRACTION_Z values you can see the effect I've described above - using a stylus, you won't be able to achieve a dramatic change of resistance, but pressing by a finger, "flattening" it (or, more precisely, touching on a bigger area) will allow you to decrease the Z value; and touching with multiple fingers on the whole display area may allow to achieve Z=0 at the highest setting of TSC_FRACTION_Z=7.
Unfortunately, for most practical purposes, this sort of "pressure" or Z sensing is completely unusable. This is the same with all practical touchscreens I've come across - resistive, capacitive, ultrasonic, optical - principially only the force-sensing touchscreens are truly capable of pressure sensing (of course, that's the principle there :) ) but I've never seen those in the wild, only as concept/patents.
Of course, you can always mount the touchscreen/glass or the whole screen onto force sensors...
JW