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

Author Topic: FT811 only draw first time  (Read 1361 times)

raydem

  • Newbie
  • *
  • Posts: 13
    • View Profile
FT811 only draw first time
« on: November 30, 2021, 01:46:34 PM »

Hello,

I posted in the other topic, but I think that it is better to open new toppic. Sorry if it is wrong.

I am working with FT811 and I achieved to draw in the display one time only. The second time, nothing happens.

Code: [Select]
Private void W32(uint8 *start, const uint32 data){
    uint8 cont = *start;

    gpDataBuffer[++cont] = (uint8)(data & 0x000000ff);
    gpDataBuffer[++cont] = (uint8)(data >> 8);
    gpDataBuffer[++cont] = (uint8)(data >> 16);
    gpDataBuffer[++cont] = (uint8)(data >> 24);

    *start = cont;
}

    Private void StaticBackground(uint16 *start){
        uint8 cont = *start;

        uint32 address =  EVE_RAM_DL; // 0x00300000;

        gpDataBuffer[cont] = (uint8)((address >> 16) | MEM_WRITE);
        gpDataBuffer[++cont] = (uint8)(address >> 8);
        gpDataBuffer[++cont] = (uint8)(address & 0x000000ff);


           if(change == 0u){
                W32(&cont, CLEAR_COLOR_RGB(0,255,255));
                W32(&cont, COLOR_RGB(255,0,0));
           }
           else{
                W32(&cont, CLEAR_COLOR_RGB(255,255,0));
                W32(&cont, COLOR_RGB(0,255,0));
           }
       
         W32(&cont, CLEAR(1,1,1));
        W32(&cont, BEGIN(EVE_POINTS));
        W32(&cont, POINT_SIZE(200));
        W32(&cont, VERTEX2II(120,120,0,0));
        W32(&cont, END());
        W32(&cont, DISPLAY());

       SendGraphicData(++cont); //Send over SPI the buffer
}

void Main(){
    uint8 change = 0u;
    Init_EVE();
    while(1){
        StaticBackground(0);
        EveMemWrite(SEND_8_BITS, REG_DLSWAP, EVE_DLSWAP_FRAME); //Send over SPI DLSWAP
        if (0u == change)
               change = 1u;
        else
               change = 0u;

        DELAY_MS(5000);
}
}
Logged

raydem

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: FT811 only draw first time
« Reply #1 on: December 01, 2021, 10:10:45 AM »

I see that if  deactive  and  active the REG_PCLK every time that I want to change of list.. It is works.. This is rigth?
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 570
    • View Profile
Re: FT811 only draw first time
« Reply #2 on: December 01, 2021, 02:04:00 PM »

Hi,

Which display settings do you use for your panel?   (HSYNC, VSYNC etc.)

If it fails on the swap then it may be your display settings. You can check REG_DLSWAP to see if it goes back to 0 after you swap,

Check that your settings meet this rule: HOFFSET < (HCYCLE – HSIZE) and VOFFSET < (VCYCLE – VSIZE).

Best Regards, BRT Community
Logged

raydem

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: FT811 only draw first time
« Reply #3 on: December 02, 2021, 09:08:41 AM »

Hi,

This is the panel settings..

Code: [Select]
#define EVE_VSIZE   (320L)  /* Tvd Number of visible lines (in lines) - display height */
#define EVE_HSIZE   (240L)  /* Thd Length of visible part of line (in PCLKs) - display width */

#define EVE_VSYNC0  (10L)    /* Tvf Vertical Front Porch */
#define EVE_VSYNC1  (12L)    /* Tvf + Tvp Vertical Front Porch plus Vsync Pulse width */
#define EVE_VOFFSET (22L)   /* Tvf + Tvp + Tvb Number of non-visible lines (in lines) */
#define EVE_VCYCLE  (343L)  /* Tv Total number of lines (visible and non-visible) (in lines) */

#define EVE_HSYNC0  (16L)   /* Thf Horizontal Front Porch */
#define EVE_HSYNC1  (36L)   /* Thf + Thp Horizontal Front Porch plus Hsync Pulse width */
#define EVE_HOFFSET (76L)   /* Thf + Thp + Thb Length of non-visible part of line (in PCLK cycles) */
#define EVE_HCYCLE  (317L)  /* Total length of line (visible and non-visible) (in PCLKs) */

#define EVE_PCLK    (10L) // 60/10 = 6 MHz
#define EVE_PCLKPOL (1L) // negative active clock edge
#define EVE_SWIZZLE (0L) // order of bits in each colour channel to be reserved.
#define EVE_CSPREAD (0L) // helps reduce the switching noise

When read the SPI any register the result is always 0x004A4342. I read  REG_ID and REG_CPURESET without problem, but the rest is always the same.
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 292
    • View Profile
Re: FT811 only draw first time
« Reply #4 on: December 02, 2021, 09:16:44 PM »

When read the SPI any register the result is always 0x004A4342. I read  REG_ID and REG_CPURESET without problem, but the rest is always the same.

You are reading the wrong bytes.
When up and running the first four bytes that are send from EVE over the SPI always are 0x00 0x4a 0x43 0x42.
This is just the reaction for the address and the dummy byte, the actual value to be read starts with the next byte.

The attached image is showing reading REG_CMDB_SPACE and 0x0ffc indicates that the FIFO is empty and the co-processor is happy.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 570
    • View Profile
Re: FT811 only draw first time
« Reply #5 on: December 03, 2021, 10:20:18 AM »

Hi Rudolph, Raydem,

Yes that's a good point Rudolph,

We have some details of how the bytes are returned in this application note below,

The code sample is a bit minimal and out of date compared to newer examples so we'll look at updating that but the diagrams in sections 6.1 and 6.2 with the data order might be helpful:
https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/BRT-AN-006-FT81x-Simple-PIC-Example.pdf

Best Regards, BRT Community

Logged

raydem

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: FT811 only draw first time
« Reply #6 on: December 09, 2021, 01:10:17 PM »

thank you, Now I can draw fine.
Logged