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

Pages: 1 2 3 [4] 5

Author Topic: How to read REG_ID register  (Read 67858 times)

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 780
    • View Profile
Re: How to read REG_ID register
« Reply #45 on: January 10, 2022, 11:10:01 AM »

Hello,

Could you post an example of a short display list that you have created which shows the issue?

Best Regards, BRT Community

Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #46 on: January 19, 2022, 10:42:20 AM »

Hi , Thanks for your reply.


I am currently using Riverdi BT817Q capacitive touch.

Commands Sent

Write operations to that particular registers to detect touch interrupt:
CTOUCH_MODE - 3
TOUCH_RZTHRESH - 1200 (To eliminate false touches)
TOUCH_CONFIG - 0x0380 (I2C address)
REG_TOUCH_TRANSFORM ( A to F) with the prerecorded values.

I have connected INT_N pin from BT817 to FRDM Controller, I have configured a GPIO pin in FRDM controller as an Interrupt pin to detect touch interrupt .
I have set the mask value in REG_INT_MASK value to 0x06 since i need touch and tag interrupt source activation for now. I have also enabled the REG_INT_EN
I have a doubt like in REG_INT_MASK I can set bit7 - bit 0 (8bits) for interrupt source ie., enabling the interuppt source but the Interrupt flag assignment is 9 bits.

Kindly help me in getting or detecting the touch interrupt or How to find out if touch has occured. Also how to determine whether the display is Focalteck / goodix touch IC based.
Thanks in advance..
« Last Edit: January 19, 2022, 12:23:17 PM by Geethanjali »
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 424
    • View Profile
Re: How to read REG_ID register
« Reply #47 on: January 19, 2022, 03:46:20 PM »

Hello,

try leaving out the write to TOUCH_CONFIG, the default is 0x381 anyways.

I can't help with the interrupt since I never used interrupts for the touch.
I have not found any reason to use interrupts but a couple of reasons to not use interrupts.
Like that you need a 15ms pause between screen updates anyways.

So maybe try polling first to check if that works before switching to interrupt if you still want to.
I recommend an interval of 5ms for polling the touch.


Quote
Also how to determine whether the display is Focalteck / goodix touch IC based.

There is no direct way to do this since there is no API to read registers of the CTP.
Ok, it might be possible with the "CUSTOM TOUCH" module in EVE Asset Builder but looking at the example this
might be rather difficult to implement.
There is no pointer to RAM_G for example defined.
And adding a pointer does not seem to work:
"Unexpected token Token(MUL_OP, '*') at line 16, column 7."

And there is no size limit for the custom touch firmware mentioned or enforced:
 customtouch.c compilation is in progress...
 Microcode 'capcs.fs' uses 12320 bytes.
 Loader command stream is 476 bytes
 11570 new bytes in firmware
 Compilation is done.

Reading and writing CTP registers would not only allow to read the ID bits but also to play
with things like gesture detection that at least some of these touch controllers have implemented.
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #48 on: January 20, 2022, 04:25:12 AM »

CTOUCH_MODE - 3
TOUCH_RZTHRESH - 1200 (To eliminate false touches)
TOUCH_CONFIG - 0x0380 (I2C address)
REG_TOUCH_TRANSFORM ( A to F) with the prerecorded values.

CLEAR(1, 1, 1)
POINT_SIZE(200)
TAG(0)
BEGIN(POINTS)
VERTEX2F(2000, 2000)
TAG(10)
VERTEX2F(3000, 2000)
TAG(11)
VERTEX2F(4000, 2000)
TAG(12)
VERTEX2F(5000, 2000)
END()
CMD_TEXT(298, 164, 28, 0, "Text")
TAG(0)
CMD_TEXT(199, 53, 28, 0, "Text")

Along with end and display commands in the end , How to identify if touch is occurred and Can u please provide me more information on Interrupt related to touch detection. I tried reading REG_TOUCH_RAW_XY the response is FF . I am unable to detect touch.

Kindly help me in this.

Thanks in advance
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #49 on: January 20, 2022, 12:38:20 PM »

CLEAR(1, 1, 1)
POINT_SIZE(200)
TAG(0)
BEGIN(POINTS)
VERTEX2F(2000, 2000)
TAG(10)
VERTEX2F(3000, 2000)
TAG(11)
VERTEX2F(4000, 2000)
TAG(12)
VERTEX2F(5000, 2000)
END()
CMD_TEXT(298, 164, 28, 0, "Text")
TAG(0)
CMD_TEXT(199, 53, 28, 0, "Text")
END()
DISPLAY()
I Have a screen with 4 points with a tag value for each
after this if i touch the display I dont see any data in REG_TOUCH_TAG updated . This is where am stuck. Is there any mistake


Kindy help me in this ..
Thanks in advance..
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 780
    • View Profile
Re: How to read REG_ID register
« Reply #50 on: January 20, 2022, 02:11:25 PM »

