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.

problem about dm365 keypad

When using dm365's keypad module, I came acourse a problem.

The key may become invalid after be pressed server times, then no matter press which key, it has no response.

By add some debug info, I found that the dm365_keypad never enter the interrupt again,and the keypad INTFLG

register always be 0x00000007 in this case, other registers are normal, as follow:

./readl 0x01c69400 0 a
00000  00000009 00000001 00000007 00000000
00010  00000005 00000002 00000001 0000FFFF
00020  0000FBFF 00000003

The corresponding bit of INTFLG register define as follow:

bit2  OFFFLG             Key Data All Off Interrupt Flag
                                     0 No interrupt
                                    1 Interrupt

bit1   ONFLG             Key Data On Interrupt Flag
                                    0 No interrupt
                                    1 Interrupt

bit0  CHNGFLG        Key Data Change Interrupt Flag
                                    0 No interrupt
                                    1 Interrupt

when I clear the INTFLG register manully, the keypad module resume immediately.

I would like to know what cause the INTFLG register  become 0x00000007?

Is it caused by new interrupt appear before the previous one be processed?

And why the dm365_keypad can't enter interrupt in this case?

  • No body else has the similar problem?

     Any reply will be appreciated.

  • I also encountered the same problem. The keyscan interrupt flag register indicated pending interrupt, but the interrupt is not serviced.

    Have you found out the cause and the solution?

  • HI all

      Here is a way to check the keypad from DM365 EVB

      If you see those info. after loading the kernel--input: davinci_keyscan as /devices/platform/davinci_keyscan.0/input/input0

      You can try this way to check & see the key value:
    1. cd /proc/
    2. cat kmsg

     Here are the result:

    sw21: Play/Pause
    <7>evbug.c: Event. Dev: input0, Type: 1, Code: 164, Value: 2
    <7>evbug.c: Event. Dev: input0, Type: 0, Code: 0, Value: 1

    sw18: Stop
    <7>evbug.c: Event. Dev: input0, Type: 1, Code: 128, Value: 1
    <7>evbug.c: Event. Dev: input0, Type: 0, Code: 0, Value: 0

     sw15: REC
    <7>evbug.c: Event. Dev: input0, Type: 1, Code: 167, Value: 0
    <7>evbug.c: Event. Dev: input0, Type: 0, Code: 0, Value: 0

    I wish it will help us. 

    BR
        Terry K.G

  • Seeing what looks like the same issue here.  Key press monitoring suddenly stops, without warning, and never comes back.  Anyone else?  Any suggestions?

     

    Regards,

    Mitch

  • As a short term work around, we are periodically setting INTCLR to 0xf, which is a big hack, and should not be required...  

     

    There is a comment in the keyscan user guide that the auto detect function should be set when enable is off?  Does this imply that Module Enable and Autodetect are mutually exclusive, or just they have to be set individually in the correct order?

    Auto Detect Function
    After the auto detect mode detects that a key has been pressed, it immediately begins scanning.
    Normally, the anti-chatter function is ON. That means, if a key is pressed, auto detect mode (all outputs
    are low) occurs and continues for a clock count during scanning, until the key pressing is recognized for
    the third time. When setting this mode, make sure that Enable is turned off.

    Regards,

    Mitch

  • Hi, all,

    The problem is due the keyscan clock source.

    Pls try to set KeyScan clock source selection (KEYSCLKS) to 1(selects PLLC1AUXCLK clock Divider) with DIV3=749(i.e. 24MHZ/(DIV3+1) = 24MHZ/750 = 32KHz )
    i.e. PERI_CLKCTL = 0x36ED04FC.

    It should solve the problem.

  • Hi all,

    we had a similar problem with our keypad  which was solved with this bugfix.

    Thank You

  • Hello!

    I have the same problem with the keyscan module but I can't find the source file where I can change the clock input for the keyscan interface. Is there such a file (i.e. a clock setup file for the davinci soc's) where I can simply change it?

    Regards,

    Matthias