Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

1.3inch 65K FullColorLCD 240x240dot [ST7789V]
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 337
Location: Japan

japan.gif
PostPosted: Fri May 31, 2019 1:20 am    Post subject: 1.3inch 65K FullColorLCD 240x240dot [ST7789V] Reply with quote

Various small color LCDs used for smart watches etc. are sold.
Many of these LCD controllers are compatible devices, so it can be handled by slightly modifying the library.

Circuit diagram
https://drive.google.com/file/d/1Sg3bAcDfnX1TTHHkqau4SkWC39hGrNf3/view?usp=sharing
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6125
Location: Holland

blank.gif
PostPosted: Sat Jun 01, 2019 8:05 pm    Post subject: Reply with quote

Hello O-Family,

Thank you for this lib. Indeed these small lcd are good for many projects.
Thanks for the clear circuit and sample code Very Happy

_________________
Mark
Back to top
View user's profile Visit poster's website
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 337
Location: Japan

japan.gif
PostPosted: Mon Jan 04, 2021 11:37 am    Post subject: Reply with quote

The bug in the original [glcd-ST7735R.lib] was not fixed.
It does not work if A0=[DC] and Sclk=[SCK] are assigned to another port.
Please use the new library (libversion = 002).
Back to top
View user's profile Visit poster's website
Sarek

Bascom Member



Joined: 15 Oct 2009
Posts: 72

germany.gif
PostPosted: Mon Aug 29, 2022 9:12 am    Post subject: Reply with quote

I try to use this lib with ATXMEGA128A3U.

But I get this compiler errors:

Code:

Error : 221   Line :   231   Backward jump out of range [_CLEAR_GRAPH1 [ 86]]  , in File : C:\MCS\BASCAVR2082\LIB\GLCD-ST7789V_1R3_240X240.LIB
Error : 221   Line :   233   Backward jump out of range [_CLEAR_GRAPH2 [ 89]]  , in File : C:\MCS\BASCAVR2082\LIB\GLCD-ST7789V_1R3_240X240.LIB
Error : 221   Line :   235   Backward jump out of range [_CLEAR_GRAPH3 [ 92]]  , in File : C:\MCS\BASCAVR2082\LIB\GLCD-ST7789V_1R3_240X240.LIB
 


What can be the cause for this behaviour?
Back to top
View user's profile
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 337
Location: Japan

japan.gif
PostPosted: Tue Aug 30, 2022 1:49 am    Post subject: Reply with quote

Mrshilov's original library did not support Xmega.
Please use revision 003.
Back to top
View user's profile Visit poster's website
rezapourkia

Bascom Member



Joined: 20 Oct 2019
Posts: 8

austria.gif
PostPosted: Fri Jul 26, 2024 8:40 am    Post subject: 280*240 library for ST7789V Reply with quote

Hello
Can you please share 240*280 resolution too, the new version of this cheap LCD have this resolution
thanks
https://www.az-delivery.de/en/products/1-69-zoll-tft-display
Back to top
View user's profile
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 337
Location: Japan

japan.gif
PostPosted: Sun Jul 28, 2024 2:27 pm    Post subject: Reply with quote

That's an LCD for a smartwatch.
I think we can create a library for it, so please be patient.
Back to top
View user's profile Visit poster's website
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 337
Location: Japan

japan.gif
PostPosted: Sat Aug 31, 2024 1:20 am    Post subject: 1.69in TFT full color LCD 240x280dot [ST7789V2,V3] SPI test Reply with quote

This LCD is used in smartwatches.
As a result, the corners of the display are rounded and it is not possible to display on those parts.

The ST7789V2 controller has a faster SPI speed.
I think the ST7789V3 is a cheaper version that omits some of the interfaces.
Both boards work with the same libraries.

Circuit diagram
https://drive.google.com/file/d/1HFVl4nplMoabqQfhkadTJ30IdaXcU-qU/view?usp=drive_link