Hi,

Here is a small code example.

It will tag the four circles and so when you hold your finger on them, you should see the corresponding tag displayed by the number command.
We set the clear tag to 100 and so if you touch an area of the screen outside of the circles, you'll get tag 100
With no touch, the tag will read 0

We also mask the tag so that the text and number are not tagged, this is useful if you want to turn off tagging for these after drawing the tagged items  (the tag 13 for the last circle would otherwise also apply to the text and number)

Best Regards, BRT Community


Code: [Select]
   uint8_t Tag = 0;
   
   while(1)
    {
        EVE_LIB_BeginCoProList();                                               // Begin new screen
        EVE_CMD_DLSTART();                                                      // Tell co-processor to create new Display List

EVE_CLEAR_TAG(100);                  // Set tag to 100 for any un-tagged pixels
EVE_CLEAR_COLOR_RGB(0, 0, 0);                                           // Specify color to clear screen to

EVE_CLEAR(1,1,1);                                                       // Clear color, stencil, and tag buffer

EVE_TAG_MASK(1);                                                        // Enable tagging

EVE_BEGIN(EVE_BEGIN_POINTS);
EVE_POINT_SIZE(800);
EVE_TAG(10);
EVE_VERTEX2F((100*16), (100*16));
EVE_TAG(11);
EVE_VERTEX2F((200*16), (100*16));
EVE_TAG(12);
EVE_VERTEX2F((300*16), (100*16));
EVE_TAG(13);
EVE_VERTEX2F((400*16), (100*16));
EVE_END();

EVE_TAG_MASK(1);                                                        // Disable tagging
EVE_CMD_TEXT(100, 200, 28, 0, "The Tag is...");
EVE_CMD_NUMBER(100, 250, 28, 0, Tag);

EVE_DISPLAY();                                                          // Tell EVE that this is end of list
EVE_CMD_SWAP();                                                         // Swap buffers in EVE to make this list active

EVE_LIB_EndCoProList();                                                 // Finish the co-processor list burst write
EVE_LIB_AwaitCoProEmpty();                                              // Wait until co-processor has consumed all commands

Tag = HAL_MemRead8(EVE_REG_TOUCH_TAG);
   }
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #51 on: January 21, 2022, 04:40:51 AM »

Hi, I tried with the display list that you have sent
   Raw   Text
0   0x12000064   CLEAR_TAG(100)
1   0x02000000   CLEAR_COLOR_RGB(0, 0, 0)
2   0x26000007   CLEAR(1, 1, 1)
3   0x14000001   TAG_MASK(1)
4   0x1f000002   BEGIN(POINTS)
5   0x0d0000c8   POINT_SIZE(200)
6   0x0300000a   TAG(10)
7   0x43200640   VERTEX2F(1600, 1600)
8   0x0300000b   TAG(11)
9   0x46400640   VERTEX2F(3200, 1600)
10   0x0300000c   TAG(12)
11   0x49600640   VERTEX2F(4800, 1600)
12   0x0300000d   TAG(13)
13   0x4c800640   VERTEX2F(6400, 1600)
14   0x21000000   END()
15   0x14000001   TAG_MASK(1)
16   0x1f000001   BEGIN(BITMAPS)
17   0x8c8c8fd4   VERTEX2II(100, 200, 31, 'T')
18   0x8fcc8fe8   VERTEX2II(126, 200, 31, 'h')
19   0x92cc8fe5   VERTEX2II(150, 200, 31, 'e')
20   0x958c8fa0   VERTEX2II(172, 200, 31, ' ')
21   0x96cc8fd4   VERTEX2II(182, 200, 31, 'T')
22   0x9a0c8fe1   VERTEX2II(208, 200, 31, 'a')
23   0x9cec8fe7   VERTEX2II(231, 200, 31, 'g')
24   0x9fec8fa0   VERTEX2II(255, 200, 31, ' ')
25   0xa12c8fe9   VERTEX2II(265, 200, 31, 'i')
26   0xa26c8ff3   VERTEX2II(275, 200, 31, 's')
27   0xa52c8fa0   VERTEX2II(297, 200, 31, ' ')
28   0xa66c8fae   VERTEX2II(307, 200, 31, '.')
29   0xa7cc8fae   VERTEX2II(318, 200, 31, '.')
30   0x1f000001   BEGIN(BITMAPS)
31   0x8c8fafb0   VERTEX2II(100, 250, 31, '0')
32   0x00000000   DISPLAY()
33   0x00000000   DISPLAY()
34   0x8c8fafb0   VERTEX2II(100, 250, 31, '0')
35   0x00000000   DISPLAY()
 
This is the Display list from EVE editor but If I touch the corresponding tag is not getting displayed by the number command. Kindly let me know if there are any mistakes.

Kindly help me in this .
I can see the tag value changing in REG_TOUCH_TAG but not by the number command.


