This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x TSC PEN_UP interrupt

Hello,
I'm working on AM335xEVM+StarterWare+CCS, and testing touchscreen controller with StarterWare sample(tscCalibrate.c).
About a PEN_UP interrupt, follow things a written in In TRM(spruh73g.pdf) P1019 "12.3.5 Interrupts"
------------------
A PEN_UP interrupt is generated only if the HW steps are used and the Charge step must be enabled. If
a pen_down event caused the HW steps to be scheduled, and after the sequencer finishes servicing the
charge step, if the HW Pen (touch) is not active then PEN UP is generated.
------------------
So, if I touch the screen about 3 or 4 seconds and then my finger up, I should get many many Pen Touch interrupt and only one Pen Up interrupt.
But actually, I've got many Pen Touch interrupt and many Pen Up interrupt.
I see Pen Touch and Pen Up interrupt on IRQSTATUS_RAW Register from CCS memory window.
Althogh I crear them writing a 1 to IRQSTATUS Register, Pen Up Flag is set instantly.

Why so many Pen Up interrupts happen ?

  • Takeshi Matsuzaki,

    If you configure the charge step the same as your idle step you should see the proper pen-up interrupt operation. Let me know if you still have trouble.

    Regards,

    Tyler

  • Hello, Tyler

    Thank you for your reply.
    I configured the charge step register(TS_CHARGE_STEPCONFIG) as idle step register(IDLECONFIG), but  phenomenon has no changed.  Am I miss-understanding your reply?

    Regards,
    Takeshi

  • Takeshi,

    Can you provide the configuration for all steps you are using?

    -Tyler

  • Hello, Tyler

    Step configurations are follows.

    0x54 : STEPENABLE           : 0x000007FF
    0x58 : IDLECONFIG           : 0x00040500
    0x5C : TS_CHARGE_STEPCONFIG : 0x00889120
    0x60 : TS_CHARGE_DELAY      : 0x00000200
    0x64 : STEPCONFIG1          : 0x00100072
    0x68 : STEPDELAY1           : 0x00000098
    0x6C : STEPCONFIG2          : 0x00100072
    0x70 : STEPDELAY2           : 0x00000098
    0x74 : STEPCONFIG3          : 0x00100072
    0x78 : STEPDELAY3           : 0x00000098
    0x7C : STEPCONFIG4          : 0x00100072
    0x80 : STEPDELAY4           : 0x00000098
    0x84 : STEPCONFIG5          : 0x00100072
    0x88 : STEPDELAY5           : 0x00000098
    0x8C : STEPCONFIG6          : 0x04040192
    0x90 : STEPDELAY6           : 0x00000098
    0x94 : STEPCONFIG7          : 0x04040192
    0x98 : STEPDELAY7           : 0x00000098
    0x9C : STEPCONFIG8          : 0x04040192
    0xA0 : STEPDELAY8           : 0x00000098
    0xA4 : STEPCONFIG9          : 0x04040192
    0xA8 : STEPDELAY9           : 0x00000098
    0xAC : STEPCONFIG10         : 0x04040192
    0xB0 : STEPDELAY10          : 0x00000098

    These are default configurations of StarterWare sample(tscCalibrate.c).
    It works fine except a  PEN_UP interrupt.

    Regards,
    Takeshi

  • Takeshi,

    When you set the register TS_CHARGE_STEPCONFIG to the same value as IDLECONFIG, do you still get a PEN_UP interrupt while holding your finger down? Is the interrupt being cleared in the ISR?

    I've done this on a GP EVM and it is working for me.

    -Tyler

  • Hello Tyler

    It works fine!

    0x54 : STEPENABLE           : 0x000007FF
    0x58 : IDLECONFIG           : 0x00040500
    0x5C : TS_CHARGE_STEPCONFIG : 0x00040500
    0x60 : TS_CHARGE_DELAY      : 0x00000200
    0x64 : STEPCONFIG1          : 0x00100072
    0x68 : STEPDELAY1           : 0x00000098
    0x6C : STEPCONFIG2          : 0x00100072
    0x70 : STEPDELAY2           : 0x00000098
    0x74 : STEPCONFIG3          : 0x00100072
    0x78 : STEPDELAY3           : 0x00000098
    0x7C : STEPCONFIG4          : 0x00100072
    0x80 : STEPDELAY4           : 0x00000098
    0x84 : STEPCONFIG5          : 0x00100072
    0x88 : STEPDELAY5           : 0x00000098
    0x8C : STEPCONFIG6          : 0x04040192
    0x90 : STEPDELAY6           : 0x00000098
    0x94 : STEPCONFIG7          : 0x04040192
    0x98 : STEPDELAY7           : 0x00000098
    0x9C : STEPCONFIG8          : 0x04040192
    0xA0 : STEPDELAY8           : 0x00000098
    0xA4 : STEPCONFIG9          : 0x04040192
    0xA8 : STEPDELAY9           : 0x00000098
    0xAC : STEPCONFIG10         : 0x04040192
    0xB0 : STEPDELAY10          : 0x00000098

    I've got no PEN_UP interrupt while holding finger down, and have got  one PEN_UP interrupt after touching the screen.

    Can you make clear why it works fine by setting TS_CHARGE_STEPCONFIG to the same value as IDLECONFIG ?

    Regards,
    Takeshi

  • Takeshi,

    The PEN_UP interrupt you're getting when you touch the screen is likely from the mechanical nature of the touch screen. It is possible for touch screens to bounce like a push button switch. You can implement some type of debounce functionality to eliminate those false interrupts.

    In a typical Idle Step, X+ is pulled to 1.8V and X- is left floating which results in a voltage of 1.8V at the X- input. Furthermore, the Y+ and Y- inputs are tied to ground. The TSC will monitor the voltage at X- to determine if a HW Pen event occurs. When the screen is touched, the X- input is shorted to ground via Y+ and Y-. This causes the voltage to fall below a threshold that triggers the HW Pen interrupt. Similarly, for a Pen Up event, the TSC will look for the voltage on X- to rise back above the threshold.

    The detection of a Pen Up event uses the same logic as a HW Pen event just in reverse. Instead of looking for a drop in voltage at X-, you are looking for a rise in voltage at X-. In order for a Pen Up interrupt to occur in the TSC, it must be configured to use the HW steps, the Charge Step must be enabled and there can be no pending HW Pen events. The Charge Step occurs after any configured sequence of HW steps and therefore needs to share the same configuration as the Idle Step to successfully detect a Pen Up event. By doing this, when a touch is removed, the voltage at X- is allowed to rise back to the potential of X+ indicating that nothing is touching the screen anymore.

    Regards,

    Tyler

  • Tyler

    Thank you for your detailed explanation.
    Your post will be great use to many TSC user.

    Thank you.
    Takeshi