The graphic instructions (LINE, BOX, LCDAT, etc) of BASCOM-AVR are limited to byte addressing (0-255) for LCD.
To specify a position where the screen address exceeds 255, put (1) in the variable [Offset256].
An address can not be drawn across 255 and 256.
If the address specification of each instruction is 256 or more, the description of the address value is the same whether 256 or 0.

Code:

   '
   '  ***************************************
   '  *  1.69inch TFT full color LCD test   *
   '  *    240 x 280 dot [ST7789V2,V3] SPI  *
   '  *              O-Family  2024. 8.26   *
   '  ***************************************
   '

'$regfile = "m88pdef.dat"                                    'ATmega88P
$regfile = "m328pdef.dat"                                   'ATmega328P
$crystal = 8000000

$hwstack = 64
$swstack = 10
$framesize = 24

   '
   '  * Initial setting of G-LCD *
   '
   Const Portrait = 1                                       'LCD screen. (0: Landscape [X=280, Y=240], 1: Portrait [X=240, Y=280])
   Const Rotate_180 = 0                                     'LCD screen 180 degree rotation. (0: connector Upper[Right] side, 1: connector Lower[left] side)
   '
   Dim Offset256 As Byte                                    'LCD address offset flag. (0:0-255 , 1:256-279)
$lib "glcd-ST7789V2_V3_1R69_240x280.lib"                    'Incorporate the ST7789V2,V3 1.69inch 240x280 library.
   ' Designate the connection port of LCD. Sclk = [SCL], Si = [SDA], Rst = [RES], A0 = [DC], Cs1 = [CS]
   Config Graphlcd = Color , Sclk = Portd.2 , Si = Portd.3 , Rst = Portd.4 , A0 = Portd.5 , Cs1 = Portd.6       '[Cs1] and [Rst] are optional.
   Initlcd                                                  'Initialize ST7789V2,V3.
   Cls                                                      'Erase the entire screen of the G-LCD.
   Back_light Alias Portd.7                                 'LCD backlight control port.
   Set Back_light                                           'Turn on the LCD backlight.

   '
   '  * Define the color name *  [RRRG_GGBB] = [R2,R1,R0,G2_G1,G0,B1,B0]
   '
   Const Black = &B0000_0000
   Const Red = &B1110_0000
   Const Green = &B0001_1100
   Const Blue = &B0000_0011
   Const Magenta = &B1110_0011
   Const Yellow = &B1111_1100
   Const Cyan = &B0001_1111
   Const White = &B1111_1111
   '
   Const Orange = &B1110_1100
   Const Brightgreen = &B0011_1101
   Const Brightblue = &B0001_1111
   Const Darkred = &B1010_0000
   Const Darkgreen = &B0001_0000
   Const Darkblue = &B0000_0010

   '
   '  ****************
   '  * Drawing test *
   '  ****************
   '
   Dim Temp1 As Byte
   Setfont Color8x8
   '
#if Portrait = 1                                            'When placed vertically.
      Box(0 , 0) -(239 , 255) , White                       'Frame of display area.
      Boxfill(1 , 1) -(96 , 116) , &B0000_0101
      Offset256 = 1                                         'LCD address offset value. (1: 256-279)
      Boxfill(0 , 256 ) -(239 , 279) , Darkred              'Expanded area fill.
#else                                                       'When placed horizontally.
      Box(0 , 0) -(255 , 239) , White                       'Frame of display area.
      Boxfill(1 , 1) -(96 , 116) , &B0000_0001
      Offset256 = 1                                         'LCD address offset value. (1: 256-279)
      Boxfill(256 , 0 ) -(279 , 239) , Darkred              'Expanded area fill.
#endif
   '
   Offset256 = 0                                            'LCD address offset value. (0: 0-255)
   Lcdat 1 , 33 , "Red" , Red , Black                       'Text color test.
   Lcdat 9 , 25 , "Green" , Green , Black
   Lcdat 17 , 17 , "Blue" , Blue , Black
   Lcdat 25 , 9 , "Magenta" , Magenta , Black
   Lcdat 33 , 1 , "Yellow" , Yellow , Black
   Lcdat 41 , 1 , "Cyan" , Cyan , Black
   Lcdat 49 , 1 , "Orange" , Orange , Black
   Lcdat 57 , 1 , "White" , White , Black
   Lcdat 67 , 1 , "Black" , Black , White
   '
   Lcdat 77 , 1 , "Darkred" , Darkred , Black
   Lcdat 85 , 1 , "Darkgreen" , Darkgreen , Black
   Lcdat 93 , 1 , "Darkblue" , Darkblue , Black
   Lcdat 101 , 1 , "Brightgreen" , Brightgreen , Black
   '
   Boxfill(160 , 150) -(238 , 228) , Red                    '[BOX] instruction Test.
   Boxfill(185 , 175) -(213 , 203) , Green
   Box(170 , 160) -(228 , 218) , Cyan
   '
   Circle(80 , 180) , 40 , Magenta                          '[CIRCLE] instruction Test.
   Circle(80 , 180) , 20 , Yellow
   Line(20 , 180) -(140 , 180) , White
   Pset 80 , 180 , Black
   '
   For Temp1 = 1 To 106 Step 5                              '[LINE] instruction Test.
      Line(120 , 106) -(239 , Temp1) , Cyan
   Next Temp1
   '
'   Wait 3
'   Cls                                                      '[Showpic] instruction Test.
'   Showpic 0 , 0 , 5011_240_240
   '
   End

'--------------------------------------------------------------------------------------------------

   '
   '  * Font data *
   '
$include "color8x8.font"
   '
   '  * BGC data *
   '
'5011_240_240:
'$bgf "5011_240_240.BGC"
 
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6125
Location: Holland

blank.gif
PostPosted: Mon Sep 02, 2024 6:56 pm    Post subject: Reply with quote

hello O-Family

As usual a great contribution from you.
Thanks for sharing. I did not see this LCD yet but it is good to know it exists for future projects.

About restriction of byte vs word. Yes that is also still on my todo list. But as you understand it need to do it so the existing libs remain compatible.

_________________
Mark
Back to top
View user's profile Visit poster's website
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 337
Location: Japan

japan.gif
PostPosted: Tue Sep 03, 2024 3:23 am    Post subject: Reply with quote

Hi, Mark

I also thought that we needed to make the 2-byte passing compatible, so I looked for a way to do it.

For example, if you could pass 16-bit parameters using word variables such as {___GlcdX1}, {___GlcdX2}, {___GlcdY1}, {___GlcdY2}, {___GlcdFG}, and {___GlcdBG} in addition to the current Y pointer passing, it would be easy to choose whether to use 8-bit Y pointer data on the library side or 16-bit data in the new variable.

It might also be possible to extend the currently used {___lcdrow}, {___lcdcol}, {___FGCOLOR}, and {___BGCOLOR} variables.

{___lcdrow}, {___lcdrow+1}, {___lcdrow2}, {___lcdrow2+1} --- {___FGCOLOR}, {___FGCOLOR+1}, etc.
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6125
Location: Holland

blank.gif
PostPosted: Tue Sep 03, 2024 8:43 am    Post subject: Reply with quote

Hi O-Family

Passing the data is not a real problem. But the operations on the data require an additional register. And if i remember correct, they are used up.
But i will see what is most efficient. Thanks for your thoughts. I will contact you separately later.

_________________
Mark
Back to top
View user's profile Visit poster's website
boeseturbo

Bascom Member



Joined: 23 Jul 2007
Posts: 64

blank.gif
PostPosted: Fri Sep 20, 2024 11:26 pm    Post subject: Re: 1.69in TFT full color LCD 240x280dot [ST7789V2,V3] SPI t Reply with quote

Hey!


Ich habe gerade diesen erstaunlichen Artikel auf AliExpress gefunden. Probiere ihn aus!
2,94€ | 0,96 Zoll runde ips spi tft Anzeige modul 0.96 "x Pixel st7789 für Arduino/esp32/mega2560/Himbeer pi/c51/ch32/stm32

