View previous topic :: View next topic |
Author |
Message |
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Wed Mar 08, 2017 6:03 am Post subject: Library for ST7735R display |
|
|
I make asm library for ST7735R. I don't have this display and test it on Proteus-8 model.
Library works with 8-bit color in portrait & landscape modes and have "rotate 180°".
If anybody have this display, please check it. |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Thu Mar 09, 2017 5:24 am Post subject: |
|
|
Thank-you for posting. I will test tomorrow.
Do you think this will work on Xmega?
E |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Thu Mar 09, 2017 10:44 am Post subject: |
|
|
Yes, it must work on Xmega:
Code: | $regfile = "xm256a3budef.dat"
$crystal = 32000000
$hwstack = 64
$swstack = 64
$framesize = 64
Config Osc = Disabled , 32mhzosc = Enabled
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1
'------------------------------- Setup -----------------------------------------
$lib "glcd-ST7735R.lib"
Config Vport0 = D
Config Graphlcd = Color , Cs1 = Port0.7 , Si = Port0.6 , Sclk = Port0.5 , Cs1 = Port0.4, Rst = Port0.3 |
I can't test it - Proteus don't support Xmega. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Mar 09, 2017 11:26 am Post subject: |
|
|
Hello Mrshilov
Thank you for sharing. Even while you could not test it, i am sure it will work. You are the LCD expert _________________ Mark |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Tue Mar 21, 2017 10:28 pm Post subject: |
|
|
Hello Sergey,
I can confirm that the ST7735R library works on XMEGA. However, it seems that all connections must be from the same PORT. Is this correct?
How difficult would it be to change the library so that the connections are from different PORTs?
Code: | $regfile = "xm256a3budef.dat"
$crystal = 32000000
$hwstack = 64
$swstack = 64
$framesize = 64
Config Osc = Disabled , 32mhzosc = Enabled
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1
'------------------------------- Setup -----------------------------------------
$lib "glcd-ST7735R.lib"
'====== THIS WORKS OK ===========
Config Vport0 = C
Config Graphlcd = Color , A0 = Port0.3 , Si = Port0.5 , Sclk = Port0.7 , Cs1 = Port0.4, Rst = Port0.6
|
Code: |
' ==== THIS DOES NOT WORK ????? ======
Config Vport0 = C, Vport1 = E
Config Graphlcd = Color , A0 = Port0.3 , Si = Port1.0 , Sclk = Port1.1 , Cs1 = Port0.4, Rst = Port0.6 |
PS: There is also a bicycle road racing professional from Russia with your same name?
E |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Wed Mar 22, 2017 12:12 pm Post subject: |
|
|
It must work from different PORTs.
P.S. Yes, and also there is six time Paralympic Champion:
https://en.wikipedia.org/wiki/Sergey_Shilov
This not I am, and they are not my relatives. |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Wed Mar 22, 2017 2:09 pm Post subject: |
|
|
Hi Sergey,
Please see this video: https://youtu.be/HYXCUI1-I30
This is the result of defining connections from different VPORTs:
Code: | Config Vport0 = C , Vport1 = E
Config Graphlcd = Color , A0 = Port0.3 , Si = Port1.0 , Sclk = Port1.1 , Cs1 = Port0.4 , Rst = Port0.6
|
If real ports are used - for example:
Code: | Config Vport0 = c
Config Graphlcd = Color , A0 = Port0.3 , Si = Porte.0 , Sclk = Porte.1 , Cs1 = Port0.4 , Rst = Port0.6
|
Then, these errors are created:
Quote: | Error : 221 Line : 205 Backward Jump Out Of Range [_clear_graph1 [ 86]] , In File : C : \ Program Files(x86) \ Mcs Electronics \ Bascom -avr \ Lib \ Glcd -st7735r.lib
Error : 221 Line : 207 Backward Jump Out Of Range [_clear_graph2 [ 89]] , In File : C : \ Program Files(x86) \ Mcs Electronics \ Bascom -avr \ Lib \ Glcd -st7735r.lib |
PS: But you are the LCD Library Champion. :D :D
E |
|
Back to top |
|
|
twinsen
Joined: 04 Feb 2015 Posts: 2
|
Posted: Wed Apr 19, 2017 9:08 am Post subject: |
|
|
I have tested this library with ST7735R display.
All connections are from the same PORT.
It works, but with slight mistakes.
Everything (boxfill, lines, pset) is moved one pixel row down and two pixel columns to the right on the screen (in both landscape and portrait orientations).
To make it work correctly I had to write like this:
Boxfill( -2 , -1) -(127 , 159) , Green
Personally for Mrshilov:
Работает, но все смещено на 2 пикселя вправо и 1 пиксель вниз в обеих ориентациях.
Поворот не пробовал. |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Thu Apr 20, 2017 9:25 am Post subject: |
|
|
May be, may be. ST7735 has 162x132 resolution. Proteus model also. If real display 160x128, so some pixels are unvisible. In NOKIA-1616 LCD with SPFD54124B the same situation and screen has shift 2 pixels horizontal and 1 pixel vertical. So I make library for ST7735 similarly.
If this shifts not needed - try this version. |
|
Back to top |
|
|
twinsen
Joined: 04 Feb 2015 Posts: 2
|
Posted: Thu Apr 20, 2017 8:51 pm Post subject: |
|
|
This version works OK.
I tried it in portrait orientation.
Thank you Mrshilov for your hard work.
Эта версия работает правильно: рисует рамку и ставит точки по углам как надо.
Спасибо за проделанную работу. |
|
Back to top |
|
|
VladYar
Joined: 17 Mar 2017 Posts: 1
|
Posted: Tue May 16, 2017 2:29 am Post subject: Fonts |
|
|
Sergei! I ask you to add fonts with the support of the Cyrillic if possible. Also I ask to add fonts with a larger size. How to make fonts? Thank you. |
|
Back to top |
|
|
jure_m
Joined: 14 Jan 2005 Posts: 68 Location: Ljubljana
|
Posted: Wed Feb 06, 2019 12:15 pm Post subject: |
|
|
Hi Mrshilov,
I am testing your sample for ST7735R display library for resolution 128x160.
It all works well however, you have mentioned there that CS1 & Rst are optional. I did disconnect them, but then LCD does not show anything. Do I have to connect CS1 or RST to GND or Vcc instead?
Best regards
Jure |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Wed Feb 06, 2019 12:54 pm Post subject: |
|
|
CS must be connected to GND.
RST - to Vcc. |
|
Back to top |
|
|
jure_m
Joined: 14 Jan 2005 Posts: 68 Location: Ljubljana
|
Posted: Wed Feb 06, 2019 2:11 pm Post subject: |
|
|
Hi Mrshilov,
well this connection does not work if power is OFF and back ON again. I have connected RST in between 10k connected to Vcc and 10uF connected to GND to reset LCD, while CS had to be connected to uC.
Best regards
Jure |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
|
Back to top |
|
|
|