Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Proportional Fonts for GLCDs + TrueType Converter
Goto page Previous  1, 2, 3
 
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
mariosm

Bascom Member



Joined: 12 Oct 2005
Posts: 45
Location: Thessaloniki

greece.gif
PostPosted: Thu May 27, 2021 11:54 am    Post subject: Reply with quote

Thank you Netzman for your answer.
I have made the changes and now i have one error.

Error : 93 Line : 46 Variable not dimensioned [___READRAMPZ] , in File : ProportionalFont.inc
I do not know what to do about this error.

Quote:
Do you have a working basic sample without using the proportional fonts library?


I have written my project with libraries from this link
https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&p=73362#73362
All is OK but now i don't want SPI connection.


I have used library for this link
https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13804&postdays=0&postorder=asc&highlight=st7735&start=15
This library use "Config Graphlcd" command but i have problem with font files. I can use only 8x8, 16x16 fonts. Τhis has a bad appearance on display. Any other font files from many converters don't work.

_________________
Bascom AVR ver 2.0.8.3 full version
Back to top
View user's profile
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 119
Location: Graz

austria.gif
PostPosted: Mon May 31, 2021 9:17 pm    Post subject: Reply with quote

Hello,

the RAMPZ register shouldn't be there in the first place since it is a device with 64K of memory. In fact, in the datasheet, the memory address 0x3B (=RAMPZ) is marked as reserved and the errata says, RAMPZ has been removed.
So I guess that just stuck when Mark derived the dat file for this processor.

I've adjusted the font library and compiled it with o-family's glcd-ST7735S_1R8_128x160 driver, see the attachment.

br

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5207
Location: Holland

blank.gif
PostPosted: Tue Jun 01, 2021 9:23 am    Post subject: Reply with quote

the RAMPZ is not used when the flash code is 64KB.
At least, not by bascom.
In libs you find code that checks the romsize. Only when it exceeds 64KB it will use rampz.
When this gives problems in user libs, you can simply remark the rampz in the DAT file.

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

Bascom Member



Joined: 12 Oct 2005
Posts: 45
Location: Thessaloniki

greece.gif
PostPosted: Tue Jun 01, 2021 12:11 pm    Post subject: Reply with quote

Thank you again Netzman for your answer.

I used your new files for test.
Τhe result is very good but i have a problem.
The first character of every string is broken.
I also tried different font files with the same problem.

[img][/img]

_________________
Bascom AVR ver 2.0.8.3 full version
Back to top
View user's profile
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 119
Location: Graz

austria.gif
PostPosted: Wed Jun 02, 2021 9:32 pm    Post subject: Reply with quote

I can't reproduce this behaviour, could you upload a complete sample (incl. fonts) which shows that?

Thank you for the explanation, Mark! I resorted to use _huge, which is 0 when the program size is <= 64K and use LPM/ELPM respectively.

thx, br

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
mariosm

Bascom Member



Joined: 12 Oct 2005
Posts: 45
Location: Thessaloniki

greece.gif
PostPosted: Thu Jun 03, 2021 10:13 am    Post subject: Reply with quote

Thank you again Netzman for your answer.

On attachment you will find the files you need.

I created many different font files with Bascom True Type Font Converter 1.4, but I have the same problem.

_________________
Bascom AVR ver 2.0.8.3 full version
Back to top
View user's profile
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 119
Location: Graz

austria.gif
PostPosted: Sun Jun 06, 2021 12:28 am    Post subject: Reply with quote

In the Pset-Routine resp. the _convert_color1 routine called from there the memory positions in the softstack Y+5 and Y+6 get trashed, which contains the pointers to the frame space for local variables.
I don't think this is intended behaviour, maybe o-family can help there.

This saves/restores the memory positions prior/post calling Pset as a temporary fix (in ProportionalFont.inc, line 193):
Code:
                     ' ### OTHER DISPLAYS ###
                     !push R10                              ' save registers used in the font loop,
                     !push R11                              ' they could also be used in the external set pixel routine
                     !push R12
                     !push R13

                     !ld R24, Y+5
                     !push R24
                     !ld R24, Y+6
                     !push R24

                     Pset Xpos , Y , Forecolor              ' or any other set pixel routine

                     !pop R24
                     !st Y+6, R24
                     !pop R24
                     !st Y+5, R24

                     !pop R13
                     !pop R12
                     !pop R11
                     !pop R10
                     ' ######################

(tested in the simulator)

br

_________________
LCD Menu | Proportional Fonts
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 Previous  1, 2, 3
Page 3 of 3

 
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