BRT Community

General Category => General Discussion => Topic started by: Geethanjali on September 29, 2021, 10:23:32 AM

Title: How to read REG_ID register
Post by: Geethanjali on September 29, 2021, 10:23:32 AM
Hi ,


I understand I should read REG_ID value till it returns 0x7c in the document , can u provide any example for that, or any known good value to check the working of display.
Title: Re: How to read REG_ID register
Post by: Rudolph on September 29, 2021, 10:28:38 PM
Reading from REG_ID already is reading a value that is known to be good.
The initialisation sequence is in the programming manual, EVE will not even answer on the SPI if there is no ACTIVE command first and even after the ACTIVE command it needs time to start.

There are a couple of libraries to talk to EVE but of course I advertise for my own.  8)
https://github.com/RudolphRiedel/FT800-FT813

Check out EVE_init() in EVE_commands.c for one example to bring up EVE.
Title: Re: How to read REG_ID register
Post by: BRT Community on September 30, 2021, 09:44:00 AM
Hi Geethanjali,

Yes, as you mentioned Rudolph, there are a few steps needed to start-up EVE correctly including setting the clock settings (if you need them to be different from default) and then the active command followed by the read of REG_ID and awaiting the REG_CPU_RESET == 0;

There is a recommended start-up in the Programmers guide for whichever version of EVE which you use and also in the sample code and so you can use these for reference.

Here is an example waveform attached where we read the REG_ID. This is a BT816 in this case,

We take CS low to begin the transfer,
Then send the three byte address of REG_ID from the programmers guide with the most significant 2 bits as '0' which indicates to EVE that we are doing a read
Then send a dummy 0x00 byte (this only applies when doing a read)
And then a dummy 0x00 byte to get the result back. We are only interested in the data coming back on MISO
And finally, CS high again to end the transfer

Best Regards, BRT Community

Title: Re: How to read REG_ID register
Post by: Geethanjali on October 05, 2021, 01:12:57 PM
 Hi ,

 What might be the reason for getting only 0 on MISO Line?

 Thanks in advance.
Title: Re: How to read REG_ID register
Post by: BRT Community on October 05, 2021, 04:41:10 PM
Hello,

It may be that you have read the register value before the EVE IC has booted correctly.

We would recommend the following procedure on boot, note the while loop when reading REG_ID:

Code: [Select]
    MCU_PDlow();                                                                // PD low                                                               
    MCU_Delay_20ms();
    MCU_PDhigh();                                                               // PD high
    MCU_Delay_20ms();
 
    Set ext clock here if required
    MCU_Delay_20ms();

    EVE_CmdWrite(FT81x_ACTIVE, 0x00);                                           // Sends 00 00 00 to wake FT8xx
   
    MCU_Delay_500ms();                                                          // 500ms delay (EVE requires at least 300ms here))
       
    // --------------- Check that FT81x ready and SPI comms OK -----------------
   
    while (EVE_MemRead8(REG_ID) != 0x7C)                                        // Read REG_ID register until reads 0x7C
    {
    }
     
    while (EVE_MemRead8(REG_CPURESET) != 0x00)                                  // Ensure CPUreset register reads 0 and so FT81x is ready   
    {
    }

Best Regards,
BRT Community.
Title: Re: How to read REG_ID register
Post by: Geethanjali on October 11, 2021, 08:16:50 AM
Hi ,

Can u please provide snapshot of REG_CPURESET

I am able to get 0x7C received on MISO line the next step is should i get 0x00 on same line to check EVE is working?

Thanks in advance
Title: How to turn on backlight of display
Post by: Geethanjali on October 12, 2021, 01:32:38 PM
 Hi,

Can u please specify how to turn on backlight of display ?


Thanks in advance,
Title: How to turn on backlight of display
Post by: Geethanjali on October 13, 2021, 12:19:02 PM
Can u please provide commands to turn on backlight of display
 
is there any GPIO pin to be set for that how is PWM duty cycle and frequency register to be set in this regard?

what and all to be set GPIO registers and PWM registers ?


Thanks in advance
Title: Re: How to read REG_ID register
Post by: BRT Community on October 13, 2021, 01:18:07 PM
Hi,

It will depend on which display you have and which EVE family device you use,

The Programmers guide for your EVE device will have details of the start-up sequence e.g. see section 2.4 if you use BT81x
https://brtchip.com/wp-content/uploads/2021/09/BRT_AN_033_BT81X-Series-Programming-Guide.pdf

It is also best to check the documentation for your module as it may have additional requirements.

Here is a rough start-up sequence just as a guide,


Code: [Select]
// Reset the display
MCU_Delay_20ms();
HAL_PowerDown(1);
MCU_Delay_20ms();
HAL_PowerDown(0);
MCU_Delay_20ms();

#if (defined EVE1_ENABLE)
// FT80x_selection - FT80x modules generally use external crystal
// You can also send the host command to set the PLL here if you want to change it from the default of 48MHz (FT80x) or 60MHz (FT81x)
// Clock selection and clock rate selection will put EVE to sleep and so must be before the Active command
// for example:
HAL_HostCmdWrite(0x44, 0x00); // 0x44 = HostCMD_CLKEXT
HAL_HostCmdWrite(0x62, 0x00); // 0x64 = HostCMD_CLK48M
#endif

#if defined (EVE3_ENABLE) || defined (EVE4_ENABLE)
// can optionally set to 72MHz system clock here
// In this case also adjust REG_FREQUENCY a few lines down from here in this file
HAL_HostCmdWrite(0x44, 0x00); // 0x44 = HostCMD_CLKEXT
HAL_HostCmdWrite(0x61, 0x46);
#endif