Thanks in advance.
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #52 on: January 21, 2022, 06:21:35 AM »

Hi,

Can anyone help me with respect to interrupts should I configure the interrupt for touch , If not how to identify touch , I tried configuring the registers ie., REG_INT_EN , REG_INT_MASK and reading the interrupt source , should this be configured , Kindly let me know how to identify the interrrupt of touch or how to understand there is touch happened without interrupt.
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 424
    • View Profile
Re: How to read REG_ID register
« Reply #53 on: January 21, 2022, 08:49:50 PM »

Quote
29   0xa7cc8fae   VERTEX2II(318, 200, 31, '.')
30   0x1f000001   BEGIN(BITMAPS)
31   0x8c8fafb0   VERTEX2II(100, 250, 31, '0')
32   0x00000000   DISPLAY()
33   0x00000000   DISPLAY()
34   0x8c8fafb0   VERTEX2II(100, 250, 31, '0')
35   0x00000000   DISPLAY()

This looks odd, the list ends prematurely and this is not what CMD_NUMBER puts into the display list.
And CMD_TEXT also does look a bit different, there are a couple of lines missing from the output.

Anyways, I remembered that the CTP has an USB interface.
Riverdi is even selling the cable for it: https://riverdi.com/product/rva-pcap-usb-cable/
The connector is a SHR-04V-S-B from JST.

I do not have this cable but I have SHR-05V-S-B with pins, a side-cutter and a soldering iron. :-)

I disconnected the FFC that goes into the BT817 board and connected the USB to my PC.
And I now have a 2x HID device that identifies as a touchscreen from Ilitek.
It is not really useable, it acts rather strange, one finger down appears to be left-mouse clicked already.
But at least something is happening this way confirming that the CTP does something.
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Calibration of touch
« Reply #54 on: January 25, 2022, 07:30:39 AM »

Hi Rudolph ,

Thanks for your help . I want to calibrate the touch points , I am sending the CMD_CALIBRATE  command , I am able to see the blue dot appearing but if I touch that its not moving ie., its not calibrating the points . What is the mistake Could you please help me in that . The calibration point is rigid its not moving even though I touch no movement , its appearing in top left corner of display. Can u please help me in this.

I have sent the prerecorded values of REG_TOUCH_TRANSFORM (A to F)

CLEAR(1, 1, 1)
CMD_DLSTART
CLEAR_COLOR_RGB(0,0,0)
CMD_TEXT(256, 171, 30, 0, "calibration - please tap the dot")
CMD_CALIBRATE(0)
DISPLAY()
CMD_SWAP()

Thanks in advance.
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 424
    • View Profile
Re: How to read REG_ID register
« Reply #55 on: January 25, 2022, 03:10:33 PM »

Try again please without writing to the REG_TOUCH_TRANSFORM_x registers.

If the calibration function still does not react to any touch it may be possible that your display is defective.


Edit: annother thought.
Please also remove write access to CTOUCH_MODE, TOUCH_RZTHRESH and TOUCH_CONFIG from your init function.
And for good measure, add a delay of 100ms after the detection of 0x7c in your init function.

« Last Edit: January 26, 2022, 04:02:12 PM by Rudolph »
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #56 on: February 01, 2022, 12:30:00 PM »

Hi Rudolph ,

Thanks for your reply ,

I tried with your comments but still the calibration is not happening , Is there any other way to check the touch in display , could you please help me if there are other options other than USB2SPI module usuage.


Thanks in advance
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 424
    • View Profile
Re: How to read REG_ID register
« Reply #57 on: February 01, 2022, 06:22:04 PM »

I am running out of ideas, remote analysis has limits.

You could try to use a different CPU board, something that is so common that you can easily use a different software.
An Arduino UNO would do since you should have an extra power supply already anyways.

Hmm, at this thought, please provide a detailed sketch of how exactly you wired your setup together.
I remember now that I experienced not working touch with a flaky supply.

Next on the list would be to grab a logic-analyzer and tap into the I2C lines that go to the CTP.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 780
    • View Profile
Re: How to read REG_ID register
« Reply #58 on: February 02, 2022, 03:43:04 PM »

Hello,

From the description of the behavior when running CMD_CALIBRATE it sounds like the touches aren't being registered by EVE.

Can you please clarify the touch controller being used, and as Rudolph has mentioned, please try and take a logic catpure of the I2C lines from the touch controller.

Best Regards,
BRT Community
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #59 on: February 07, 2022, 09:30:58 AM »

The touch controller used is ILI2132A , I am unable to see any data on SCL , SDA lines.

It would be helpful if u can provide screenshot of I2C lines or if there are any init sequence for using I2C

Doubt :

Should data be tapped directly from respective pins or is there any other configurations to be done.





Thanks in advance.



Logged
Pages: 1 2 3 [4] 5