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++)
{