Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

2.8inch 65K FullColorLCD 240x320dot [ILI9341]

 
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 Member



Joined: 23 May 2010
Posts: 137
Location: Japan

japan.gif
PostPosted: Tue May 28, 2019 2:56 am    Post subject: 2.8inch 65K FullColorLCD 240x320dot [ILI9341] Reply with quote

The graphic instructions (LINE, BOX, LCDAT, etc) of BASCOM-AVR are limited to byte addressing (0-255) for LCD.
Because of that limitation, other users have created a function for the [ILI9341] (240x320 dot) LCD.
However, I and some users would like to use BASCOM's standard graphics instructions.

Thereat, for LCDs with more than 256 dots, we added offsets to the screen addressing to enable BASCOM standard graphics instructions.
Although there are restrictions on instruction execution, this is another approach to large screen LCDs.

how to use
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.

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

Administrator



Joined: 09 Apr 2004
Posts: 4744
Location: Holland

blank.gif
PostPosted: Tue May 28, 2019 8:53 am    Post subject: Reply with quote

Hello O-Family

Thank you for sharing this smart solution.

Maybe it would be a good idea to add an option so the compiler can pass words instead of bytes. This would only work with custom libs like this.
If you think this is a good idea then please contact me.

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

Bascom Member



Joined: 23 May 2010
Posts: 137
Location: Japan

japan.gif
PostPosted: Tue May 28, 2019 3:05 pm    Post subject: Reply with quote

Hi, Mark

Graphic LCD functions created by other users have many functions and high performance, which is very nice.
However, the instructions (function names) and parameters differ depending on the author of the function and the LCD, so learning and understanding are required for each.
This loses the advantage of the standard command language, which is an advantage of the BASIC language, and is similar to how to handle C language.
Furthermore, I think that it will be necessary to have a detailed manual for each beginner.

It is probably the best option for the compiler to pass the graphic LCD instruction's word address and word color information to the library.
I think that will create a new library, so I want that option.

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

Bascom Member



Joined: 08 Nov 2016
Posts: 16

PostPosted: Sat Jun 22, 2019 6:44 pm    Post subject: Reply with quote

Hello O-Family.

I tryed to use this LCD display (IL9341) and probably I did't understand your instructions. After compile file I get an error message:

Error : 5 Line : -2871 No more space for BIT [OFFSET256] , in File : C:\_MS PROGRAMS\BAS-AVR\LIB\GLCD-ILI9341_2R8_240X320.LIB
Error : 320 Line : 185 [syntax error, token = '{'] , in File : C:\_MS PROGRAMS\BAS-AVR\LIB\GLCD-ILI9341_2R8_240X320.LIB

Please would you be so kind and explane again, maybe more detail, what I have to do, that LCD will running. Where I have to change "Offset 256"? For test I took your example file. Different are only aliases for ports. I tryed this on ATMEGA328P and also ATXMEGA128 (using Virtual port), but error message is the same.

Best regards M.
Back to top
View user's profile
O-Family

Bascom Member



Joined: 23 May 2010
Posts: 137
Location: Japan

japan.gif
PostPosted: Sun Jun 23, 2019 2:53 am    Post subject: Reply with quote

Hi,
The error has weird things.

Error: 5 Line: -2871 No more space for BIT [OFFSET 256]
I do not think that the line number of the error will be minus [-2871].

Error: 320 Line: 185 [syntax error, token = '{']
Error code [320] does not have its number in the BASCOM manual.

This little information is difficult to solve.
Is the latest version of BASCOM?
Back to top
View user's profile Visit poster's website
matjazs

Bascom Member



Joined: 08 Nov 2016
Posts: 16

PostPosted: Sun Jun 23, 2019 2:21 pm    Post subject: Reply with quote

Hello.
I use version of Bascom 2.0.8.1.

I fixed a problem.

On ATMEGA328PU after a combination of pins start work. I forget to make

Code:
Dim Offset256 As Byte


On XMEGA128A3 I have still problem. (something with VPORT)

Thank you and
Best regards. M.
Back to top
View user's profile
O-Family

Bascom Member



Joined: 23 May 2010
Posts: 137
Location: Japan

japan.gif
PostPosted: Sun Jun 23, 2019 3:23 pm    Post subject: Reply with quote

You said the same error would occur in my sample code, so deleting [Dim Offset 256 As Byte] did not give the error you presented.

This library has been modified for the ST7735R, so it will be solved if you check the thread corresponding to the ST7735R XMEGA.
Back to top
View user's profile Visit poster's website
matjazs

Bascom Member



Joined: 08 Nov 2016
Posts: 16

PostPosted: Tue Jun 25, 2019 5:49 am    Post subject: Reply with quote

Error accure because [Dim Offset 256 As Byte] missed.
I try to use another LIB (ST7735R) on ATXMEGA128A3U but I'm not successful.

I don't know, how can modify LIB file.
Back to top
View user's profile
O-Family

Bascom Member



Joined: 23 May 2010
Posts: 137
Location: Japan

japan.gif
PostPosted: Tue Jun 25, 2019 11:46 pm    Post subject: Reply with quote

If you can not solve with the forum information, you need to present what kind of error you will get or the source file where the error will occur.

Otherwise you can not get help.
Back to top
View user's profile Visit poster's website
matjazs

Bascom Member



Joined: 08 Nov 2016
Posts: 16

PostPosted: Wed Jun 26, 2019 7:14 pm    Post subject: Reply with quote

Hello.
I can compile file without error, but nothing is shown on display.
In attach is modified your file on ATXMEGA128A3U.

Best regards. M.
Back to top
View user's profile
O-Family

Bascom Member



Joined: 23 May 2010
Posts: 137
Location: Japan

japan.gif
PostPosted: Sun Jul 07, 2019 3:02 am    Post subject: Reply with quote

If the virtual port connected to the LCD is the same port, it will operate normally.

The problem with multiple virtual ports is unknown.
I do not know I am not familiar with Xmega.
Back to top
View user's profile Visit poster's website
O-Family

Bascom Member



Joined: 23 May 2010
Posts: 137
Location: Japan

japan.gif
PostPosted: Mon Jul 08, 2019 1:44 am    Post subject: Reply with quote

A bug was found in the original [glcd-ST7735R.lib].
It does not work if A0=[DC] and Sclk=[SCK] are assigned to another port.
* Sbi _glcd_port_scl, _glcd_a0 -> * Sbi _glcd_port_a0, _glcd_a0
* Cbi _glcd_port_scl, _glcd_a0 -> * Cbi _glcd_port_a0, _glcd_a0

This bug also occurs in the ST7735R library and the same symptoms occur on both regular AVR and Xmega.
Attach the corrected [glcd-ILI9341_2R8_240x320.lib].
Back to top
View user's profile Visit poster's website
matjazs

Bascom Member



Joined: 08 Nov 2016
Posts: 16

PostPosted: Mon Jul 08, 2019 5:51 pm    Post subject: Reply with quote

O-Family thank you, thank you very much.
It works now perfect also on ATXMEGA128A3U.

But I have one question more:
How can I transform my fonts (I use them on monocrome LCD) like color fonts. I tryed to do it with TT Font maker (EDC), but unsucsessful.
It works only with color8x8.fonts and color16x16.fonts.

Best regards M.
Back to top
View user's profile
O-Family

Bascom Member



Joined: 23 May 2010
Posts: 137
Location: Japan

japan.gif
PostPosted: Tue Jul 09, 2019 1:05 am    Post subject: Reply with quote

Hi,
It was good to work well!

The font for monochrome and the font for color are different in data arrangement.
It is due to the structure of the internal memory of each LCD.

Furthermore, BASCOM's early color LCD library and the original ST7735R library created by "Mrshilov" do not support through type fonts.
It takes a great deal of effort to make this possible, so expect other users' efforts.
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
Page 1 of 1

 
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