STMPE610 Library

General discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
karl567
Posts: 64
Joined: 19 Apr 2012 17:25
Location: Konstanz

STMPE610 Library

#1 Post by karl567 » 20 Feb 2015 17:02

Please, where can I find the STMPE610 Library for my mikroPascal PRO Compiler (v6.2.0)?
Regards, Karl

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: STMPE610 Library

#2 Post by filip » 22 Feb 2015 08:50

Hi,

Currently, porting of this library for dsPIC compiler is in our plans.

Regards,
Filip.

karl567
Posts: 64
Joined: 19 Apr 2012 17:25
Location: Konstanz

Re: STMPE610 Library

#3 Post by karl567 » 23 Feb 2015 07:52

Hi,

thank you for your answer. Could you please specify how long the porting will take? Or could you provide a preliminary version of the library? Currently I am working on a project with STMPE810 and it would be very helpful to for me to go on.

Regards,
Karl

barbiani
Posts: 8
Joined: 13 Jun 2014 19:46

Re: STMPE610 Library

#4 Post by barbiani » 17 Sep 2019 05:48

filip wrote:Hi,

Currently, porting of this library for dsPIC compiler is in our plans.

Regards,
Filip.

Can you share the stemp810 registers initialization values? I own the mx7mmb and can not get a steady touch reading.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: STMPE610 Library

#5 Post by filip » 23 Sep 2019 08:29

Hi,

Are you interested in some specific registers ?
Many of them are used by the library, it will be difficult to list them here.

Regards,
Filip.

barbiani
Posts: 8
Joined: 13 Jun 2014 19:46

Re: STMPE610 Library

#6 Post by barbiani » 25 Sep 2019 02:00

I am interested in the driving strength and timing registers. The touched point jumps quite a lot.

The other board I own, the green mx7mmb (with ADC touch) is very steady.

This is the actual code:

Code: Select all

    if (STMPE610_get_version() == 0x811) { // chip ID
        write(STMPE_SYS_CTRL2, 0x00); // turn on clocks!
        write(STMPE_ADC_CTRL1, STMPE_ADC_CTRL1_12BIT | (0b110 << 5)); // 124 clocks per conversion
        write(STMPE_ADC_CTRL2, STMPE_ADC_CTRL2_3_25MHZ);
        write(STMPE_TSC_CFG, STMPE_TSC_CFG_4SAMPLE | STMPE_TSC_CFG_DELAY_500US | STMPE_TSC_CFG_SETTLE_500US);
        write(STMPE_FIFO_TH, 1);
        write(STMPE_FIFO_STA, STMPE_FIFO_STA_RESET);
        write(STMPE_FIFO_STA, 0);
        write(STMPE_TSC_I_DRIVE, STMPE_TSC_I_DRIVE_50MA);
        write(STMPE_INT_CTRL, STMPE_INT_CTRL_POL_HIGH | STMPE_INT_CTRL_ENABLE);
        write(STMPE_INT_EN, STMPE_INT_EN_TOUCHDET | STMPE_INT_EN_FIFOTH | STMPE_INT_EN_FIFOFULL);
        write(STMPE_TSC_CTRL, STMPE_TSC_CTRL_XYZ | (1<<4) | STMPE_TSC_CTRL_EN);
        write(STMPE_INT_STA, 0xFF); // reset all ints
        return (1);
    }

Code: Select all

TOUCH * STMPE610_read (TOUCH *touch) {
    if ((read_byte(STMPE_TSC_CTRL) & STMPE_TSC_TOUCH_DET) == 0) {
        touch->x = -1;
        touch->y = -1;
    }
    else {
        if (read_byte(STMPE_FIFO_SIZE) > 0) {
            touch->x = ((COORD)read_word(STMPE_TSC_DATA_X) - 172) / 8;
            touch->y = ((COORD)read_word(STMPE_TSC_DATA_Y) - 280) / 13;
        } else {
            return (0);
        }
    }
    write(STMPE_FIFO_STA, STMPE_FIFO_STA_RESET);
    write(STMPE_FIFO_STA, 0);
//    printf("%d ; %d\n\r", touch->x, touch->y);
    return (touch);
}

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 General”