ILI9341V STM32F103C8

General discussion on mikroPascal PRO for ARM.
Author
Message
Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#16 Post by Vit2 » 21 Nov 2020 13:39

The background color also flickers a lot.

Code: Select all

TFT_Write_Text('V:'+Vtxt, 80, 100);
  TFT_Set_Font(@Arial42x51_Bold, CL_BLUE, FO_HORIZONTAL);
  TFT_Write_Text('V:'+Vtxt, 80, 100);

dibor
Posts: 208
Joined: 29 Dec 2014 18:59

Re: ILI9341V STM32F103C8

#17 Post by dibor » 21 Nov 2020 15:23

Hi.
U mast to update display only if the new data exist.
Do not send same data to the display - U will see flicker.
U can try to use VisualTFT software, that can manage proper display update.
Nice program but also has many bugs.

AntiMember
Posts: 136
Joined: 02 Jan 2020 19:00

Re: ILI9341V STM32F103C8

#18 Post by AntiMember » 21 Nov 2020 16:30

Up clock of blue pill to 72MHz in config.

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#19 Post by Vit2 » 21 Nov 2020 16:51

Hello!
Did I do the right thing?
Attachments
2.PNG
2.PNG (38.96 KiB) Viewed 3396 times
1.PNG
1.PNG (39.78 KiB) Viewed 3396 times

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#20 Post by Vit2 » 21 Nov 2020 17:04

dibor wrote:
21 Nov 2020 15:23
Hi.
U mast to update display only if the new data exist.
Do not send same data to the display - U will see flicker.
U can try to use VisualTFT software, that can manage proper display update.
Nice program but also has many bugs.
If so then there is nothing

Code: Select all

  TFT_Set_Font(@Arial42x51_Bold, CL_BLUE, FO_HORIZONTAL);
TFT_Write_Text('V:'+Vtxt, 80, 100);

AntiMember
Posts: 136
Joined: 02 Jan 2020 19:00

Re: ILI9341V STM32F103C8

#21 Post by AntiMember » 21 Nov 2020 17:10

PLL input clock x 16 ??? overclocked ?
PLL input clock x 9 = 8x9=72

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#22 Post by Vit2 » 21 Nov 2020 18:05

dibor wrote:
21 Nov 2020 15:23
Hi.
U can try to use VisualTFT software, that can manage proper display update.
There is no SPI

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#23 Post by Vit2 » 21 Nov 2020 18:27

Trying Visual TFT

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#24 Post by Vit2 » 23 Nov 2020 18:49

Hello!
Does not work.

Code: Select all

VoltLabel1_Caption:=Vtxt;
DrawLabel(@VoltLabel1);

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#25 Post by Vit2 » 24 Nov 2020 08:36

Hello!
If I understood correctly, this is how the pixel redrawing in Keil is implemented.
Works great. Can I somehow rewrite it in Pascal?

Code: Select all

//-------------------------------------------------------------------
void TFT9341_DrawChar(uint16_t x, uint16_t y, uint8_t c)
{
  uint32_t i = 0, j = 0;
  uint16_t height, width;
  uint8_t offset;
  uint8_t *c_t;
  uint8_t *pchar;
  uint32_t line=0;
  height = lcdprop.pFont->Height;
  width  = lcdprop.pFont->Width;
  offset = 8 *((width + 7)/8) -  width ;
  c_t = (uint8_t*) &(lcdprop.pFont->table[(c-' ') * lcdprop.pFont->Height * ((lcdprop.pFont->Width + 7) / 8)]);
  for(i = 0; i < height; i++)
  {
    pchar = ((uint8_t *)c_t + (width + 7)/8 * i);
    switch(((width + 7)/8))
    {
      case 1:
          line =  pchar[0];      
          break;
      case 2:
          line =  (pchar[0]<< 8) | pchar[1];
          break;
      case 3:
      default:
        line =  (pchar[0]<< 16) | (pchar[1]<< 8) | pchar[2];      
        break;
    }
    for (j = 0; j < width; j++)
    {
      if(line & (1 << (width- j + offset- 1))) 
      {
        TFT9341_DrawPixel((x + j), y, lcdprop.TextColor);
      }
      else
      {
        TFT9341_DrawPixel((x + j), y, lcdprop.BackColor);
      } 
    }
    y++;      
  }
}
//-------------------------------------------------------------------
void TFT9341_String(uint16_t x,uint16_t y, char *str)
{
  while(*str)
  {
    TFT9341_DrawChar(x,y,str[0]);
    x+=lcdprop.pFont->Width;
    (void)*str++;
  }
}
void TFT9341_DrawPixel(int x, int y, uint16_t color)
{
	if((x<0)||(y<0)||(x>=TFT9341_WIDTH)||(y>=TFT9341_HEIGHT)) return;
	TFT9341_SetAddrWindow(x,y,x,y);
	TFT9341_SendCommand(0x2C);
	TFT9341_SendData(color>>8);
	TFT9341_SendData(color & 0xFF);
}
//------------------------------------------------------------------

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#26 Post by Vit2 » 25 Nov 2020 09:53

Show how to do
To update VoltLabel1 only when something appears on ADC_V
I'm already completely confused

Code: Select all

 ADC_V := ADC1_Get_Sample (0);
 Ref := 3.305 / 4095;
V :=  (Real(ADC_V) * Real(Ref)) * 11;
  FloatToStr(V, Vtxt);
Vtxt[4]:= 0;
VoltLabel1_Caption:= Vtxt;
 VoltLabel1.Font_Color:=CL_WHITE;
 DrawLabel(@VoltLabel1);
      VoltLabel1.Font_Color:=CL_BLUE;
 DrawLabel(@VoltLabel1);

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#27 Post by Vit2 » 25 Nov 2020 11:04

Understood!
I'm talking to myself.
ME don't want to help?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: ILI9341V STM32F103C8

#28 Post by filip » 25 Nov 2020 15:03

Hi,

How exactly would you like us to help ?

You are using custom TFT driver which you are trying to embed into Visual TFT code which is possible in general, but I'm not sure how to help you with this.

Regards,
Filip.

Vit2
Posts: 77
Joined: 15 Apr 2015 10:00

Re: ILI9341V STM32F103C8

#29 Post by Vit2 » 26 Nov 2020 08:39

Hello!
It is necessary to help not only me but also others.
Fix redrawing of rapidly changing characters on the display.

This doesn't fit here, flicker!

Code: Select all

 
VoltLabel1_Caption:=  Vtxt;
   VoltLabel1.Font_Color:=CL_WHITE;
 DrawLabel(@VoltLabel1);
      VoltLabel1.Font_Color:=CL_BLUE;
  DrawLabel(@VoltLabel1);
Voting is not necessary, we do not choose the head of your company!
You have to do what people ask and as you want.
Doesn't treat people like that well.

Thanks!

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: ILI9341V STM32F103C8

#30 Post by filip » 26 Nov 2020 10:00

Hi,

OK, thank you for your suggestion, we will do everything in our power to improve this.

Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for ARM General”