BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - KarolBob

Pages: [1]
1
Discussion - EVE / Re: How often and when read REG_TOUCH_TAG
« on: February 19, 2024, 08:12:11 PM »
Hi there.
I've been recently testing the method with interrupt handling from the touch panel. Thanks to this, it's possible to practically not send anything to FT/BT81x for most of the time. When an interrupt occurs, only then do I read the TAG. Here's the interrupt configuration:
Code: [Select]
void EVE_INT_config(void)
{
    EVE_memWrite8(REG_INT_EN,1);                // IRQ on
    EVE_memWrite8(REG_INT_MASK,EVE_INT_TAG);    // EVE_INT_TOUCH|
    EVE_memRead8(REG_INT_FLAGS);                // clear by read flag
}

Then, in loop functions:
Code: [Select]
if(is_set(FLAGS,_f_tp_irq))
        {
            CurrTag = EVE_memRead8(REG_TOUCH_TAG);
            RESET(FLAGS,_f_tp_irq);
... // the rest of the code
            // refresh the screen by set timDisp to 0
            timDisp = 0;
            EVE_memRead8(REG_INT_FLAGS); // skasuj flagi
            timer_screensaver = time_screensaver; // przeładuj timer wygaszacza ekranu
        }
        // prepare a new display list:
        if(!timDisp)
        {
            timDisp = 50;     
            // start new 'display list'
            start_new_screen();
...// etc
            finish_new_screen();
        }
Also IRQ from pin change:
Code: [Select]
ISR(INT7_vect)
{
    SET(FLAGS,_f_tp_irq);
}

2
Thank you for your response to my questions.
I note you mention an older screen does not present this issue, are both of these screens the same RVT101HVBNWC00-B model?

It turned out that the issue also occurs on the older/newer RVT101HVBNWC00-B panel. Currently, I am working on the project, and every time I power it on and restore the saved calibration matrix from EEPROM, I still have to perform calibration. I trigger the calibration with a button on the PCB.

On the occasion of the issue occurring does a re-run of the calibration routine result in accurate matrix values, or for example do you need to power cycle the board?
Running the calibration function solves the problem with the touchscreen panel. It seems like I mostly have to do this almost every time I power it on.

Have you noted any issues around the CTP connector to the displays main PCB?
I haven't noticed any problems with the CTP connector. When I used 7" panels with CTP before, everything worked fine. I'll add that I have the screen rotated 180 degrees, but that shouldn't be an issue.

PS. Perhaps the problem lies elsewhere, for example, I might be experiencing buffer overflow - I need to carefully check the source code again.
Regards,
Karol

