News:

Let's find out together what makes a PIC Tick!

Main Menu

Universal Graphic Library

Started by atomix, Mar 09, 2022, 05:05 PM

Previous topic - Next topic

atomix

Yes, this file is safe. I wrote this LangMF scripting language.

Craig

Atomix it Loads the File after I have restored it from Norton Antivirus but then all I can do is as shown on the PDF. It loads a NotePad Page with a lot of garbled junk but, that is all I can do there ins't anywhere else that gives an option to run a different program Any help is very much appreciated LangMF.pdf

atomix

After installing LangMF_setup.exe, you can run files with scripts (which have *.mf extension)


Craig

Thank you VERY Much Atomix that works Absolutely Brilliantly!
Regards
Craig

Craig

How Visible are these Displays when exposed to Direct Sunlight?
How Good are the Displays from this Estardyn Supplier on AliExpress? 
EstarDyn GLCD Display Aliexpress.pdf
Thank you for your Feedback?
Kind Regards
Craig

Dompie

@Craig I think it is better to start a new thread because this thread is for @atomix his UGL, problem solving and new releases.

Johan

Amateurtje

For a test I have bought a 4.0'' ST7796 and a 3.5'' ILI9488 screen.. Ofcourse I should have looked which screen was supported but I am very new in this stuff.

I tried with the existing drivers for the ILI9486 and almost all others but I do not seem to get it to work...

anybody a good idea? Can I change the existing drivers?

PS, Can I use 5V. in the specs it states 5V for the Vcc but for the signals it is not very explicit... Maybe I already just destroyed the screens although i get sometimes some strange images on my 4.0'' screen.

tumbleweed

Both of those chips are 3.3V supply and logic, but it would depend on the board.

Amateurtje

#148
I thought so..

oke, At least my 4.0 still works because I get with the settings of LCD_USE_TFT_280_240_320 the testscreen on the screen, although somewhere in the middle and turned 90 degree.. :).. for the final design, i will make sure the levels match with the specs. :) Or I build a level shifter on my board or make sure i buy them with level shifters integrated....

I have been searching if I could match the existing drivers with the specs I can find to understand it and make new driver but my understanding of these scripts are for sure not good enough  :(  :(  This is really deep stuff and my compliments to atomix....

EDIT; All those bigger displays are parallel displays, I think.. This ili9488 and ST7796v are serial displays...

EDIT2:
When copying the LCD_USE_TFT_280_240_320 section and reanaming it and just setting Word 240 to 480 I get the next code and picture. I feel I get closer.

 Anybody an idea how to "Start" at the beginning of the screen?? How to get the screen/display move to the left? Probably something in the code below, but what....

$ifdef LCD_USE_TFT_400_480_320
    TBL_New(_TFT_400_480_320_)
        TBL_Raw(LCD_T_MAIN)     CData Word 480, Word 320, LCD_INI(2, 0, LCD_CAP_NOPULSE)
        TBL_Raw(LCD_T_ROTN)     CData LCD__MX | LCD__BGR,  LCD__MV | LCD__BGR,  LCD__MY | LCD__BGR,  LCD__MV | LCD__MX | LCD__MY | LCD__BGR
        TBL_Raw(LCD_T_LIST)     CData LCD_CMD_IDLEOF,   0,                                                                      _  ' Exit idle mode (ST7796)
                                LCD_CMD_VCOMCTR1,       2,  $3E, $28,                                                           _  ' VCOM control 1
                                LCD_CMD_VCOMCTR2,       1,  $86,                                                                _  ' VCOM control 1
                                LCD_CMD_DFUNCTR,        3,  $08, $82, $27,                                                      _  ' Display Fuction set 5
                                LCD_CMD_FRMCTR1,        2,  $00, $10,                                                           _  ' Frame Rate Control (In normal mode)
                                LCD_CMD_GAMMASET,       1,  $01,                                                                _  ' Default gamma curve?
                                LCD_CMD_GAMRSEL,        1,  $00,                                                                _  ' Enable Gamma adj ?
                                LCD_CMD_PGAMMAC,       15,  $0F,$31,$2B,$0C,$0E,$08,$4E,$F1,$37,$07,$10,$03,$0E,$09,$00,        _  ' Positive Gamma Correction Setting
                                LCD_CMD_NGAMMAC,       15,  $00,$0E,$14,$03,$11,$07,$31,$C1,$48,$08,$0F,$0C,$31,$36,$0F,        _  ' Negative Gamma Correction Setting
                                LCD_CMD_DINVCTR,        1,  7,                                                                  _  ' Display inversion
                                LCD_CMD_NORML,          0,                                                                      _  ' Display Normal
                                LCD_CMD_PWCTR1,         1,  $23,                                                                _  ' Power Control 1
                                LCD_CMD_PWCTR2,         1,  $10,                                                                _  ' Power Control 2
                                $EF,                    3,  $03, $80, $02,                                                      _
                                $CF,                    3,  $00, $C1, $30,                                                      _
                                $E8,                    3,  $85, $00, $78,                                                      _
                                $ED,                    4,  $64, $03, $12, $81,                                                 _
                                $CB,                    5,  $39, $2C, $00, $34, $02,                                            _
                                $EA,                    2,  $00, $00,                                                           _
                                $F7,                    1,  $20
    TBL_End
$endif

LCD_400_480_320.jpg

PS, Colors are not correct yet but I did not look into that yet.. That is for later..

flosigud

My guess is that you need to revive how the MADCTL register is set. I only have experience with ST7735 and ILI9341 and for me the same driver works for both by amending the MADCTL. I think you correct the colors thaat way too.

Amateurtje

Quote from: flosigud on Sep 12, 2023, 11:30 AMMy guess is that you need to revive how the MADCTL register is set. I only have experience with ST7735 and ILI9341 and for me the same driver works for both by amending the MADCTL. I think you correct the colors thaat way too.

Thanks for the reply.. But this is a command which is not set at the driver, isn't it? Then the driver would not be generic anymore when I change that (for me, no problem, but I think this is not how Atomix would od it , I assume :))

But I am going to try to change that value as a test.

Thanks

flosigud

Read up how it should be set. Make another command rather than changing an existing one.

atomix

#152
Add a coordinate offset setting:

TBL_Raw(LCD_T_OFFS)    CData 2, 1,  1, 2,  2, 3,  3, 2        ' Offset (X0,Y0,  X1,Y1,  X2,Y2,  X3,Y3)
To select the color and orientation of the display, you can experiment with this:

TBL_Raw(LCD_T_ROTN)     CData LCD__MX,  LCD__MV,  LCD__MY,  LCD__MV | LCD__MX | LCD__MY                   ' orientation for 4 display layout modes
Here's another page that explains in more detail what's what.

https://focuslcds.com/landscape-and-portrait-modes-for-tfts-fan4218/

Amateurtje

Quote from: atomix on Sep 13, 2023, 11:56 AMAdd a coordinate offset setting:

TBL_Raw(LCD_T_OFFS)    CData 2, 1,  1, 2,  2, 3,  3, 2        ' Offset (X0,Y0,  X1,Y1,  X2,Y2,  X3,Y3)
To select the color and orientation of the display, you can experiment with this:

TBL_Raw(LCD_T_ROTN)    CData LCD__MX,  LCD__MV,  LCD__MY,  LCD__MV | LCD__MX | LCD__MY                  ' orientation for 4 display layout modes

Hi Atomix,

Thanks. But this offset makes the test picture move in the black area instead of shifting the black area.. But it does not diminish the white area.


I just found a solution:
What does diminish the white are is:
LCD_CMD_DFUNCTR,        3,  $08, $82, $27,                                                      _  ' Display Fuction set 5
Changed to:
LCD_CMD_DFUNCTR,        3,  $08, $82, $7B,                                                      _  ' Display Fuction set 5

NOw I will start playing with the colors and see if it is stable..

Many thanks to all untill now.

atomix

You should use the following declaration:

TBL_Raw(LCD_T_MAIN)    CData Word 320, Word 480, LCD_INI(2, 0, LCD_CAP_NOPULSE)


For reference:
'----------------------------------------------------------------------------
' Setup initial configuration for display
' Input    : P1 holds the rotation value (0 to 3)
'          : P2 holds the address of I2C display
'          : P3 holds the capabilities of display
$define LCD_INI(P1,P2,P3)      Word (P2 << 8) + P3 + (P1 & 3)

Amateurtje

Quote from: atomix on Sep 13, 2023, 12:24 PMYou should use the following declaration:
TBL_Raw(LCD_T_MAIN)    CData Word 320, Word 480, LCD_INI(2, 0, LCD_CAP_NOPULSE)


Changing  only that still gives me the white area but if I keep my improvement (changing the LCD_CMD_DFUNCTR value), it still fills the screen... Only it divides it into two (placing the beginning up side down after the normal screen) (picture: 320x480).

While with my original:
TBL_Raw(LCD_T_MAIN)    CData Word 320, Word 480, LCD_INI(2, 0, LCD_CAP_NOPULSE)

It displays nicely (picture: 480x320)

But if this is not correct for any reason, please let me know. You are the specialist.

Should I use the 320x480 setting like you say, Maybe another thing to diminish the white area instead of changing the  "LCD_CMD_DFUNCTR" value (please help me with that if necessary) and place the picture in another way over the black screen area?

Amateurtje

#156
Playing around with the colors, some things changed again..

with this code it works in the correct color:
'----------------------------------------------------------------------------
$ifdef LCD_USE_TFT_400_480_320
    TBL_New(_TFT_400_480_320_)
        TBL_Raw(LCD_T_MAIN)    CData Word 480, Word 320, LCD_INI(0, 0, LCD_CAP_NOPULSE)
        TBL_Raw(LCD_T_ROTN)    CData LCD__MX,LCD__MY,LCD__MV,      LCD__MX | LCD__MY |  LCD__MV
        TBL_Raw(LCD_T_LIST)    CData LCD_CMD_IDLEOF,  0,                                                                      _  ' Exit idle mode (ST7796)
                                LCD_CMD_VCOMCTR1,      2,  $3E, $28,                                                          _  ' VCOM control 1
                                LCD_CMD_VCOMCTR2,      1,  $86,                                                                _  ' VCOM control 1
                                LCD_CMD_DFUNCTR,        3,  $08, $82, $7B,                                                      _  ' Display Fuction set 5
                                LCD_CMD_FRMCTR1,        2,  $00, $10,                                                          _  ' Frame Rate Control (In normal mode)
                                LCD_CMD_GAMMASET,      1,  $01,                                                                _  ' Default gamma curve?
                                LCD_CMD_GAMRSEL,        1,  $00,                                                                _  ' Enable Gamma adj ?
                                LCD_CMD_PGAMMAC,      15,  $0F,$31,$2B,$0C,$0E,$08,$4E,$F1,$37,$07,$10,$03,$0E,$09,$00,        _  ' Positive Gamma Correction Setting
                                LCD_CMD_NGAMMAC,      15,  $00,$0E,$14,$03,$11,$07,$31,$C1,$48,$08,$0F,$0C,$31,$36,$0F,        _  ' Negative Gamma Correction Setting
                                LCD_CMD_DINVCTR,        1,  7,                                                                  _  ' Display inversion
                                LCD_CMD_NORML,          0,                                                                      _  ' Display Normal
                                LCD_CMD_PWCTR1,        1,  $23,                                                                _  ' Power Control 1
                                LCD_CMD_PWCTR2,        1,  $10,                                                                _  ' Power Control 2
                                $EF,                    3,  $03, $80, $02,                                                      _
                                $CF,                    3,  $00, $C1, $30,                                                      _
                                $E8,                    3,  $85, $00, $78,                                                      _
                                $ED,                    4,  $64, $03, $12, $81,                                                _
                                $CB,                    5,  $39, $2C, $00, $34, $02,                                            _
                                $EA,                    2,  $00, $00,                                                          _
                                $F7,                    1,  $20

    TBL_End
$endif
'----------------------------------------------------------------------------

Chaning the P1 in:
        TBL_Raw(LCD_T_MAIN)    CData Word 480, Word 320, LCD_INI(0, 0, LCD_CAP_NOPULSE)
does not do a lot.. at least: it starts wit hdifferent rotation (it looks like 1 frame) and then it turns again.. MAybe there is something in the rest of the script regarding orientation.. as far as I rememeber I only changed the SPI pins but nothing else..

EDIT : YES, there is in the example code :
  LCD_Rotation(0)

EDIT2:

Anybody an idea why my compiler is not showing the errors with compiling this script? With other script I get "Results" when receiving an error..


atomix


Amateurtje

Hi All,

I have made a big font (Height = 36) with only numbers. In need to display numbers in the middle top part of the screen.. I already use a scalefactor of 2. If I take a smaller font, I need to use a bigger scalefactor which does not make a nice (round) font...

To get rid of the characters in front and back when lowering the displayed number (less characters), I need to add a lot of spaces... (the number cna drop from 100.000 to 0 in 1 step..). These spaces increase the string amount ofcourse.

To get it in the middle I calculate the starting point based on the font_width and the screen width)..

PROBLEM:
- The print command of these big numbers (including spaces, but also without) is very slow.

QUESTIONS:
- Is there a better way to get rid of the "old numbers" which are displayed besides the numbers I need to display (without a kind of refresh that makes the screen flicker)
- Is there a way to speed up the printing? I already use the 64Mhz internal OSC setting.
 

atomix

In SPI operating mode, data is transferred very slowly. The only option is to use the 8-bit 8080 interface.