We would like to keep SPI3 so we changed the touchscreen pins like so:
-(same) AD1 (G120 pin50) (Gadgeteer socket pin 4)
-(same) AD0 (G120 pin52) (Gadgeteer socket pin 5)
-(different not pin P1.0) P0.6 (G120 pin17) (Gadgeteer socket pin 6)
-(different not pin P1.1) P0.4 (G120 pin30) (Gadgeteer socket pin 7)
On the software side, I then used the FEZCobraII gadgeteer mainboard, and changed the socket setup routine like so:
I though I was golden, but then after some testing the touchscreen P1.0 and P1.1 stays the same …
I have debugged and I know it went over the code above with the new socket configuration.
Did I miss something ? Is there another place to change those touchscreen pins configuration ?
Thanks
Yes, The display works fine, a TE35, all pins for the LCD are identical to FezCobraII board schematic.
The touchscreen pins however(4 are necessary) , 2 of them (digital inputs) uses P1.0 and P1.1, which is also used for SPI3.
We would like to use different digital pins, P0.6 and P0.4 for example, instead of P1.0 and P1.1.
Does that make sense ?
Ok I will test it out. Going to probably try to put wifi+ethernet and select which we want to use.
Also, how hard would it be to expose the touchscreen pins configuration instead of being hardcoded ?
On a related note about the touchscreen, but it would be probably best to start a new thread: I believe the touchscreen code to detect a touch event could be improved.
Sometimes, randomly, but can be seen easily by pressing multiple times on the screen per second, we get a touchevent not on the correct position.
The position is ALWAYS too much UP and LEFT.
The theory I have for this bug is that: you must have a loop somewhere that samples the analog pins multiple times per second.
But sometimes the sample is taken while a finger is being pressed (lets say halfway pressed).
I believe that an Improvement could be made: Detect that the analog is above the threshold that ‘something is pressed’, but don’t fire the touch event yet! wait for a sample or 2 that the curve is ‘stable’ enough that the touch is fully pressed and only then fire the event at the correct position.
I already verified with an oscilloscope, and the touchscreen analog output seems to be not the problem (it seems sensitive enough).
Well yea if possible I would like to use the premium libraries like it is, and not mess with it if possible.
Could this be a feature for a next 4.2 SDK release ?
The two analog pins are pin 4 and 5 on a gadgeteer connector, and they are analog AD1 and AD0 respectively.
The two digital pins are pin 6 and 7 on the gadgeteer connector, and they are norammly P1.0 and P1.1
The problem I have is I would like to use digital pins P0.6 and P0.4 instead of P1.0 and P1.1, the two analog pins are fine.
I changed them on the Socket listing of the FezCobraII board that I recompiled, but it doesnt seem to do anything.
It still uses P1.0 and P1.1 instead of P0.6 and P0.4 for the touchscreen.