3
Hi there.  :)
This is my first post on this forum, so I would like to say hello to everyone. Also, I want to express my gratitude to Rudolph for his amazing work. Big thanks for that!
I'm using RVT101HVBNWC00-B with BT817Q:
Sometimes i have strange calibration matrix value, only with 0 or 65535 values:
Quote
TransMatrix1 = 65536;
TransMatrix2 = 0;
TransMatrix3 = 0;
TransMatrix4 = 0;
TransMatrix5 = 65536;
TransMatrix6 = 0;
Sometimes it works well, other times it doesn't. This is my source code:
Code: [Select]
void restore_calibrate_matrix(void)
{
uint32_t TransMatrix[6];
eeprom_busy_wait();
TransMatrix[0] = eeprom_read_dword(&TransMatrix1);
// check if eeprom is emptyi 0xFFFFFFFF = 2^32 = 4294967295
if(TransMatrix[0] == 0xFFFFFFFF || is_clear(CALIBRATE_PIN,CALIBRATE))
{
        //
        Touch_Panel_Calibrate();
}
// jesli zapisane bylo cos innego niz fabryczna wartosc to pobierz reszte
else
{
char buff[20];
uart0_puts_P(PSTR("\rTransMatrix[0] = "));
uart0_puts(ultoa(TransMatrix[0],buff,10));
eeprom_busy_wait();
TransMatrix[1] = eeprom_read_dword(&TransMatrix2);
eeprom_busy_wait();
TransMatrix[2] = eeprom_read_dword(&TransMatrix3);
eeprom_busy_wait();
TransMatrix[3] = eeprom_read_dword(&TransMatrix4);
eeprom_busy_wait();
TransMatrix[4] = eeprom_read_dword(&TransMatrix5);
eeprom_busy_wait();
TransMatrix[5] = eeprom_read_dword(&TransMatrix6);
eeprom_busy_wait();
EVE_memWrite32(REG_TOUCH_TRANSFORM_A, TransMatrix[0]);
EVE_memWrite32(REG_TOUCH_TRANSFORM_B, TransMatrix[1]);
EVE_memWrite32(REG_TOUCH_TRANSFORM_C, TransMatrix[2]);
EVE_memWrite32(REG_TOUCH_TRANSFORM_D, TransMatrix[3]);
EVE_memWrite32(REG_TOUCH_TRANSFORM_E, TransMatrix[4]);
EVE_memWrite32(REG_TOUCH_TRANSFORM_F, TransMatrix[5]);
//disp_transMatrix(TransMatrix);
}
}
//
void Touch_Panel_Calibrate(void) 
{
uint32_t TransMatrix[6];
EVE_cmd_dl(CMD_DLSTART); // Start the display list
    EVE_cmd_dl(CMD_COLDSTART);
EVE_cmd_dl(DL_CLEAR_RGB | GRAY);
EVE_cmd_dl(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG); // Clear the screen - this and the previous prevent artifacts between lists
make_bigger_fonts();
    char txt[50];
    strcpy_P(txt,PSTR("Dotknij wskazane\npunkty na ekranie")); // in english "touch the indicated points"
    EVE_cmd_text((EVE_HSIZE/2),(EVE_VSIZE/2), 3, EVE_OPT_CENTER, txt);
EVE_cmd_calibrate();
EVE_cmd_dl(DL_DISPLAY); // Instruct the graphics processor to show the list
EVE_cmd_dl(CMD_SWAP); // Make this list active
while(EVE_busy() == 1);
TransMatrix[0] = EVE_memRead32(REG_TOUCH_TRANSFORM_A);
TransMatrix[1] = EVE_memRead32(REG_TOUCH_TRANSFORM_B);
TransMatrix[2] = EVE_memRead32(REG_TOUCH_TRANSFORM_C);
TransMatrix[3] = EVE_memRead32(REG_TOUCH_TRANSFORM_D);
TransMatrix[4] = EVE_memRead32(REG_TOUCH_TRANSFORM_E);
TransMatrix[5] = EVE_memRead32(REG_TOUCH_TRANSFORM_F);
save_matrix(TransMatrix);
disp_transMatrix(TransMatrix);
    uart0_send_trans_matrix(TransMatrix);
}
//
void save_matrix(uint32_t *TransMatrix)
{
// eeprom write -> update block :))
eeprom_busy_wait();
eeprom_write_dword(&TransMatrix1, TransMatrix[0]);
eeprom_busy_wait();
eeprom_write_dword(&TransMatrix2, TransMatrix[1]);
eeprom_busy_wait();
eeprom_write_dword(&TransMatrix3, TransMatrix[2]);
eeprom_busy_wait();
eeprom_write_dword(&TransMatrix4, TransMatrix[3]);
eeprom_busy_wait();
eeprom_write_dword(&TransMatrix5, TransMatrix[4]);
eeprom_busy_wait();
eeprom_write_dword(&TransMatrix6, TransMatrix[5]);
eeprom_busy_wait();
}
//
void disp_transMatrix(uint32_t *TransMatrix)
{
uint8_t i = 6;
page_start();
    uint16_t y = EVE_VSIZE/2;   // połowa ekranu
    uint8_t dy = 30;            // odstęp pomiedzy wierszami w osi oY
    y = y - (3*dy);             // zaczynam o 3 wiersze wcześniej
for(i=0; i<6; i++)
{
EVE_cmd_number(EVE_HSIZE/2,y,30,EVE_OPT_CENTER,TransMatrix[i]);
        y += dy;
}
    y += dy;
    char txt[50];
    strcpy_P(txt,PSTR("Dotknij ekranu lub nacisnij przycisk aby wyjsc")); // in english: "touch the screen to exit"
    EVE_cmd_text(EVE_HSIZE/2,y,31,EVE_OPT_CENTER,txt);
page_stop();
_delay_ms(500); //while(1){};

    while(0 == EVE_memRead8(REG_TOUCH_TAG) && is_set(CALIBRATE_PIN,CALIBRATE));
//while(is_set(CALIBRATE_PIN,CALIBRATE)){}; // czekam na ponowne nacisniecie przycisku
}
void uart0_send_trans_matrix(uint32_t * TransMatrix)
{
    char buff[16];
    for(uint8_t i=0; i<6; i++)
    {
        //EEMEM uint32_t TransMatrix1 = 33612304;
        uart0_puts_P(PSTR("\rEEMEM uint32_t TransMatrix"));
        uart0_puts(utoa(i+1,buff,10));
        uart0_puts_P(PSTR(" = "));
        uart0_puts(ultoa(TransMatrix[i],buff,10));
        uart0_puts_P(PSTR(";"));
    }
    //uart0_puts_P(PSTR("\r test="));    uart0_puts(ultoa(UINT32_MAX,buff,10));
}
In the main function, I simply call the 'restore_calibrate_matrix' function. This function reads the calibration matrix from EEPROM. If EEPROM is empty (i.e., it has a value of 0xFFFFFFFF), I invoke the screen calibration and then save the new calibration matrix values to EEPROM. However, if EEPROM contains any saved values, it reads the consecutive 'TransMatrix[n]' and then saves them to 'REG_TOUCH_TRANSFORM_n'.

I feel that one panel, the older one, works perfectly fine while the newer one has the problems described above.

Regards
Karol

Pages: [1]