Skip to main content
AMerc.4
Senior
August 7, 2020
Solved

Imperfect animation with TouchGSX

  • August 7, 2020
  • 1 reply
  • 850 views

Hello,

i'm trying to execute a simple animation with TouchGFX. I'm using the Texture Mapper image, and i want to reproduce a spin of that image. As you can see in this video it was succesfully done. However, there is an extra random flashing.

I'm using the internal FLASH memory, for now. I think the problem comes from the RAM or from DMA. The latter was configured as Register to Memory, and i enables the interrupt.

While the RAM is a 16 bit (maybe too low?).

The code to create the animation is

screenViewBase.cpp

/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/screen_screen/screenViewBase.hpp>
#include <touchgfx/Color.hpp>
#include "BitmapDatabase.hpp"
 
screenViewBase::screenViewBase()
{
 
 box1.setPosition(0, 0, 720, 720);
 box1.setColor(touchgfx::Color::getColorFrom24BitRGB(0, 0, 0));
 
 textureMapper1.setXY(180, 180);
 textureMapper1.setBitmap(touchgfx::Bitmap(BITMAP_BACK2_ID));
 textureMapper1.setWidth(360);
 textureMapper1.setHeight(360);
 textureMapper1.setBitmapPosition(0.000f, 0.000f);
 textureMapper1.setScale(1.000f);
 textureMapper1.setCameraDistance(1000.000f);
 textureMapper1.setOrigo(180.000f, 180.000f, 1000.000f);
 textureMapper1.setCamera(180.000f, 180.000f);
 textureMapper1.updateAngles(0.000f, 0.000f, 0.000f);
 textureMapper1.setRenderingAlgorithm(touchgfx::TextureMapper::NEAREST_NEIGHBOR);
 
 add(box1);
 add(textureMapper1);
}
 
void screenViewBase::setupScreen()
{
 
}

screenView.hpp

#ifndef SCREENVIEW_HPP
#define SCREENVIEW_HPP
 
#include <gui_generated/screen_screen/screenViewBase.hpp>
#include <gui/screen_screen/screenPresenter.hpp>
 
class screenView : public screenViewBase
{
public:
 screenView();
 virtual ~screenView() {}
 virtual void setupScreen();
 virtual void tearDownScreen();
 virtual void handleTickEvent();
protected:
 long tickCounter;
 float rotation;
};
 
#endif // SCREENVIEW_HPP

screenView.cpp

#include <gui/screen_screen/screenView.hpp>
 
screenView::screenView()
{
 
}
 
void screenView::setupScreen()
{
 screenViewBase::setupScreen();
 tickCounter = 0;
 rotation = 0;
}
 
void screenView::tearDownScreen()
{
 screenViewBase::tearDownScreen();
}
 
void screenView::handleTickEvent()
{
	tickCounter++;
	if(tickCounter % 30 == 0)
	{
		rotation += 0.1;
		textureMapper1.updateAngles(0.000f, rotation, 0.000f);
	}
}

I hope you can help me.

Alberto

This topic has been closed for replies.
Best answer by AMerc.4

I solved this problem scaling the LCD-TFT frequency from 48MHz to 25MHz.

However, i noticed a remerkable lag between frames, expecially when the image is full displayed. I think this is a rendering problem now. Is there a way to get this faster?

I have an STM32F767IGT microcontroller, with a 720x720 display at 18 bits (scaled to 16 bits by TouchGFX). As i said in the previous post i'm using DMA2D register to memory but i don't know if i need some extra configurations to improve performances.

1 reply

AMerc.4
AMerc.4AuthorBest answer
Senior
August 8, 2020

I solved this problem scaling the LCD-TFT frequency from 48MHz to 25MHz.

However, i noticed a remerkable lag between frames, expecially when the image is full displayed. I think this is a rendering problem now. Is there a way to get this faster?

I have an STM32F767IGT microcontroller, with a 720x720 display at 18 bits (scaled to 16 bits by TouchGFX). As i said in the previous post i'm using DMA2D register to memory but i don't know if i need some extra configurations to improve performances.