ADC Touchscreen GLCD


+ Reply to Thread
Results 1 to 4 of 4

Thread: ADC Touchscreen GLCD1339 days old

  1. #1
    hadv215
    Guest hadv215's Avatar

    0 Not allowed!

    Default ADC Touchscreen GLCD

    Hi people,

    I have a 4 wire resistive touchscreen on my GLCD.
    Everything is connected to an 18F45K20 running at 64 MHz.

    Xp is connected to portb.0, Yp to portb.1, Xp to portb.2 and Xn to portb.3
    PBADEN is set, so on startup all these pins are analog inputs.

    When I want to know the X-position I do the following:
    Set TRISB to 5 (don't want problems with the infamous percentage) (portb.0 and portb.2 input, rest output)
    Next I make Yp high and Yn low and do an ADIn 12 (that's the one for portb.0)

    When I want to know the Y-position I do the following:
    Set TRISB to 10 (portb.1 and portb.3 input, rest output)
    Next I make Xp high and Xn low and do an ADIn 10 (that's the one for portb.1)

    The X-values run, as intended, proportional from lo to hi when I move my stylus from left to right and from hi to lo in the opposite direction.
    But the Y-values depend on the X-position of the stylus, in the lower-left position the Y-value is approx 10, in the lower-right position approc 240 where I would expect 240 and 240

    Not really very happy with this, I recreated the circuit on a breadboard and used a DMM to see what happens.
    Nothing strange, both X- and Y-values are as expected (and intended).

    So...what goes wrong?

    Regards
    Harm

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,701
    Thumbs Up
    Received: 361
    Given: 173
    Total Downloaded
    2.08 GB

    0 Not allowed!

    Default Resistive Touch Screen Code

    I created an include file for a resistive touch pad a few years ago.

    I've uploaded it to the forum. Hopefully, it can be adapted for your application.

    Resistive Touch Screen Code

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    hadv215
    Guest hadv215's Avatar

    0 Not allowed!

    Default Re: Resistive Touch Screen Code

    Thanks for the code.
    I've looked at it and basically I'm doing exactly the same.

    Copied some parts, but the results stay the same

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    hadv215
    Guest hadv215's Avatar

    0 Not allowed!

    Default Re: Resistive Touch Screen Code

    I implemented the code on a 18F452 (like in your demo) and this works just fine.
    I suppose there must be something wrong with the AN ports on the 18F45K20, so I'll try a different port

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. EasyPic5 Touchscreen
    By pic-ignorant in forum The Lounge
    Replies: 1
    Last Post: 1st August 2009, 20:27
  2. [SOLVED !] Touchscreen ADC Help
    By fgcity in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 15th May 2007, 15:17
  3. [SOLVED !] DisplayTech GLCD with touchscreen Overlay
    By lothar in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 29th April 2007, 12:38
  4. [SOLVED !] GLCD garbbled when I use ADC channel!
    By Ashfaq in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 1st September 2006, 16:59
  5. [SOLVED !] USB Touchscreen
    By AlanR in forum Proton Plus Compiler v3
    Replies: 9
    Last Post: 27th May 2005, 22:51

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts