Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Library for ST7735R display
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
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Wed Mar 08, 2017 6:03 am    Post subject: Library for ST7735R display Reply with quote

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
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Thu Mar 09, 2017 5:24 am    Post subject: Reply with quote

Thank-you for posting. I will test tomorrow.

Do you think this will work on Xmega?

E
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Thu Mar 09, 2017 10:44 am    Post subject: Reply with quote

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
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Thu Mar 09, 2017 11:26 am    Post subject: Reply with quote

Hello Mrshilov

Thank you for sharing. Even while you could not test it, i am sure it will work. You are the LCD expert Very Happy

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

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Tue Mar 21, 2017 10:28 pm    Post subject: Reply with quote

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
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Wed Mar 22, 2017 12:12 pm    Post subject: Reply with quote

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. Smile
Back to top
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Wed Mar 22, 2017 2:09 pm    Post subject: Reply with quote

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
View user's profile
twinsen

Bascom Member



Joined: 04 Feb 2015
Posts: 2

PostPosted: Wed Apr 19, 2017 9:08 am    Post subject: Reply with quote

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
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Thu Apr 20, 2017 9:25 am    Post subject: Reply with quote

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
View user's profile
twinsen

Bascom Member



Joined: 04 Feb 2015
Posts: 2

PostPosted: Thu Apr 20, 2017 8:51 pm    Post subject: Reply with quote

This version works OK.
I tried it in portrait orientation.
Thank you Mrshilov for your hard work.

Эта версия работает правильно: рисует рамку и ставит точки по углам как надо.
Спасибо за проделанную работу.
Back to top
View user's profile
VladYar

Bascom Member



Joined: 17 Mar 2017
Posts: 1

PostPosted: Tue May 16, 2017 2:29 am    Post subject: Fonts Reply with quote

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
View user's profile
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 68
Location: Ljubljana

slovenia.gif
PostPosted: Wed Feb 06, 2019 12:15 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Wed Feb 06, 2019 12:54 pm    Post subject: Reply with quote

CS must be connected to GND.
RST - to Vcc.
Back to top
View user's profile
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 68
Location: Ljubljana

slovenia.gif
PostPosted: Wed Feb 06, 2019 2:11 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 320
Location: Japan

japan.gif
PostPosted: Wed May 01, 2019 3:22 pm    Post subject: 0.96inch 65K FullColorLCD 160x80dot [ST7735R] Reply with quote

Thank you to Mrshilov's efforts.

The ST7735R library has been modified for a 0.96inch 160x80 dot LCD module.

Circuit diagram
https://drive.google.com/file/d/1h0WkDd3q_3EPc-RvnaiICzqX5lO6kHED/view?usp=sharing


Last edited by O-Family on Thu May 02, 2019 3:45 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website
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