#if defined (EVE2_ENABLE) || defined (EVE3_ENABLE)|| defined (EVE4_ENABLE)
HAL_HostCmdWrite(0x68, 0x00); // Reset
#endif


// Set active
HAL_HostCmdWrite(0, 0x00);

// MCU_Delay_500ms(); // Optional delay can be commented so long as we check the REG_ID and REG_CPURESET

// Read REG_ID
while ((val = HAL_MemRead8(EVE_REG_ID)) != 0x7C)
{
}

// Ensure CPUreset register reads 0 and so FT8xx is ready
while (HAL_MemRead8(EVE_REG_CPURESET) != 0x00)
{
}

#if defined (EVE3_ENABLE) || defined (EVE4_ENABLE)
HAL_MemWrite32(EVE_REG_FREQUENCY, 72000000);
#endif

// LCD display parameters
// Active width of LCD display
HAL_MemWrite16(EVE_REG_HSIZE,   EVE_DISP_WIDTH);
// Total number of clocks per line
HAL_MemWrite16(EVE_REG_HCYCLE,  EVE_DISP_HCYCLE);
// Start of active line
HAL_MemWrite16(EVE_REG_HOFFSET, EVE_DISP_HOFFSET);
// Start of horizontal sync pulse
HAL_MemWrite16(EVE_REG_HSYNC0,  EVE_DISP_HSYNC0);
// End of horizontal sync pulse
HAL_MemWrite16(EVE_REG_HSYNC1,  EVE_DISP_HSYNC1);
// Active height of LCD display
HAL_MemWrite16(EVE_REG_VSIZE,   EVE_DISP_HEIGHT);
// Total number of lines per screen
HAL_MemWrite16(EVE_REG_VCYCLE,  EVE_DISP_VCYCLE);
// Start of active screen
HAL_MemWrite16(EVE_REG_VOFFSET, EVE_DISP_VOFFSET);
// Start of vertical sync pulse
HAL_MemWrite16(EVE_REG_VSYNC0,  EVE_DISP_VSYNC0);
// End of vertical sync pulse
HAL_MemWrite16(EVE_REG_VSYNC1,  EVE_DISP_VSYNC1);
// Define RGB output pins
HAL_MemWrite8(EVE_REG_SWIZZLE,  EVE_DISP_SWIZZLE);
// Define active edge of PCLK
HAL_MemWrite8(EVE_REG_PCLK_POL, EVE_DISP_PCLKPOL);
// Turn on or off CSpread
HAL_MemWrite8(EVE_REG_CSPREAD,  EVE_DISP_CSPREAD);
// Turn on or off Dither
HAL_MemWrite8(EVE_REG_DITHER,  EVE_DISP_DITHER);



// Write first display list
HAL_MemWrite32((EVE_RAM_DL + 0), EVE_ENC_CLEAR_COLOR_RGB(0,0,0));
HAL_MemWrite32((EVE_RAM_DL + 4), EVE_ENC_CLEAR(1,1,1));
HAL_MemWrite32((EVE_RAM_DL + 8), EVE_ENC_DISPLAY());
HAL_MemWrite8(EVE_REG_DLSWAP, EVE_DLSWAP_FRAME);


// Read the  GPIO register for a read/modify/write operation
regGpio = HAL_MemRead8(EVE_REG_GPIO);
// set bit 7 of  GPIO register (DISP) - others are inputs
regGpio = regGpio | 0x80;
// Enable the DISP signal to the LCD panel
HAL_MemWrite8(EVE_REG_GPIO, regGpio);



// Write the PCLK or PCLK_FREQ register
// If setting PCLK_FREQ then also set REG_PCLK to 1 to enable extsync mode
#if (defined EVE4_ENABLE) && (defined SET_PCLK_FREQ)
HAL_MemWrite16(EVE_REG_PCLK_FREQ,  EVE_DISP_PCLK_FREQ);
HAL_MemWrite8(EVE_REG_PCLK, 1);
# else
// Now start clocking data to the LCD panel
HAL_MemWrite8(EVE_REG_PCLK, EVE_DISP_PCLK);
#endif


HAL_MemWrite8(EVE_REG_PWM_DUTY, 127);

// ---------------------- Touch and Audio settings -------------------------

// Eliminate any false touches
HAL_MemWrite16(EVE_REG_TOUCH_RZTHRESH, 1200);

// turn recorded audio volume down
HAL_MemWrite8(EVE_REG_VOL_PB, EVE_VOL_ZERO);
// turn synthesizer volume down
HAL_MemWrite8(EVE_REG_VOL_SOUND, EVE_VOL_ZERO);
// set synthesizer to mute
HAL_MemWrite16(EVE_REG_SOUND, 0x6000);

// --------------------- Clear screen ready to start -----------------------
EVE_LIB_BeginCoProList();
EVE_CMD_DLSTART();
EVE_CLEAR_COLOR_RGB(0, 0, 0);
EVE_CLEAR(1,1,1);
EVE_DISPLAY();
EVE_CMD_SWAP();
EVE_LIB_EndCoProList();
EVE_LIB_AwaitCoProEmpty();


    #if (defined EVE2_ENABLE || defined EVE3_ENABLE || defined EVE4_ENABLE)

// ---------------------- Reset all bitmap properties ------------------------
EVE_LIB_BeginCoProList();
EVE_CMD_DLSTART();
EVE_CLEAR_COLOR_RGB(0, 0, 0);
EVE_CLEAR(1,1,1);
for (i = 0; i < 16; i++)
{
EVE_BITMAP_HANDLE(i);
EVE_CMD_SETBITMAP(0,0,0,0);
}
EVE_DISPLAY();
EVE_CMD_SWAP();
EVE_LIB_EndCoProList();
EVE_LIB_AwaitCoProEmpty();
# else
   

    // ---------------------- Reset all bitmap properties ------------------------
