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 ... 5

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

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
How to read REG_ID register
« 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.
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 418
    • View Profile
Re: How to read REG_ID register
« Reply #1 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.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 771
    • View Profile
Re: How to read REG_ID register
« Reply #2 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

Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #3 on: October 05, 2021, 01:12:57 PM »

 Hi ,

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

 Thanks in advance.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 771
    • View Profile
Re: How to read REG_ID register
« Reply #4 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.
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #5 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
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
How to turn on backlight of display
« Reply #6 on: October 12, 2021, 01:32:38 PM »

 Hi,

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


Thanks in advance,
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
How to turn on backlight of display
« Reply #7 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
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 771
    • View Profile
Re: How to read REG_ID register
« Reply #8 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

Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to turn on backlight of display panel
« Reply #9 on: October 14, 2021, 05:18:54 AM »

Can u please tell me ,how to turn on backlight of display.


Thanks in advance.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 771
    • View Profile
Re: How to read REG_ID register
« Reply #10 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
Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
How to turn on backlight of display
« Reply #11 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
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 771
    • View Profile
Re: How to read REG_ID register
« Reply #12 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

Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 418
    • View Profile
Re: How to read REG_ID register
« Reply #13 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.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 771
    • View Profile
Re: How to read REG_ID register
« Reply #14 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
Logged
Pages: [1] 2 3 ... 5