GLCD s1d13700 test code

Discuss the Integrated Development Environment (IDE)

Moderators: David Barker, Jerry Messina

lothar
Posts: 14
Joined: Wed Apr 25, 2007 4:10 pm
Location: Hull

Post by lothar » Fri May 18, 2007 8:52 am

Big thanks Steven, had to leave the screen for a while but I have it working now. The screen contrast is not the greatest so I think more work is required here but at least I have something visible to go from. I have just recieved samples of a Texas instrument touchscreen control IC and I will let you know how I get on with this. I have reached the limit for the SE version and so I am placing my order today for swordfish.

One question remains however; I tried to write a continually changing variable to the display and it overwrote rather than clearing the previous to write again. I then cleared the layer between writing the new value and naturally it works however there is a distinct flash. Is there a simple way to clear a section before writing to it again?

I must also mention that the monochrome graphic converter is excellent! :D

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Fri May 18, 2007 9:13 am

Thanks for the comments. You could try the fill command to clear a small area of the screen before writing the next text. There is also an option to write text with a solid (white) background; the writing of text is slower, but it might be an easier approach. I'll have to let you know details when I'm at home tonight, as I can't remember the settings off the top of my head.

Regards,

Steve

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Fri May 18, 2007 9:31 am

The GLCD code should by default over write the data underneath only masking in with the outline of the char size. Only when requested should it or-ing xor-ing with what's under the char. The only time it should be an issue is when the chars take up less space than the original its over writting.

When I last looked at the SF GLCD code it was doing it wrong and applying the xor all the time. I have written a set of routines my self in the past but they were all in asm.

As the source is open it could be fixed.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Fri May 18, 2007 10:22 am

> When I last looked at the SF GLCD code it was doing it wrong
> and applying the xor all the time

If you recall, this was fixed early part of this year - GLCD library version 1.2

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Fri May 18, 2007 10:54 am

The fix if I remember right was to add masking

But any way It seems I'm wrong :oops: I ran a few tests and it correctly over writes the data underneath. Hmm should double check before I make statements like that.

I'm not sure why you are having an issue then.

lothar
Posts: 14
Joined: Wed Apr 25, 2007 4:10 pm
Location: Hull

Post by lothar » Fri May 18, 2007 10:55 am

is it an issue with the SE version of swordfish?

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Fri May 18, 2007 11:02 am

You can find out if you try this code

Code: Select all

GLCD.Cls

GLCD.SetFont(Fixed)
indexx = 0
Repeat
GLCD.WriteAt(0,indexx, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
Inc (indexx,8)
Until indexx > 63
Add that before any printing your doing and the out line will be seen that it covers.

If its bigger than the out line of the font chr size then there is an issue.

The the font chr size will be about 1 pixel higher than the font at max and 1 to the right and 0 below the lowest point

Also you should be able to see your text!

lothar
Posts: 14
Joined: Wed Apr 25, 2007 4:10 pm
Location: Hull

Post by lothar » Fri May 18, 2007 11:21 am

just tried it and can report that I cannot see the text. I have a black rectangle in the top left of my screen.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Fri May 18, 2007 11:34 am

> is it an issue with the SE version of swordfish?

The SE version uses the same GLCD library

> One question remains however; I tried to write a continually
> changing variable to the display and it overwrote rather than
> clearing the previous to write again

I think Tim is referring to a different problem, which is now fixed - I don't believe this is what you are referring to. Words and numbers are 'overlayed' when writing to the screen. Is that what you mean? If so, wait for Stevens follow up...
You could try the fill command to clear a small area of the screen before writing the next text. There is also an option to write text with a solid (white) background; the writing of text is slower, but it might be an easier approach. I'll have to let you know details when I'm at home tonight, as I can't remember the settings off the top of my head.
as he knows the S1D13700 better than anyone as he wrote it...

lothar
Posts: 14
Joined: Wed Apr 25, 2007 4:10 pm
Location: Hull

Post by lothar » Fri May 18, 2007 11:38 am

Yes David you are right. Ok thanks for the help Tim, I will wait for Stevens thoughts on the matter.

Thanks again

Lothar

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Fri May 18, 2007 3:04 pm

What my test was to find out was if you filled the screen with black, then what happens when you write your text over it.

The fact you report that "I have a black rectangle in the top left of my screen", leads me to believe you did understand and just ran the code I posted using a font which did not have have the solid char in it and failed to print any text your self.

So rather than giving you code do the following

Fill the screen with black
Print on several lines "Hello World" in a variable font

Then tell us what happens, I have tested mine on only a KS GLCD so cannot comment on the SED verities.

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Fri May 18, 2007 6:33 pm

The S1D13700 driver is a little different to the KS0108 driver. It does not support the Font.Style options, but instead uses Pen.Mode, Brush.Style, Pen.Color and Brush.Color options. From the Graphics.bas library (automatically included by the GLCD.bas library):

// pen modes...
pmCopy = 0,
pmMerge = 1,
pmXOR = 2,

// brush styles..
bsClear = 0,
bsSolid = 1,

To write black text (Pen.Color = 1) on a white background (Brush.Color = 0), use the following:

Pen.Color = 1
Brush.Color = 0
Pen.Mode = 0
Brush.Style = 1

If there is no need to write the white background to overwrite previous text, Brush.Style = 0 is faster.

The reason for the difference between the drivers results from the different ways that different displays write to graphics RAM - the KS0108 writes bytes in the y direction, the S1D13700 writes them in the x direction. It works faster with the KS0108 to write bytes at a time when contructing text, but for the S1D13700, it is faster to write each pixel of the text at a time. Using the Brush.Style = 0 option means that background pixels do not have to be written - they are just skipped. In addition, as pixels are written individually, there is no need for the Font.Style options, just the pen and brush options.

I hope this makes it a little clearer.

Regards,

Steve

richardb
Posts: 310
Joined: Tue Oct 03, 2006 8:54 pm

Post by richardb » Mon May 28, 2007 9:24 am

I've been looking at these glcd displays because i need an 8 line lcd display the graphical side is really secondary.

is this the type thats been tested ?
240320HL-FC-BW-3TS
rs part numer = 627-1769

if so i have some questions.

1 are you happy with it?

2. what connector are you using ? are there any that are not smt or atleast lower density?

3. can i use the touch screen as simply as measuring its resistance with the pic adc and another resistor in a voltage dividor?

4 whats the best way to mount it
Hmmm..

yolk
Posts: 15
Joined: Thu May 31, 2007 2:03 pm
Location: italy

GLCD and external EEPROM

Post by yolk » Wed Sep 19, 2007 10:27 am

I've used the graphics library for the s1d13700 controller with a 320x240 display and it works fine. i only have a slight flicker while updating the display..
I am just wondering if it should be possible to use external EEPROM (serial ones, cheap as 24LC512) to store fonts and graphics as sometimes program memory area is not so much..
Does somone has some free time to do such a modification? mainly it should be enough to modify the read/write routines in the graphics.bas module and then write some code to fill the eeprom starting from the tables generated by the font and graphics utilities..
actually i'm too busy to do such a thing but if someone is also intersted, please let me know..

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Wed Sep 19, 2007 10:43 am

Actually due to the modular nature of the compiler replacing the font reading routine with an i2c Eeprom reading routine would be very easy. It will though slow the display quite considerably.

When you say your to busy to do it does that mean you are just messing around and you would just like it to try or its needed for a job and to save time your prepared to pay for the work to be done?

Post Reply