I don't know if it will make a difference in any help, but here is the code relevent to scanning the TS:
and a schematic of the hookup:Code:XRaw VAR WORD YRaw VAR WORD Xp VAR PORTA.3 Xm VAR PORTA.5 Yp VAR PORTA.2 Ym VAR PORTA.4 ADCON1 = $0D 'Set only PORTA.0-1 Analog 'Scan X HIGH Xp LOW Xm INPUT Yp INPUT Ym PAUSEUS 5 ADCIN 0, XRaw LOW Xp 'Scan Y HIGH Yp LOW Ym INPUT Xp INPUT Xm PAUSEUS 5 ADCIN 1, YRaw LOW Yp
![]()
I keep going back to that grounding thing, static or EMI...
Neither of the datasheets has any helpful hints as to what might be going on.
Maybe try hooking a 'grounding wire' up to the touchscreen to the LCD frame, first with a 1K resistor (maybe less), then maybe a direct connection.
I'm thinking it's some sort of static buildup causing the controllers on the GLCD to go nuts.
Maybe try it sitting on a regular character LCD and see what happens? Not that a touch panel on a character LCD is any good, but it might lead to something...
I just happened to have a 4X20 breadboarded up with this project, and the TS has no effect on it.
I'll look into the resistor idea tomorrow (or whenever I can get back to it this week). Not a lot of options to connect it to though, the lcd bezel is painted and there is nothing exposed on the TS. The "FrameGround" pin on the lcd is connected to GND. (I've also tried it not connected)
SteveB
I bet that the touch screen is creating an EM field due to the high frequency switching going on. Just for a test, take some of the static protective translucent poly bag material, and sandwich it between the two. If this doesn't relieve the problem, it should reduce the distance. You do have a wierd ground loop problem going on there. What is the hookup of your GLCD?
Ron
As an update to my trouble shooting:
I can't think of a good way to hook up the resistor, but along that idea, I took a piece of 12gauge (maybe 10) bare copper wire, created a U shape and laid that across the bezel on three sides, from the bottom, around the right edge, then to the top. Laid the TS on top of this and it worked.
I am going to try and find a smaller wire and try that (or pound the 12gauge into a flat frame), possibly tonight if time permits. I'll also give Ron's suggestion a try at the same time. I was also thinking about an EM field, but not to much as that stuff is way over my head. BTW, the TS scan occurs every about every 10-20ms.
As for the GLCD hookup, Here is the pin arrangement. (I just noticed i put a 2620 in the above schematic, I am actually using a 4620)
Thanks for the help,Code:Pin Connection 1 VSS 0v – Ground 2 VDD +5.0v – Supply voltage for logic 3 VO None – Supply voltage for driving LCD 4 RD PortC.2 - 8080 mode 1 = No operation 0 = Read 5 WR PortC.3 - 8080 mode 1 = No operation 0 = Write 6 A0 PortC.5 - 7-14 DB0-7 PortD - Data Bits 15 CS PortC.4 - Chip select, Active L 16 RES PortE.2 - Controller reset signal, Active L 17 VEE None - Negative voltage output 18 FGND 0v - Frame ground 19 DISPOFF +5.0v - Display L: No Display 20 WAIT None
Steve
From what you just described, it sounds like you just need a chunk of wire to run from the frame of the touchscreen (maybe epoxy it on there?) to the frame of the GLCD...and that's it. If there is an issue with EMI, then that direct connection would effectively drain the field away, for lack of a better phrase...
Is the bezel of the touchscreen or the GLCD painted? Maybe that's why it isn't getting a good ground?
Bookmarks