View previous topic :: View next topic |
Author |
Message |
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu May 02, 2019 9:00 am Post subject: |
|
|
thanks for this useful addition. _________________ Mark |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat May 18, 2019 9:51 am Post subject: |
|
|
thanks for this useful addition and sharing it. _________________ Mark |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Tue Jan 05, 2021 1:57 am Post subject: |
|
|
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).
Last edited by O-Family on Tue Jan 05, 2021 2:53 am; edited 1 time in total |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Tue Jan 05, 2021 2:52 am Post subject: |
|
|
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 |
|
|
Dave
Joined: 05 Feb 2005 Posts: 314 Location: OR
|
Posted: Sat Oct 01, 2022 12:53 am Post subject: |
|
|
Thank you Mrshilov and O-Family for sharing these libs.
I'm using a O-Family ST7735S lib and I would like some help with fonts.
The color8x8.font work but I don't know how to create other fonts. I have tried font16x16.font and other fonts but they show as mixed up as seen in 16x16 pictured below.
My question is how do I create fonts for the ST7735S?
Code: |
'
' **************************************
' * 0.96inch 65K full color LCD test *
' * 160 x 80 dot [ST7735S] SPI *
' * O-Family 2021. 1. 5 *
' **************************************
'
$regfile = "m168def.dat"
$crystal = 8000000
$baud = 38400
$hwstack = 64
$swstack = 10
$framesize = 24
print version(3)
'
' * Initial setting of G-LCD *
'
$lib "glcd-ST7735S_160x80.lib" 'Incorporate the ST7735S 160x80 library.
'Designate the connection port of LCD. Cs1 = [CS] , A0 = [DC] , Rst = [RSE] , Si = [SDA] , Sclk = [SCL]
'Config Graphlcd = Color , A0 = Portd.5 , Rst = Portd.6 , Si = Portd.4 , Sclk = Portd.7 '[Cs1] and [Rst] are optional.
Config Graphlcd = Color , A0 = Portd.5 , Cs1 = Portd.3, Rst = Portd.6 , Si = Portd.4 , Sclk = Portd.7
Const Portrait = 0 'LCD screen. (0: Landscape [X=160, Y=80], 1: Portrait [X=80, Y=160])
Const Rotate_180 = 1 'LCD screen 180 degree rotation. (0: connector Lower side, 1: connector Upper side)
Cls 'Erase the entire screen of the G-LCD.
'For some reason, that I don't understand,
'my ST7735S colors are inverted.
Const White = &B0000_0000
Const Blue = &B1111_1100
Const Black = &B1111_1111
Const Magenta = &B0001_1100
'setfont Alpha_20p29x21
'setfont font16x16
Setfont Color8x8 'Only font that worked.
Lcdat 5 , 10 , "123" , blue , white
Lcdat 30 , 10 , "456" , Black , White
Lcdat 50 , 10 , "789" , Magenta , white
End
$include "color8x8.font"
'$include "font16x16.font"
'$include "Arial.font" |
|
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
|
Back to top |
|
|
Dave
Joined: 05 Feb 2005 Posts: 314 Location: OR
|
Posted: Sat Oct 01, 2022 4:44 pm Post subject: |
|
|
Thank you O-Family.
I now understand a little more about color fonts. From the post you linked to color fonts must be multiples of 8. So 8x8, 16x16 is ok but for example 10x12 would not work. Do I have that right? Or is that a limitation of your converter? |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Sun Oct 02, 2022 2:21 am Post subject: |
|
|
This is because the original library only supports fonts that are multiples of 8 dots.
Color LCDs take a long time to draw, so I think this is to simplify the coordinate calculation even a little to increase the drawing speed. |
|
Back to top |
|
|
Dave
Joined: 05 Feb 2005 Posts: 314 Location: OR
|
Posted: Tue Jan 10, 2023 4:49 am Post subject: |
|
|
Hello Mrshilov & O-Family,
I'm having a problem compiling for ATxmega32e5 part. I get the same error that enniom reported.
Error : 221 Line : 219 Backward jump out of range [_CLEAR_GRAPH1 [ 86]] , in File :...
I've tried all versions and I get the same error. What am I doing wrong? Here is example code:
Code: | $crystal = 32000000
$regfile = "xm32E5def.dat"
$hwstack = 100
$swstack = 100
$framesize = 100
$lib "xmega.lib"
CONFIG SUBMODE = NEW
Config Osc = Disabled , 32mhzosc = Enabled
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1 ' we will use 32 MHz and divide by 1 to end up with 32 MHz
Config Priority = Static , Vector = Application , Lo = Disabled , Med = Enabled , Hi = Disabled
'
' * Initial setting of G-LCD *
'
Const Portrait = 0 'LCD screen. (0: Landscape [X=160, Y=128], 1: Portrait [X=128, Y=160])
Const Rotate_180 = 1 'LCD screen 180 degree rotation. (0: connector Upper side, 1: connector Lower side)
$lib "glcd-ST7735S_1R8_128x160.lib" 'Incorporate the ST7735S 1.8inch 128x160 library.
'$lib "glcd-ST7735R.lib"
Config Graphlcd = Color , Cs1 = Portd.0 , Rst = Portd.6 , A0 = Portd.7 , Si = Portd.5 , Sclk = Portd.4 '[Cs1] and [Rst] are optional.
Initlcd
Cls
end
'Both Libs above gererate this error.
'Error : 221 Line : 219 Backward jump out of range [_CLEAR_GRAPH1 [ 86]] , in File : C:\MCS\BASCAVR2085\LIB\GLCD-ST7735R.LIB
'Error : 221 Line : 219 Backward jump out of range [_CLEAR_GRAPH1 [ 86]] , in File : C:\MCS\BASCAVR2085\LIB\GLCD-ST7735S_1R8_128X160.LIB
|
Thanks,
Dave |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Tue Jan 10, 2023 6:48 am Post subject: |
|
|
Please wait a moment as the library needs to be modified for Xmega. |
|
Back to top |
|
|
Dave
Joined: 05 Feb 2005 Posts: 314 Location: OR
|
Posted: Tue Jan 10, 2023 8:31 pm Post subject: |
|
|
Thank you.
I just noticed from help that the E5 series virtual ports are fixed.
Quote: | noticeSome processors like the ones from the E5 series have a fixed relation. These chips have virtual port registers (port,ddr,pin) and do not need a CONFIG VPORT).For the E5 this relation is :
PORT0 - Virtual port A
PORT1 - Virtual port C
PORT2 - Virtual port D
PORT3 - Virtual port R
|
Could that be the problem? |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Wed Jan 11, 2023 12:30 am Post subject: |
|
|
Fixed the library for Xmega. [revision 004]
please try it. |
|
Back to top |
|
|
Dave
Joined: 05 Feb 2005 Posts: 314 Location: OR
|
Posted: Wed Jan 11, 2023 1:28 am Post subject: |
|
|
Yes it works great. Thank you! |
|
Back to top |
|
|
|