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 7416 times)

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Turning On the display
« Reply #15 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.
Logged

Geethanjali

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

Rudolph

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

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #18 on: October 19, 2021, 01:21:46 PM »

Hi,

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



Thanks in advance.
Logged

BRT Community

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

Rudolph

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Re: How to read REG_ID register
« Reply #20 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.
« Last Edit: October 19, 2021, 02:32:47 PM by Rudolph »
Logged

BRT Community

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

Logged

Geethanjali

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: How to read REG_ID register
« Reply #22 on: October 20, 2021, 05:34:11 AM »

Hi Rudolph,

I am using K32L2B3 controller and Embedded C along with Free RTOS programming.
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Re: How to read REG_ID register
« Reply #23 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?
« Last Edit: October 20, 2021, 12:01:40 PM by Rudolph »
Logged

Geethanjali

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

Rudolph

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

BRT Community

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

Rudolph

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Re: How to read REG_ID register
« Reply #27 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. :-)
« Last Edit: October 26, 2021, 10:30:17 PM by Rudolph »
Logged

Geethanjali

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

Rudolph

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Re: How to read REG_ID register
« Reply #29 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;
}
« Last Edit: October 28, 2021, 06:29:37 PM by Rudolph »
Logged
Pages: 1 [2] 3 4 5