EVE_LIB_BeginCoProList();
EVE_CMD_DLSTART();
EVE_CLEAR_COLOR_RGB(0, 0, 0);
EVE_CLEAR(1,1,1);
for (i = 0; i < 16; i++)
{
EVE_BITMAP_HANDLE(i);
//EVE_CMD_SETBITMAP(0,0,0,0);
        EVE_BITMAP_LAYOUT(0, 0, 0);
    EVE_BITMAP_SIZE(0, 0, 0, 0, 0);
}
EVE_DISPLAY();
EVE_CMD_SWAP();
EVE_LIB_EndCoProList();
EVE_LIB_AwaitCoProEmpty();
#endif

Best Regards, BRT Community

Title: Re: How to turn on backlight of display panel
Post by: Geethanjali on October 14, 2021, 05:18:54 AM
Can u please tell me ,how to turn on backlight of display.


Thanks in advance.
Title: Re: How to read REG_ID register
Post by: BRT Community on October 15, 2021, 02:06:01 PM
Hi,

Which module do you use? It may depend on the hardware design,

Best Regards, BRT Community
Title: How to turn on backlight of display
Post by: Geethanjali on October 18, 2021, 07:15:47 AM
Hi ,

I am using RVT70HSBNWC00-B (BT817Q) display. Can u please provide me steps to turn on backlight of display is there any particular pin that needs to be configured?


Thanks in advance
Title: Re: How to read REG_ID register
Post by: BRT Community on October 18, 2021, 02:47:31 PM
Hi,

The module datasheet does not have the full schematic in order to confirm if any specific GPIO are used but it looks like just the REG_PWM_HZ and REG+PWM_DUTY that you need to set,

REG_PWM_HZ is already defaulting to 250 and so writing a value of 128 to REG_PWM_DUTY should set full brightness. You could check with Riverdi to see if any particular frequency is recommended and if so could also set REG_PWM_HZ if needed.

Make sure that you have your Vdd and BLVdd connected up correctly as per the datasheet as you will need these powered up according to the spec recommended by Riverdi to see the backlight illuminate.  Make sure that your power supply can supply sufficient current too,

Best Regards, BRT Community

Title: Re: How to read REG_ID register
Post by: Rudolph on October 18, 2021, 09:27:06 PM
I have the RVT70HSBNWC00-B up and running on my desk, it is supported by my library.
It needs no special treatment so yes, writing to REG_PWM_DUTY sets the backlight-PWM.
I am only using a value of 0x18 though since the display is very bright.
Title: Re: How to read REG_ID register
Post by: BRT Community on October 19, 2021, 07:59:27 AM
Hi,

One other thing I forgot to mention was to ensure you set the DISP pin, this is bit 15 of the REG_GPIOX_DIR and REG_GPIO_X. See page 48 below.

https://brtchip.com/wp-content/uploads/2021/09/BRT_AN_033_BT81X-Series-Programming-Guide.pdf

Best Regards, BRT Community
Title: Turning On the display
Post by: Geethanjali on October 19, 2021, 11:00:23 AM
Hi ,
Thanks for your response , but can u provide small snippet of code to use GPIO registers , I am doing it as per the instruction provided in datasheet , i am able to read 0x7c and read REG_CPURESET till it returns 0 , but still backlight isnt enabled yet . I have set the Display pin too (bit 15 of GPIOX_DIR and GPIOX as the instruction provided)
Could you please provide me with that .

Thanks in advance.
Title: Re: How to read REG_ID register
Post by: Geethanjali on October 19, 2021, 11:05:30 AM
Hi,

I am able to read 0x7c and read CPURESET register till it returns 0 , but am unable to turn the backlight on, I have set the disp pin 15th bit also (REG_GPIOX_DIR,GPIOX) , but still its not getting turned on, could you please provide me snippet of code which is required to turn on backlight. I am currently using RVT70HSBNWC00-B (BT817Q) display.



Thanks in advance
Title: Re: How to read REG_ID register
Post by: Rudolph on October 19, 2021, 11:41:38 AM
Its all here: https://github.com/RudolphRiedel/FT800-FT813
And as I wrote, including support for the RVT70HSBNWC00-B.

Which controller are you using and what programming language?
Title: Re: How to read REG_ID register
Post by: Geethanjali on October 19, 2021, 01:21:46 PM
Hi,

Which Register to be used for enabling backlight? GPIOX or GPIO?



Thanks in advance.
Title: Re: How to read REG_ID register
Post by: BRT Community on October 19, 2021, 01:23:59 PM
Hi,
GPIO was for the original EVE devices and is retained for backward compatibility,  but GPIOX is an extended one on later versions. Therefore, unless you need backward compatibility you can use the GPIOX ones.
Best Regards, BRT Community
Title: Re: How to read REG_ID register
Post by: Rudolph on October 19, 2021, 02:14:06 PM
The BACKLIGHT pin is not a GPIO pin, it is output only.
You could only control the drive strength of the BACKLIGHT pin and this is not necessary for the RVT70HSBNWC00-B.
So you only need to write to REG_PWM_DUTY.

You could change the direction of the DISP pin but reset-default is output so there is no need for that either.

And since I am obviously ignored, I am out.
Title: Re: How to read REG_ID register
Post by: BRT Community on October 19, 2021, 03:22:34 PM
Hi Geethanjali,
Recommend to check the hardware connections as it might be that there is some issue there if you are using the start-up routines which work well for Rudolph

Hi Rudolph,
Not at all, you're giving very good advice and help as always.
Quote
And since I am obviously ignored, I am out.

Best Regards, BRT Community

Title: Re: How to read REG_ID register
Post by: Geethanjali on October 20, 2021, 05:34:11 AM
Hi Rudolph,

I am using K32L2B3 controller and Embedded C along with Free RTOS programming.
Title: Re: How to read REG_ID register
Post by: Rudolph on October 20, 2021, 11:22:38 AM
Ok nice, so I am not ignored, excellent.  :D

>K32L2B3 controller

This is a new one for me so it is not directly supported by my library, yet.
As my library is meant to be highly portable, most of it is plain C.

Combining an Ultra-Low-Power MCU with a 7" sunlight readable TFT seems to be an odd choice. :-)

I am thinking about ordering a FRDM-K32L2B3‎ anyways, just for the challenge.  :)
What are you programming the controller with, MCUXpresso?


So, since the RVT70HSBNWC00-B provides a bit of an electrical challenge as opposed to a smaller display, what are you using to connect the K32L2B3 with the display? A board of your own design or perhaps a shield since the FRDM-K32L2B3 claims to have UNO R3 compatible headers?

When I finally got a RVT101HVBNWC00-B I had to design a new PCB for it including two step-down regulators.
And when I got the RVT70HSBNWC00-B I only populated one of these boards with the backlight voltage reduced to 5V.
The RVT70HSBNWC00-B datasheet shows 362mA for the backlight at 5V and 235mA for the logic at 3.3V.
Which is far less than what the RVT101HVBNWC00-B draws but enough to be an issue.
And my boards are using glue-logic to improve the possible SPI clock as shown here:
https://github.com/RudolphRiedel/EVE_display-adapter/tree/master/L-D5019-01-05

Annother thought, have you checked the SPI with a logic-analyzer?
And reduced the SPI clock to 4MHz or less?
Title: Re: How to read REG_ID register
Post by: Geethanjali on October 21, 2021, 01:29:23 PM
 Hi Rudolph,

Yes , I am using MCUXpresso for coding . Yes I have also checked the data with logic analyser SPI I am able to read 0x7c.

Thanks in advance.
Title: Re: How to read REG_ID register
Post by: Rudolph on October 22, 2021, 11:33:02 AM
I received the FRDM-K32K2B3 today.  :)
I see if I can make it work with my library, I am not sure though if I can really use it with the RVT70HSBNWC00-B since my display adapters that I can use only have a single 3.3V stepdown regulator.
Well, I can make it work with an EVE3-50G first and worry about that later.
Title: Re: How to read REG_ID register
Post by: BRT Community on October 22, 2021, 01:53:50 PM
Hi,

We used an NXP K64 FRDM as a porting guide for our BRT_AN_025 code although it was on the older Kinetis Design Studio.

Its still under test and could be optimised on the MCU specific part but it does run, Here is the code in case its of any help,

We had to remove the includes folder due to the attachment size but these were all the standard ones included with a new K64 project,

Best Regards, BRT Community
Title: Re: How to read REG_ID register
Post by: Rudolph on October 26, 2021, 10:12:17 PM
After quite some pain with MCUXpresso itself and the K32 SDK from NXP it starts to work now.
I have a project that I can not yet share here since it currently compresses to 522k.
For now I just share what I have  in the "source" drawer of that project, everything else is added by MCUXpresso.

I currently have a RiTFT43 attached to and adapter-board and that adapter-board to the FRDM-K32L2B3.
And it works, including touch.
Writing this, thinking about why I did not connect the RVT70H, I may be even able to do that as well,
all I really need to do for it is to suply the backlight with an extra PSU.
But apart from the electrical issue I fully expect it to work.

The extra code for my library is here: https://github.com/RudolphRiedel/FT800-FT813/tree/5_plus
This is my current working branch and it expects the define for the display to be used to be set externally.
So in this case I added the symbol (-D) "EVE_RiTFT43" in the project settings and will change that to "EVE_RVT70H".

More specifically the only part that actually is changed is EVE_target.h, line 1153 has a section now for
the K32L2B31VLH0A controller that is on the FRDM-K32L2B3 board.
There is no DMA support, yet.
And the functions spi_transmit() and spi_receive() have both a register based version and a sdk driver version with the register based version active for spi_transmit() and the sdk driver version active for spi_receive().
The difference is ~680ns for the bare-metal version to ~1.4µs for the sdk version.
Not a bad result for the sdk driver, I have seen way worse, but not really good either.
And the need to use SPI_GetStatusFlags() when calling SPI_WriteData() and SPI_ReadData() is odd.

So adding 120 lines is all it took to "port" my library to the K32L2B3 and not even half of that is really code.
There will be some more to support DMA but not by much.

Edit: I just tried it with the external PSU and it works with the RVT70H as well. :-)
Title: Re: How to read REG_ID register
Post by: Geethanjali on October 28, 2021, 01:42:48 PM
Hi Rudolph,

Thanks for the reply this gave me a lead.
Did u send the commands to this display for turning on as specified in the Programming manual ?


Thanks in advance.
Title: Re: How to read REG_ID register
Post by: Rudolph on October 28, 2021, 06:22:09 PM
As I wrote, you do have my init-sequence, it is in EVE_init() of EVE_commands.c.  ;)

But yes, for the most part I am initializing EVE as described in the programming guide,
only a bit faster and with timeouts instead of endless loops to allow starting without a display
attached or not correctly working SPI.
Oh yes, and I configure the BT81x to run at 72MHz instead of the default 60MHz.

Here is a slightly shortened version as it would be executed for the RVT70H:

Code: [Select]
uint8_t EVE_init(void)
{
uint8_t chipid = 0;
uint16_t timeout = 0;

EVE_pdn_set();
DELAY_MS(6); /* minimum time for power-down is 5ms */
EVE_pdn_clear();
DELAY_MS(21); /* minimum time to allow from rising PD_N to first access is 20ms */

EVE_cmdWrite(EVE_CLKEXT,0); /* setup EVE for external clock */
EVE_cmdWrite(EVE_CLKSEL,0x46); /* set clock to 72 MHz */
EVE_cmdWrite(EVE_ACTIVE,0); /* start EVE */

DELAY_MS(40);

while(chipid != 0x7C) /* if chipid is not 0x7c, continue to read it until it is, EVE needs a moment for its power on self-test and configuration */
{
DELAY_MS(1);
chipid = EVE_memRead8(REG_ID);
timeout++;
if(timeout > 400)
{
return 0;
}
}

timeout = 0;
while (0x00 != (EVE_memRead8(REG_CPURESET) & 0x07)) /* check if EVE is in working status */
{
DELAY_MS(1);
timeout++;
if(timeout > 50) /* experimental, 10 was the lowest value to get the BT815 started with, the touch-controller was the last to get out of reset */
{
return 0;
}
}

/* tell EVE that we changed the frequency from default to 72MHz for BT8xx */
EVE_memWrite32(REG_FREQUENCY, 72000000);

EVE_memWrite8(REG_PWM_DUTY, 0); /* turn off backlight */

/* Initialize Display */
EVE_memWrite16(REG_HSIZE,   EVE_HSIZE);   /* active display width */
EVE_memWrite16(REG_HCYCLE,  EVE_HCYCLE);  /* total number of clocks per line, incl front/back porch */
EVE_memWrite16(REG_HOFFSET, EVE_HOFFSET); /* start of active line */
EVE_memWrite16(REG_HSYNC0,  EVE_HSYNC0);  /* start of horizontal sync pulse */
EVE_memWrite16(REG_HSYNC1,  EVE_HSYNC1);  /* end of horizontal sync pulse */
EVE_memWrite16(REG_VSIZE,   EVE_VSIZE);   /* active display height */
EVE_memWrite16(REG_VCYCLE,  EVE_VCYCLE);  /* total number of lines per screen, including pre/post */
EVE_memWrite16(REG_VOFFSET, EVE_VOFFSET); /* start of active screen */
EVE_memWrite16(REG_VSYNC0,  EVE_VSYNC0);  /* start of vertical sync pulse */
EVE_memWrite16(REG_VSYNC1,  EVE_VSYNC1);  /* end of vertical sync pulse */
EVE_memWrite8(REG_SWIZZLE,  EVE_SWIZZLE); /* FT8xx output to LCD - pin order */
EVE_memWrite8(REG_PCLK_POL, EVE_PCLKPOL); /* LCD data is clocked in on this PCLK edge */
EVE_memWrite8(REG_CSPREAD, EVE_CSPREAD); /* helps with noise, when set to 1 fewer signals are changed simultaneously, reset-default: 1 */

/* do not set PCLK yet - wait for just after the first display list */

/* configure Touch */
EVE_memWrite8(REG_TOUCH_MODE, EVE_TMODE_CONTINUOUS); /* enable touch */
EVE_memWrite16(REG_TOUCH_RZTHRESH, EVE_TOUCH_RZTHRESH); /* eliminate any false touches */

/* disable Audio for now */
EVE_memWrite8(REG_VOL_PB, 0x00); /* turn recorded audio volume down */
EVE_memWrite8(REG_VOL_SOUND, 0x00); /* turn synthesizer volume off */
EVE_memWrite16(REG_SOUND, 0x6000); /* set synthesizer to mute */

/* write a basic display-list to get things started */
EVE_memWrite32(EVE_RAM_DL, DL_CLEAR_RGB);
EVE_memWrite32(EVE_RAM_DL + 4, (DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG));
EVE_memWrite32(EVE_RAM_DL + 8, DL_DISPLAY); /* end of display list */
EVE_memWrite32(REG_DLSWAP, EVE_DLSWAP_FRAME);

/* nothing is being displayed yet... the pixel clock is still 0x00 */

uint32_t frequency;
frequency = EVE_cmd_pclkfreq(EVE_PCLK_FREQ, 0); /* setup the second PLL for the pixel-clock according to the define in EVE_config.h for the display, as close a match as possible */
if(frequency == 0) /* this failed for some reason so we return with an error */
{
return 0;
}

EVE_memWrite8(REG_GPIO, 0x80); /* enable the DISP signal to the LCD panel, it is set to output in REG_GPIO_DIR by default */
EVE_memWrite8(REG_PCLK, EVE_PCLK); /* now start clocking data to the LCD panel */

EVE_memWrite8(REG_PWM_DUTY, 0x20); /* turn on backlight to 25% */

timeout = 0;
while(EVE_busy() == 1) /* just to be safe, should not even enter the loop */
{
DELAY_MS(1);
timeout++;
if(timeout > 4)
{
break; /* something is wrong here, but since we made it this far through the init, just leave the loop */
}
}

#if defined (EVE_DMA)
EVE_init_dma(); /* prepare DMA */
#endif

return 1;
}
Title: Re: How to read REG_ID register
Post by: Geethanjali on November 08, 2021, 09:47:25 AM
Hi Rudolph,

I was able to turn on the backlight thanks for your help.
As a next step I need to load a screen can you help me in doing that like if there are any small snippet that i can load and check , I have used EVE editor and developed a screen using that tool . It would be helpful if u can provide me with small code snippet or any example.
Are there any steps to be followed to load the bitmap?

Thanks in advance.
Title: Re: Commands to load an icon or image
Post by: Geethanjali on December 06, 2021, 09:05:21 AM
Hi Rudolph,

Can u please tell what is the command sequence that I should use in order to load an icon or image , I use FRDM K32L board.



thanks in advance.
Title: Re: How to read REG_ID register
Post by: Rudolph on December 06, 2021, 11:00:37 PM
Hello,

I am a bit buried in work lately and did not go back to use my FRDM K32L board.
But you habe what I got so far and with which I got the board up and running.
Check the tft.c from the source archive I attached.
Title: Loading an image
Post by: Geethanjali on December 10, 2021, 04:07:35 AM
Hi Rudolph , thanks for your reply

 Currently I am trying to load an raw array of an PNG format image , can u please provide me steps to be followed , should I use CMD_LOADIMAGE command , I am bit confused in sending the commands , Could you please provide me the sequence of commands that has to be sent. I am not using flash to load an image will that be okay.


Thanks in advance.
Title: Re: How to read REG_ID register
Post by: Rudolph on December 12, 2021, 09:28:27 PM
Check TFT_init() in tft.c, this is the same as in my repository:
https://github.com/RudolphRiedel/FT800-FT813/blob/5.x/examples/EVE_Test_Arduino_PlatformIO/src/tft.c

I have two images stored in tft_data.c:
https://github.com/RudolphRiedel/FT800-FT813/blob/5.x/examples/EVE_Test_Arduino_PlatformIO/src/tft_data.c

The first is a converted image in ARGB1555 format which zlib compressed with EAB and is loaded with:
 EVE_cmd_inflate(MEM_LOGO, logo, sizeof(logo));

The second is a .jpg image which is loaded with:
 EVE_cmd_loadimage(MEM_PIC1, EVE_OPT_NODL, pic, sizeof(pic));

Yes, loading a .png file as raw unconverted data is done with CMD_LOADIMAGE as well.

My EVE_cmd_loadimage() now looks like this (simplified):

Code: [Select]
void EVE_cmd_loadimage(uint32_t ptr, uint32_t options, const uint8_t *data, uint32_t len)
{
    uint32_t ftAddress;

    ftAddress = REG_CMDB_WRITE;
    EVE_cs_set();
    spi_transmit((uint8_t)(ftAddress >> 16) | MEM_WRITE); /* send Memory Write plus high address byte */
    spi_transmit((uint8_t)(ftAddress >> 8)); /* send middle address byte */
    spi_transmit((uint8_t)(ftAddress & 0x000000ff)); /* send low address byte */

    spi_transmit_32(CMD_LOADIMAGE);
    spi_transmit_32(ptr);
    spi_transmit_32(options);
    EVE_cs_clear();

    block_transfer(data, len);
}

The block_transfer() function sends the data in chunks of 3840 bytes to the command FIFO and waits for the command co-processor to empty the FIFO. Why 3840? No strict binding reason, this is just 15 x 256.
But the FIFO can only hold 4096 bytes, so we need to make sure to not overshoot this.

I advise against using PNG directly though.
EVE is rather picky about the format the PNG is saved with, although this can be tested with EAB.

Then EVE needs quite some time to process PNG.
I did a test withe the ugly star image from my demo a while back.
It has 3867 bytes as .png and 3903 bytes as .jpg.
Processing with a FT813 took 53 ms for the PNG and 480 µs for the JPG, that is a factor of 110.

Maybe BT81x are better with PNG but it does not really matter since BT81x can use ASTC compressed images.
And ASTC 8x8 for example uses only 2 bits per pixel and still comes with alpha channel, so even when only running from RAM_G your images need 1/8 of storage space.

So as you are using a BT816, I recommend using ASTC instead.
Title: Image not getting displayed properly
Post by: Geethanjali on December 16, 2021, 07:28:28 AM
Hi Rudolph thanks for your reply,

I am uploading an ARGB1555 format image , The image is getting uploaded but it looks empty without colours like its completely blank with correct resolution and x and y cordinates , can u please help me with where is the mistake. What I should correct .


Thanks in advance.


Title: Re: How to read REG_ID register
Post by: BRT Community on December 16, 2021, 02:37:40 PM
Hi,

Which format is your ARGB1555 image in? Is it the raw data (e.g. the .raw or .rawh from EVE Asset Builder) or is it a bin file which you are inflating with CMD_INFLATE?

Best Regards, BRT Community
Title: Re: How to read REG_ID register
Post by: Rudolph on December 16, 2021, 04:51:29 PM
Exactly what I wanted to ask.  :)

And then I have to note that this forum is a bit akward to use for more lively discussions due to the strict moderation.
Well, it is what it is and without moderation this forum would be flooded with spam.

Anyways, if you feel like I could answer your question you could also open a new discussion here: https://github.com/RudolphRiedel/FT800-FT813/discussions

Or add a post here: https://www.mikrocontroller.net/topic/395608
Also there is a good chance that your question already was answered in the thread somewhere. :-)
Title: Image not getting displayed properly
Post by: Geethanjali on December 17, 2021, 04:04:32 AM
Hi,


It is in PNG format, It is the raw data (.rawh file from EVE Screen Editor) . I am using a 7.0" Inch  RVT70HSBNWC00-B display.




Thanks in advance.
Title: Re: How to read REG_ID register
Post by: Rudolph on December 17, 2021, 03:46:19 PM
Ah ok, so just raw converted data, so neither CMD_LOADIMAGE or CMD_INFLATE are suitable for this.
This requires a direct memory transfer and I have two helper functions for this:

/* helper function, write a block of memory from the FLASH of the host controller to EVE */
void EVE_memWrite_flash_buffer(uint32_t ftAddress, const uint8_t *data, uint32_t len)

/* helper function, write a block of memory from the SRAM of the host controller to EVE */
void EVE_memWrite_sram_buffer(uint32_t ftAddress, const uint8_t *data, uint32_t len)

These are only different when using a Harvard architecture like AVR.
And "ftAddress" is the address for EVE, so usually somewhere in RAM_G.

I recommend using EVE Asset Builder for converting images though. It also comes with an "ASSET COMPRESSOR" module and a "BIN2C" module.
Title: Touch register - tag value
Post by: Geethanjali on January 03, 2022, 01:23:11 PM
Hi Rudolph,

Thanks for your reply , Can you please help me in Touch related function like since I am new to touch related activities in this display , I am quite confused . Can u please provide me the sequence of the commands to be sent . I tried reading Touch Tag Register ( REG_TOUCH_TAG) and Co-ordinates of that particular register (REG_TOUCH_TAG_XY) , I am getting wrong co-ordinate values . It would be helpful if u can help me in this .
It would be more helpful if I can get any examples to understand.

Once I  assign each graphical object with tag value , they are getting assigned as 0 , TAG(0) in EVE editor is that right?
For example - I have 3 objects if i assign them with tag value it is all 0 through EVE editor tool TAG(0).

I am using Riverdi (RVT70HSBNWC00-B) - BT817


Thanks in advance.
Title: Re: How to read REG_ID register
Post by: Rudolph on January 05, 2022, 01:06:17 PM
There really is not much to it, for the most part you assign a tag-value and when an object is touched this value is reported in REG_TOUCH_TAG.
And then there are more options like multi-point-touch and sliders and so on, but this the next step.

So, the TAG command, a value of zero is invalid, valid range is 1 to 255 and default value is 255.

A display list like this:

Code: [Select]
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")

Should produce a tag-value of zero if you touch anywhere except the second, third and fourth dot, plus the first "Text".
It should only produce a tag-valu of 10 if you touch the second dot.
It should only produce a tag-valu of 11 if you touch the third dot.
It should only produce a tag-valu of 12 if you touch either the fourth dot or the first "Text".

So this tag value applies to a single object or to a whole group of objects.

If you are not getting the tag values when you are touching the objects then your touch interface is not calibrated.
Try to touch somewhere else, to find out if there is for example an offset to left and up.
This offset is due to misalignment between the touch rasterizer and the display.

To calibrate the touch you use CMD_CALIBRATE which will present you with three dots to click on after annother.
After this new calibration values are used and stored in registers REG_TOUCH_TRANSFORM_A ... REG_TOUCH_TRANSFORM_F.
You can read the values in these registers and either store these for example in an EEPROM by your software or put them directly in your code, so after that you only need to write these values back in the registers at startup.
Title: Re: How to read REG_ID register
Post by: Geethanjali on January 07, 2022, 05:55:39 AM
Hi Rudolph , thanks for your reply

I am not sure how to tag the graphical objects in EVE screen editor , could you please help me in that ? also is there any sequence for TOUCH registers to be configured and with what values since I am not clear on calibration part ,
Is that like I should use CMD_CALIBRATE command first and read the REG_TOUCH_TAG and calibration registers , I am using a capacitive touch .

Thanks in advance.
Title: Re: How to read REG_ID register
Post by: Rudolph on January 07, 2022, 10:21:45 AM
The sequence above is for the EVE Screen Editor.
So the way to tag objects is just to set a tag-value and everything after that gets this tag-value.
And when you switch to the "Inspector" Tab on the bottom you can scroll down in the RAM_REG window a little to show REG_TOUCH_TAG.
Now switch in the toolbar above from from the arrow for "Context dependent cursor" to the hand for "Use the cursor to touch the emulated display" and you can see REG_TOUCH_TAG changing according to the display list.

As for the calibration, check my example code: https://github.com/RudolphRiedel/FT800-FT813/blob/5.x/examples/EVE_Test_SAMC21_EVE2-50G/tft.c
The tft.c is the same for every example across all the platforms and different displays.
I have a function touch_calibrate():

Code: [Select]
void touch_calibrate(void)
{

/* send pre-recorded touch calibration values, depending on the display the code is compiled for */

...

#if defined (EVE_RVT70)
    EVE_memWrite32(REG_TOUCH_TRANSFORM_A, 0x000074df);
    EVE_memWrite32(REG_TOUCH_TRANSFORM_B, 0x000000e6);
    EVE_memWrite32(REG_TOUCH_TRANSFORM_C, 0xfffd5474);
    EVE_memWrite32(REG_TOUCH_TRANSFORM_D, 0x000001af);
    EVE_memWrite32(REG_TOUCH_TRANSFORM_E, 0x00007e79);
    EVE_memWrite32(REG_TOUCH_TRANSFORM_F, 0xffe9a63c);
#endif

...

/* activate this if you are using a module for the first time or if you need to re-calibrate it */
/* write down the numbers on the screen and either place them in one of the pre-defined blocks above or make a new block */
#if 0
    /* calibrate touch and displays values to screen */
    EVE_cmd_dl(CMD_DLSTART);
    EVE_cmd_dl(DL_CLEAR_RGB | BLACK);
    EVE_cmd_dl(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG);
    EVE_cmd_text((EVE_HSIZE/2), 50, 26, EVE_OPT_CENTER, "Please tap on the dot.");
    EVE_cmd_calibrate();
    EVE_cmd_dl(DL_DISPLAY);
    EVE_cmd_dl(CMD_SWAP);
    while (EVE_busy()) {};

    uint32_t touch_a, touch_b, touch_c, touch_d, touch_e, touch_f;

    touch_a = EVE_memRead32(REG_TOUCH_TRANSFORM_A);
    touch_b = EVE_memRead32(REG_TOUCH_TRANSFORM_B);
    touch_c = EVE_memRead32(REG_TOUCH_TRANSFORM_C);
    touch_d = EVE_memRead32(REG_TOUCH_TRANSFORM_D);
    touch_e = EVE_memRead32(REG_TOUCH_TRANSFORM_E);
    touch_f = EVE_memRead32(REG_TOUCH_TRANSFORM_F);

    EVE_cmd_dl(CMD_DLSTART);
    EVE_cmd_dl(DL_CLEAR_RGB | BLACK);
    EVE_cmd_dl(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG);
    EVE_cmd_dl(TAG(0));

    EVE_cmd_text(5, 15, 26, 0, "TOUCH_TRANSFORM_A:");
    EVE_cmd_text(5, 30, 26, 0, "TOUCH_TRANSFORM_B:");
    EVE_cmd_text(5, 45, 26, 0, "TOUCH_TRANSFORM_C:");
    EVE_cmd_text(5, 60, 26, 0, "TOUCH_TRANSFORM_D:");
    EVE_cmd_text(5, 75, 26, 0, "TOUCH_TRANSFORM_E:");
    EVE_cmd_text(5, 90, 26, 0, "TOUCH_TRANSFORM_F:");

    EVE_cmd_setbase(16L);
    EVE_cmd_number(310, 15, 26, EVE_OPT_RIGHTX|8, touch_a);
    EVE_cmd_number(310, 30, 26, EVE_OPT_RIGHTX|8, touch_b);
    EVE_cmd_number(310, 45, 26, EVE_OPT_RIGHTX|8, touch_c);
    EVE_cmd_number(310, 60, 26, EVE_OPT_RIGHTX|8, touch_d);
    EVE_cmd_number(310, 75, 26, EVE_OPT_RIGHTX|8, touch_e);
    EVE_cmd_number(310, 90, 26, EVE_OPT_RIGHTX|8, touch_f);

    EVE_cmd_dl(DL_DISPLAY); /* instruct the co-processor to show the list */
    EVE_cmd_dl(CMD_SWAP); /* make this list active */
    while (EVE_busy()) {};

    while(1);
#endif
}

This is just the most simplified version of how calibrating the touch could look like.
If the code is activated it just does the calibration and prints the values on the screen.

And having these values in the source-code is just the most portable way to do this.

If I had a series of devices with production over a longer period, I would add a calibration menu and find a way to store the values at runtime in the system, for example in an EEPROM. But this would no longer be portable.
Title: Re: Touch
Post by: Geethanjali on January 10, 2022, 09:11:01 AM
Hi Rudolph thanks for your reply , I am able to tag values
 
Problem I am facing right now is I am not able to read the tag value its 0 everytime . I have calibrated the screen also like I used calibrate command read values from EVE editor and I used that for writing the registers ( REG_TOUCH_TRANSFORM_A till F) for startup.


Could you please help me in this.
Thanks in advance.
Title: Re: How to read REG_ID register
Post by: BRT Community 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

Title: Re: How to read REG_ID register
Post by: Geethanjali 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..
Title: Re: How to read REG_ID register
Post by: Rudolph 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.
Title: Re: How to read REG_ID register
Post by: Geethanjali 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
Title: Re: How to read REG_ID register
Post by: Geethanjali 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..
Title: Re: How to read REG_ID register
Post by: BRT Community 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);
   }
Title: Re: How to read REG_ID register
Post by: Geethanjali 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.
Title: Re: How to read REG_ID register
Post by: Geethanjali 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.
Title: Re: How to read REG_ID register
Post by: Rudolph 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.
Title: Calibration of touch
Post by: Geethanjali 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.
Title: Re: How to read REG_ID register
Post by: Rudolph 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.

Title: Re: How to read REG_ID register
Post by: Geethanjali 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
Title: Re: How to read REG_ID register
Post by: Rudolph 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.
Title: Re: How to read REG_ID register
Post by: BRT Community 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
Title: Re: How to read REG_ID register
Post by: Geethanjali 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.



Title: Re: How to read REG_ID register
Post by: BRT Community on February 07, 2022, 03:12:23 PM
Hi,

We can capture and post an example of a waveform,

One thing to check in the meantime is whether your CTP gives a low pulse on INT when you touch the screen. This low on the INT line tells the I2C Master (EVE) to generate clocks to read the data.

Also, are you using it in compatibility mode (which is set by default) rather than multi-touch?

Is your screen part of a full module (e.g. Riverdi EVE 4) or is it a touch screen panel that is separate and which you connect to your own EVE PCB?   

Best Regards, BRT Community

Title: Re: How to read REG_ID register
Post by: Rudolph on February 07, 2022, 04:24:38 PM
This is the same display as in my post here: http://www.brtcommunity.com/index.php?topic=352.msg1728#msg1728
So I already measured the I2C and still have the setup on my desk.

Important points:
- without touch there is nothing on the I2C lines, you need to touch it to see traffic
- the CTP is not configured or even verified to be there by the BT817 upon reset
- the CTP (usually) just works with the default settings in compatibility mode, no settings required

And what you did not mention, did you check your supply voltages?
The RVT70HSBNWC00-B needs 235mA @ 3.3V for the logic and that only is the typical but not the maximum value.
And it needs 362mA @ 5V or 1086mA @ 3,3V for the backlight at 100%, again not the maximum values.
So depending on your available source voltage your voltage regulators need to be rather beefy.
I am using two stepdown regulators with 1,2A rating, one for each rail.
And I usually set the voltages a little higher to allow for a bit of drop over the FFC.
So my 3.3V rail for the logic is actually supplying 3.36V.
And my 5V rail for the backlight is actually supplying 5.35V.
In addition I have a 4.7µF directly placed at the logic supply pin of the FFC connector.




Title: Re: How to read REG_ID register
Post by: Geethanjali on February 08, 2022, 06:57:44 AM
Hi ,

I tried to check the CTP (INT line) it is not giving a low pulse when I touch the screen .
I am using the compatibility mode only which is by default , I did not make any changes.
Yes the screen is part of full module EVE 4 . Its not separate.

Can you please help me resolve this

Thanks in advance.