Will this also work with these cheap round ones?

Cheers


O-Family wrote:
This LCD is used in smartwatches.
As a result, the corners of the display are rounded and it is not possible to display on those parts.

The ST7789V2 controller has a faster SPI speed.
I think the ST7789V3 is a cheaper version that omits some of the interfaces.
Both boards work with the same libraries.

Circuit diagram
https://drive.google.com/file/d/1HFVl4nplMoabqQfhkadTJ30IdaXcU-qU/view?usp=drive_link

The graphic instructions (LINE, BOX, LCDAT, etc) of BASCOM-AVR are limited to byte addressing (0-255) for LCD.
To specify a position where the screen address exceeds 255, put (1) in the variable [Offset256].
An address can not be drawn across 255 and 256.
If the address specification of each instruction is 256 or more, the description of the address value is the same whether 256 or 0.

Code:

   '
   '  ***************************************
   '  *  1.69inch TFT full color LCD test   *
   '  *    240 x 280 dot [ST7789V2,V3] SPI  *
   '  *              O-Family  2024. 8.26   *
   '  ***************************************
   '

'$regfile = "m88pdef.dat"                                    'ATmega88P
$regfile = "m328pdef.dat"                                   'ATmega328P
$crystal = 8000000

$hwstack = 64
$swstack = 10
$framesize = 24

   '
   '  * Initial setting of G-LCD *
   '
   Const Portrait = 1                                       'LCD screen. (0: Landscape [X=280, Y=240], 1: Portrait [X=240, Y=280])
   Const Rotate_180 = 0                                     'LCD screen 180 degree rotation. (0: connector Upper[Right] side, 1: connector Lower[left] side)
   '
   Dim Offset256 As Byte                                    'LCD address offset flag. (0:0-255 , 1:256-279)
$lib "glcd-ST7789V2_V3_1R69_240x280.lib"                    'Incorporate the ST7789V2,V3 1.69inch 240x280 library.
   ' Designate the connection port of LCD. Sclk = [SCL], Si = [SDA], Rst = [RES], A0 = [DC], Cs1 = [CS]
   Config Graphlcd = Color , Sclk = Portd.2 , Si = Portd.3 , Rst = Portd.4 , A0 = Portd.5 , Cs1 = Portd.6       '[Cs1] and [Rst] are optional.
   Initlcd                                                  'Initialize ST7789V2,V3.
   Cls                                                      'Erase the entire screen of the G-LCD.
   Back_light Alias Portd.7                                 'LCD backlight control port.
   Set Back_light                                           'Turn on the LCD backlight.

   '
   '  * Define the color name *  [RRRG_GGBB] = [R2,R1,R0,G2_G1,G0,B1,B0]
   '
   Const Black = &B0000_0000
   Const Red = &B1110_0000
   Const Green = &B0001_1100
   Const Blue = &B0000_0011
   Const Magenta = &B1110_0011
   Const Yellow = &B1111_1100
   Const Cyan = &B0001_1111
   Const White = &B1111_1111
   '
   Const Orange = &B1110_1100
   Const Brightgreen = &B0011_1101
   Const Brightblue = &B0001_1111
   Const Darkred = &B1010_0000
   Const Darkgreen = &B0001_0000
   Const Darkblue = &B0000_0010

   '
   '  ****************
   '  * Drawing test *
   '  ****************
   '
   Dim Temp1 As Byte
   Setfont Color8x8
   '
#if Portrait = 1                                            'When placed vertically.
      Box(0 , 0) -(239 , 255) , White                       'Frame of display area.
      Boxfill(1 , 1) -(96 , 116) , &B0000_0101
      Offset256 = 1                                         'LCD address offset value. (1: 256-279)
      Boxfill(0 , 256 ) -(239 , 279) , Darkred              'Expanded area fill.
#else                                                       'When placed horizontally.
      Box(0 , 0) -(255 , 239) , White                       'Frame of display area.
      Boxfill(1 , 1) -(96 , 116) , &B0000_0001
      Offset256 = 1                                         'LCD address offset value. (1: 256-279)
      Boxfill(256 , 0 ) -(279 , 239) , Darkred              'Expanded area fill.
#endif
   '
   Offset256 = 0                                            'LCD address offset value. (0: 0-255)
   Lcdat 1 , 33 , "Red" , Red , Black                       'Text color test.
   Lcdat 9 , 25 , "Green" , Green , Black
   Lcdat 17 , 17 , "Blue" , Blue , Black
   Lcdat 25 , 9 , "Magenta" , Magenta , Black
   Lcdat 33 , 1 , "Yellow" , Yellow , Black
   Lcdat 41 , 1 , "Cyan" , Cyan , Black
   Lcdat 49 , 1 , "Orange" , Orange , Black
   Lcdat 57 , 1 , "White" , White , Black
   Lcdat 67 , 1 , "Black" , Black , White
   '
   Lcdat 77 , 1 , "Darkred" , Darkred , Black
   Lcdat 85 , 1 , "Darkgreen" , Darkgreen , Black
   Lcdat 93 , 1 , "Darkblue" , Darkblue , Black
   Lcdat 101 , 1 , "Brightgreen" , Brightgreen , Black
   '
   Boxfill(160 , 150) -(238 , 228) , Red                    '[BOX] instruction Test.
   Boxfill(185 , 175) -(213 , 203) , Green
   Box(170 , 160) -(228 , 218) , Cyan
   '
   Circle(80 , 180) , 40 , Magenta                          '[CIRCLE] instruction Test.
   Circle(80 , 180) , 20 , Yellow
   Line(20 , 180) -(140 , 180) , White
   Pset 80 , 180 , Black
   '
   For Temp1 = 1 To 106 Step 5                              '[LINE] instruction Test.
      Line(120 , 106) -(239 , Temp1) , Cyan
   Next Temp1
   '
'   Wait 3
'   Cls                                                      '[Showpic] instruction Test.
'   Showpic 0 , 0 , 5011_240_240
   '
   End

'--------------------------------------------------------------------------------------------------

   '
   '  * Font data *
   '
$include "color8x8.font"
   '
   '  * BGC data *
   '
'5011_240_240:
'$bgf "5011_240_240.BGC"
 
Back to top
View user's profile
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 337
Location: Japan

japan.gif
PostPosted: Sat Sep 21, 2024 12:48 am    Post subject: Reply with quote

I think it will work with the 1.3inch 240x240dot ST7789V library on this thread.
glcd-ST7789V_1R3_240x240.lib [revision 003]
or
glcd-ST7789V2_V3_1R69_240x280.lib

If you have any problems, I think I can help.
Back to top
View user's profile Visit poster's website
boeseturbo

Bascom Member



Joined: 23 Jul 2007
Posts: 64

blank.gif
PostPosted: Sat Sep 21, 2024 6:48 am    Post subject: Reply with quote

O-Family wrote:
I think it will work with the 1.3inch 240x240dot ST7789V library on this thread.
glcd-ST7789V_1R3_240x240.lib [revision 003]
or
glcd-ST7789V2_V3_1R69_240x280.lib

If you have any problems, I think I can help.


Thank u very much. I have ordered two pcs and give it a try 😃...

Cheers
Back to top
View user's profile
boeseturbo

Bascom Member



Joined: 23 Jul 2007
Posts: 64

blank.gif
PostPosted: Mon Sep 23, 2024 11:40 am    Post subject: Reply with quote

O-Family wrote:
I think it will work with the 1.3inch 240x240dot ST7789V library on this thread.
glcd-ST7789V_1R3_240x240.lib [revision 003]
or
glcd-ST7789V2_V3_1R69_240x280.lib

If you have any problems, I think I can help.


Hey O-family,

did you also worked with GC9A01? This display is bit bigger than this one I show above Smile

Cheers
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum