3399 views|0 replies

1

Posts

0

Resources
The OP
 

Problems with using TFT display to display dynamic graphs in real time [Copy link]

Hello masters, I have some problems when displaying dynamic curves, as follows: The microcontroller I use is Zhengdian AtomF1Battleship version. Recently, I am working on data transmission between 32 and FPGA. In the past, FPGA took data below 2MHZ, and then used SPI communication protocol to transmit it to 32. 32 then displayed the data dynamically on the TFT display. The program I wrote myself is good when displaying low and medium frequencies, but recently I am working on high frequencies, and the external input signal is about 60MHZ. This results in 32 drawing dynamic curves. Due to too many statements executed inside 32, there is a very short time interval after 32 executes the display statement and the wipe statement. However, for high-frequency signals, there is an interruption, and the received data is not continuous. Therefore, the dynamic curve drawn is also intermittent. In layman's terms, the external transmission rate is too fast, and the internal execution speed of 32 cannot keep up (due to too many statements to be executed by 32 in the program). I would like to ask all the experts to give me some advice. The following is my program, thank you. : void showline(float led0pwmval) // This function directly calls led0pwmval for the data received from the outside { static u16 i; static u16 x=1; static u16 buf[481]; //Since I use a 480*800 TFT display, I use the horizontal axis as the X-axis of the data if(x>480) { POINT_COLOR=YELLOW; for(i=0;i<480;i++) { buf=buf[i+1]; //Realize the left shift of data } buf[480]=led0pwmval*A;//Transfer the newly received data to the last bit of the array, A is the amplification parameter of the data for(i=0;i<479;i++) { if(buf[i+1]>buf) LCD_DrawLine(i,800-buf/B,i+1,800-buf[i+1]/B);   //画线函数   B为数据的缩小参数
                        else LCD_DrawLine(i,800-buf[i+1]/B,i+1,800-buf/B);
                }
                if(i==479)//边界数据的处理
                {
                        if(buf[480]>buf[479])        LCD_DrawLine(479,800-buf[479]/B,480,800-buf[480]/B);   
                        else LCD_DrawLine(479,800-buf[480]/B,480,800-buf[479]/B);
                }
                for(i=0;i<480;i++)
                {
                        
                        if(buf[i+1]>buf)LCD_CDrawLine(i,800-buf/B,i+1,800-buf[i+1]/B);//擦线函数  将buf所存的上次数据,全部擦掉(即,改为背景色)
                        else LCD_CDrawLine(i,800-buf[i+1]/B,i+1,800-buf/B);
                }
        }
        else
                {
                        POINT_COLOR=YELLOW;
                        buf[0]=0;
                        x++;
                        delay_ms(10);
                        buf[x]=led0pwmval*A;
                        if(buf[x]>buf[x-1])        LCD_DrawLine(x-1,800-buf[x-1]/B,x,800-buf[x]/B);   
                        else LCD_DrawLine(x-1,800-buf[x]/B,x,800-buf[x-1]/B);
                        if(x==480)
                        {
                                for(x=0;x<481;x++)
                                {
                                        if(buf[x+1]>buf[x])LCD_CDrawLine(x,800-buf[x]/B,x+1,800-buf[x+1]/B);
                                        else LCD_CDrawLine(x,800-buf[x+1]/B,x+1,800-buf[x]/B);
                                }        
                        }
          }
}



This post is from stm32/stm8
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list