Main Site Documentation

ChipworkX Developer System LCD Touch resolution is VERY poor


#1

First… I admit that I am not that familiar with LCD’s

I have used the Microsoft samples 'TouchCalibration, and ‘StylusCapture’ and the touch resolution is poor in my opinion. But then again I am not sure what is considered ‘normal’. After calibration using the Microsoft sample software the Ellipse shown on Touch down ‘bounces around’. It varies from close to the Stylus to far away?
After calibration and using the StylusCapture application I can not receive a touch on the top line of text. The Ellipse get no closer that about 0.250 inch from the top of the display. The center line of text seem OK and for the bottom line of text I can get a touch if I poke around enough times.

Maybe I drink too much Coffee and my ‘touch’ with a stylus is very poor but I have noticed that the values received on Touch Down and Touch Up vary.

My question is about saving the calibration.

When sending - Microsoft.SPOT.Touch.Touch.ActiveTouchPanel.SetCalibration(CAL_POINTS, sx, sy, cx, cy);

Should the calibration settings survive a power Down, Power UP of the board?

Another question- I found some old code for the FEZ Cobra. I assume it used the same display as my ChipworkX.
Does it?

I wanted to try the code I found but I do not want to mess up the display. I see there is a value 8 for the EMX module.
What is the correct value to use for ChipworkX?

// NOTE: This is used for EMX
lcdConfig.PixelClockDivider = 8; <<<<<< ???

Also, are the other lcdConfig.(some value) OK to use as shown in the sample code?


static void SetLCDConfigurations()
{
	Configuration.LCD.Configurations lcdConfig = new
	Configuration.LCD.Configurations();
	lcdConfig.Width = 480;
	lcdConfig.Height = 272;
	
	// Only use if needed, see documentation.
	lcdConfig.PriorityEnable = false;
	
	lcdConfig.OutputEnableIsFixed = true;
	lcdConfig.OutputEnablePolarity = true;
	lcdConfig.HorizontalSyncPolarity = false;
	lcdConfig.VerticalSyncPolarity = false;
	lcdConfig.PixelPolarity = false;
	lcdConfig.HorizontalSyncPulseWidth = 41;
	lcdConfig.HorizontalBackPorch = 2;
	lcdConfig.HorizontalFrontPorch = 2;
	lcdConfig.VerticalSyncPulseWidth = 10;
	lcdConfig.VerticalBackPorch = 2;
	lcdConfig.VerticalFrontPorch = 2;
	
	// NOTE: This is used for EMX
	lcdConfig.PixelClockDivider = 8;
	
	// Set config
	if (Configuration.LCD.Set(lcdConfig))
	{
		// New settings were saved, must reboot
		Microsoft.SPOT.Hardware.PowerState.RebootDevice(false);
	}
}

Thank you and
Have a GREAT DAY!


#2

I would suggest for config info that you look at the sample app that comes on CwX device - I think Gus pointed that to you earlier?

these are resistive touch screens, so they’re not ever going to be what I would term precision items. What type of stylus are you using? is it meant to be for something in particular?

I would expect (although I have no experience) that if your app saves calibration you should get repeatable touch events after restart.


#3

Brett

I have the ChipworkXGraphical_Demo Gus gave me the link to… (I have not changed it and I have calibrated using the Microsoft sample)
The demo is for EMX and not ChipworkX. Not sure what difference it would make, if any…

Correction: I took a quick look at the code and there ARE references to ChipworkX. I did not see anything related to calibration but then again
I only took a brief look.

The Accelerometer Demo Left paddle move very slowly and strongly favors the the top of the screen. Demo does not exit on a screen touch.
The Image buttons. Less than ideal as far as Touch.

If I press the Clock button the selection goes to the bottom image (Accelerator)

I have not looked at the code for the Graphic application. I’ll see if there is anything related to calibration in there.

As to the ‘stylus’ it is one I have from my Wacom Bamboo drawing tablet. I have tried other things and all about the same.

I do not expect perfect precision but I would like it ‘close’ and repeatable!

By the way. I am using a Auxillary power supply 12VDC at 2Amp to power the system board.


#4

bamboo is an active digitiser device, so its not a resistive touch stylus and is possibly part of your issue. I think one of the best options is an old PDA stylus, if you have one, since all early PDA/smartphones used resistive touchscreens.


#5

Brett

I found a old Palm Pilot stylus and it made no difference. Maybe that is a good thing
because it rolled off my desk and the point broke off… Non replaceable point. I drilled it out and
the material appears to be nonconductive (The pen body is metal). Just old black plastic?

I did some additional testing and I am receiving Touch Down events when I release the stylus from the LCD surface.

Would you happen to know what the Configuration.LCD.Configurations settings should be
for ChipworkX?

Thanks for your reply!


#6

I use wooden skewers that are used for cooking as a stylus.


#7

Mike

Strange you should mention about the skewers.

I was going to update this post with what I found out.

To do the calibration I had to modify the code for the OnTouchDown(TouchEventArgs e) event.
I am getting random (immediate) OnTouchDown events when I lift the stylus off of the LCD surface.

I added a bit of code so that the OnTouchDown( ) method immediately returns if a even occurs before it finishes.
I could NOT get a reasonable calibration until I modified the OnTouchDown( ) method.

In order to calibrate I needed to use the pointed end of the bamboo skewer (bamboo stick is approximately 3/16 inch round).
I sanded the point a bit so it was not too sharp!

After calibration, using the pointed end of most things I tried did not work well. Touch bounces all over the place.

Using the flat flat end of the bamboo stick works OK (sanded) but the best thing I found was my very old Pentel (Japan)
mechanical drafting pencil. (NOT the writing end) The removable metal cap where you ‘keep’ some spare leads.

The cap is very smooth and is slightly crowned. It is 3/16 inch in diameter…

Touching with a finger sends the touch point ‘off in space’. Fingernail sort of works but the pencil top seems the best
(or the bamboo skewer flat)


            //Added bool wait because I  am receiving random
            //OnTouchDown events as I release the Stylus from the LCD surface.

            private bool wait = false;

            protected override void OnTouchDown(TouchEventArgs e)
            {
                base.OnTouchDown(e);

                if (wait) { return; }
                else { wait = true; }

                if (stringctr > 4) { stringctr = 0; } //Added to original code for debug

                int x = 0;
                int y = 0;

                Thread.Sleep(100);
                e.GetPosition((UIElement)this, 0, out x, out y);

                // If we are in calibrating mode...
                ++currentCalPoint;
                if (calibrating)
                {
                    // Cycle through all of the calibration points.
                    int index = currentCalPoint - 1;

                    cx[index] = (short)x;
                    cy[index] = (short)y;

                    text.TextContent = "{("                    +
                        sx[index].ToString() + "," +
                        sy[index].ToString() + ")=(" +
                        cx[index].ToString() + "," +
                        cy[index].ToString() + ")}";
                    sCalsave[stringctr++] = text.TextContent;
                    if (currentCalPoint == calPoints.Length)
                    {
                        // sCalsave[stringctr++] = text.TextContent;
                        // The last point has been reached , so set the 
                        // calibration.
                        Touch.ActiveTouchPanel.SetCalibration(
                            calPoints.Length,
                            sx, sy,
                            cx, cy);

                        // Show the calibration points.
                        int i = 0;
                        str = "";
                        for (i = 0; i < calPoints.Length; i++)
                        {
                            str += i.ToString() + "=" + cx[i].ToString() + "," + cy[i].ToString() + " ";
                        }
                        text.TextContent = str;

                        calibrating = false;
                        // place to save calPoints.Length, sx, sy, cx, cy
                        // afterwards you could directly call
                        // Touch.ActiveTouchPanel.SetCalibration(calPoints.Length, sx, sy, cx, cy);
                    }
                }
                else
                {
                    // We are not calibrating, so just show the point.
                    r = 10;
                    centerx = x;
                    centery = y;

                    text.TextContent = "Down " + x.ToString() + "," + y.ToString();
                }

                //
                Debug.Print(str);
                Debug.Print(sCalsave[0]);
                Debug.Print(sCalsave[1]);
                Debug.Print(sCalsave[2]);
                Debug.Print(sCalsave[3]);
                Debug.Print(sCalsave[4]);
                //

                Invalidate();

                //Allow new OnTouchDown events
                wait = false;
            }



#8

willgeorge - not sure if you have managed to solve this issue.

I had the same issue with the ChipworkX dev kit and then our own custom PCB and 7" screen. Light touches would bounce the touch point around rendering any sort of precision use out of the question. I had to write my own touch driver. This may not be an option if you are using the built in windows presentation foundation as I am not sure how you would inject the touch events manually into the queue. (I am sure some of the gurus on here could assist)

The issue is the underlying Microsoft driver samples the ADC on the TSC2046 (ChipworkX) before it has had time to stabilise following an interrupt. You can also choose to filter touches by the measured Z value (resistance between the two touch plates) to eliminate very light brushes.

I can now use the touchscreen with my finger or a stylus with no spurious touches. If it is a high profile client project I would strongly recommend writing your own driver. The datasheet on the chip is very helpful - http://www.ti.com/lit/ds/symlink/tsc2046.pdf


#9

Hi Michael8,

I read your reply with interest. I have a custom board with the TSC2046 on it connected to the same IO as on the ChipworkX dev board but I just cannot get it to calibrate. The values are all over the place. In some cases, the calibration points step to the next one without any touching of the screen. I am pretty certain there is no noise as the lines looks clean with a scope.

If I monitor the touch signals with the scope I can see nice clean signals after a small settling time so I am thinking along the same lines as you and that the Microsoft driver is sampling too early.

I am currently working on a new driver myself to see if the fault is with the sampling time. I am also adding the Z option. I did this with an Atmel AVR design and the touch response with a finger was improved tremendously.


#10

Despite the shame this causes me I have posted a code snippet that I wrote over a year ago. Despite being very rough and ready it works well. If I were to revisit this I would write it using RLP (as an alternative to having it pre-compiled with the porting kit).

It includes a 9 point calibration routine.

All input is welcome (be gentle).
Michael.

// Edited to add the link to the code snippet - http://www.tinyclr.com/codeshare/entry/687