Jump to content

ILI9341 TSC2046 (ADS7843) STM32F103


Angus Schmaloer

Recommended Posts

Hey,

I got the display working. Now i want to get the resistive touch to work. The program compiles alright and I am in the "Calibration" on the display, but it always fails. I looked at the ADS7843 board file form the FireBull-STM32F103 and used that as example code for my board file. 

The "static GFXINLINE gBool getpin_pressed(GMouse* m)" is called a lot,which makes sence, but the "static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port)" is also called a lot even though the pin isn't low (active low).

gmouse_lld_ADS7843_board.h

gpio.h

Link to comment
Share on other sites

You might need to increase the values of GMOUSE_ADS7843_FINGER_CALIBRATE_ERROR and GMOUSE_ADS7843_PEN_CALIBRATE_ERROR in your board file. They are currently set to 20 and 2. Those are the distances in pixels which the fourth control crosshair is allowed to have as tolerance after the calibration has been applied. 2 and 20 are some very low values. Try higher ones.

Link to comment
Share on other sites

  • 4 weeks later...
4 hours ago, Angus Schmaloer said:

Do we need to write 3 and read 3? and why are the rxbuf[1] & rxbuf[2] shifted so weird?

i found this:

HAL_SPI_Receive(TSC2046_SPI_INSTANCE, buf, 2, 0xff);
  // [0] = {x 11 10 9 8 7 6 5}
  // [1] = {4 3 2 1 0 x x x} x = dummy fill
  value = (buf[0] << 5 | buf[1] >> 3);

and it explains it a bit, but here they read 2 values and the ugfx libary reads/writes 3 values.

Link to comment
Share on other sites

also i implemented:
static GFXINLINE gBool getpin_pressed(GMouse* m) {
    (void) m;
    GPIO_PinState state = LCD_TOUCH;
    if(state == GPIO_PIN_RESET){
        return 0;
    }
    return 1;
}

maybe it should be the other way around, which seems more logical cuz i guess you want to return true when it is pressed(low) not when high.
 

Link to comment
Share on other sites

!!!EDIT!!! i did it and its fixed, i though it didn't respond anymore, but i just have to pres it a bit longer than normal (maybe hold it a bit instead of a short touch). now i kinda feel a bit dumd XD but glad it is fixed. awesome library btw. The company i work for is gonne buy and use it. now i'm just testing for myself to see the library

Just now, Angus Schmaloer said:


maybe it should be the other way around, which seems more logical cuz i guess you want to return true when it is pressed(low) not when high.
 

 

Link to comment
Share on other sites

The board file is completely specific to each application. The existing ones are more of templates and examples that anything else. You're supposed to copy them to your application folder and modify them to fit your needs.

If you have an updated/improved board file for a supported board file we'd appreciate it if you could share it. Most of them were not created by ourselves so it's likely that there's a lot of room for improvement.

 

On 10/08/2018 at 15:11, Angus Schmaloer said:

i did it and its fixed, i though it didn't respond anymore, but i just have to pres it a bit longer than normal (maybe hold it a bit instead of a short touch). now i kinda feel a bit dumd XD but glad it is fixed.

No need to feel bad at all :)

 

On 10/08/2018 at 15:11, Angus Schmaloer said:

awesome library btw. The company i work for is gonne buy and use it. now i'm just testing for myself to see the library

Thank you for the feedback - glad to hear that! :) 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...