• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Which LCD KS0107/KS0108 or T6963 or ...?

Status
Not open for further replies.

jhanus

New Member
Like the title says,which LCD KS0107/KS0108 or T6963 or some other?
I need relatively fast LCD so it doesn't blur, B/W, 128x64 pix or more, controller with enough info to program and not to pricey(~60-80$).


KS0107/KS0108 - till now I used only HD44780, and this confuses me a bit, why two separate ic, it's fast
T6963 - ok, but it's slow

So, can someone point out why this and not that one and vice-versa, which is more easy to use, which has more data about it.

Thanks.
 

Pommie

Well-Known Member
Most Helpful Member
The 128*64 KS0107/8 displays have two chip select pins as they are actually two 64*64 displays. I posted some demo code a while back in this thread.

I also managed to get the LCD working with Swordfish Basic, details here.

Mike.
 

jhanus

New Member
Thanks, but I forgot to say that I wanted to program it in assembler, your project will be very helpful in future(because it's in C).
This is one of my last projects using purely assembler, because I'm shifting to 18F and Hi-Tech C(I guess ;) ), so asm plz and basic ughhh(hate that language).
So, you recommend KS0107/KS0108?


Thanks.
 

Pommie

Well-Known Member
Most Helpful Member
I have written a complete system in 16 series asm but unfortunatelly can't post it here as it was commisioned.

However, here are the basic I/O routines to get you started.
Code:
#define		b_LCD_CS1	PORTA,2
#define		b_LCD_CS2	PORTA,3
#define		b_LCD_RS	PORTC,5
#define		b_LCD_RW	PORTC,0
#define		b_LCD_E		PORTC,2

InitLCD		bsf	b_LCD_CS1
		bsf	b_LCD_CS2
		movlw	0x3f
		call	WriteCMD
		movlw	0xc0
		call	WriteCMD
		movlw	0x40
		call	WriteCMD
		movlw	0xb8
		call	WriteCMD
		return

WaitNotBusy	bsf	STATUS,RP0
		movlw	0xff
		movwf	TRISB
		bcf	STATUS,RP0
		bsf	b_LCD_RW
		bcf	b_LCD_RS  
		btfss	b_LCD_CS1
		goto	Skip_CS1
		bcf	b_CS2
		btfsc	b_LCD_CS2
		bsf	b_CS2
		bcf	b_LCD_CS2
WNB1_Loop	bsf	b_LCD_E
		btfsc	PORTB,7
		goto	WNB1_Loop
		bcf	b_LCD_E
		btfsc	b_CS2
		bsf	b_LCD_CS2
Skip_CS1	btfss	b_LCD_CS2
		goto	Skip_CS2
		bcf	b_CS1
		btfsc	b_LCD_CS1
		bsf	b_CS1
		bcf	b_LCD_CS1
WNB2_Loop	bsf	b_LCD_E
		btfsc	PORTB,7
		goto	WNB2_Loop
		bcf	b_LCD_E
		btfsc	b_CS1
		bsf	b_LCD_CS1
Skip_CS2
SetOutput	bsf	STATUS,RP0
		clrf	TRISB
		bcf	STATUS,RP0
		return

ReadLCD		bsf	b_LCD_E
		movfw	PORTB
		bcf	b_LCD_E
		btfsc	b_Inverted
		xorlw	0xff
		return

WriteCMD	movwf	LCDTemp
		call	WaitNotBusy
		movfw	LCDTemp
		movwf	PORTB
		bcf	b_LCD_RW
		bcf	b_LCD_RS
		bsf	b_LCD_E
		bcf	b_LCD_E
		return

WriteData	movwf	LCDTemp
		call	WaitNotBusy
		movfw	LCDTemp
		btfsc	b_Inverted
		xorlw	0xff
		movwf	PORTB
		bcf	b_LCD_RW
		bsf	b_LCD_RS	;rs=1 rw=0
		bsf	b_LCD_E
		bcf	b_LCD_E
		return

ReadData	call	WaitNotBusy
		bsf	STATUS,RP0
		movlw	0xff
		movwf	TRISB
		bcf	STATUS,RP0
		bsf	b_LCD_RW
		bsf	b_LCD_RS
		bsf	b_LCD_E
		movfw	PORTB
		bcf	b_LCD_E
		btfsc	b_Inverted
		xorlw	0xff
		goto	SetOutput

SetLCDAddress	bcf	b_LCD_CS1
		bcf	b_LCD_CS2
		btfss	XPos,6
		bsf	b_LCD_CS1
		btfsc	XPos,6
		bsf	b_LCD_CS2
		movfw	XPos
		andlw	0x3f
		iorlw	0x40
		call	WriteCMD
		movfw	YPos
		movwf	Row
		rrf	Row,F
		rrf	Row,F
		rrf	Row,F
		movfw	Row
		andlw	0x7
		iorlw	0xb8
		goto	WriteCMD
The variables b_Inverted, b_CS1 and b_CS2 are bit variables and the LCD data lines are on PORTB.

HTH

Mike.
 
Last edited:

Pommie

Well-Known Member
Most Helpful Member
Missed the plot routine,
Code:
Plot		call	SetLCDAddress
		clrf	Mask
		movfw	YPos
		andlw	0x07
		movwf	Count
		bsf	STATUS,C
GetBit		rlf	Mask,F
		decf	Count,F
		btfss	Count,7
		goto	GetBit
		call	ReadData
		call	ReadData
		iorwf	Mask,F
		movfw	XPos
		andlw	0x3f
		iorlw	0x40
		call	WriteCMD
		movfw	Mask
		call	WriteData
		return
Mike.
 

jhanus

New Member
Thank you, I'm going to be honest, more I read about KS0108(dummy read,2x64*64,weird addressing), more I like T6963C.

I even can't find datasheet for only LCD that I can buy, GDM12864E.
 

Pommie

Well-Known Member
Most Helpful Member
Thank you, I'm going to be honest, more I read about KS0108(dummy read,2x64*64,weird addressing), more I like T6963C.
The dummy read is quite normal and the addressing is completely logical.

However, the Toshiba chip has the advantage of a built in character rom and overlaid screens.

Mike.
 

jhanus

New Member
The dummy read is quite normal and the addressing is completely logical.

However, the Toshiba chip has the advantage of a built in character rom and overlaid screens.

Mike.
For starters I'll probably go with T6963c and later or parallel, with KS0108, can you explain 'overlaid screen'?
 

Pommie

Well-Known Member
Most Helpful Member
I've not played with the Toshiba chip but I believe you can have a text screen appear on top of a bitmapped background.

Mike.
 

Someone Electro

New Member
I suggest you go for the T6963 because it has "accelerated graphics". Because you just tell it "line from here to here" While on the other display you have to tell it "draw this pixel and this pixel and this pixel....."

Yes i think the T6963 has a few layers that display text and a few layers that display bitmaps and they are overplayed on each other.
 

atferrari

Well-Known Member
Hola jhanus,

Are you going the C route because you change to the 18F family? I still do it in Assembly with he 18Fs just because it's easier than with the previous 16F.

Most probably my next project would be a display like you mention here. Completely unknow territory for the moment.

¡Buena suerte!
 
Last edited:

Blueteeth

Well-Known Member
I suggest you go for the T6963 because it has "accelerated graphics". Because you just tell it "line from here to here" While on the other display you have to tell it "draw this pixel and this pixel and this pixel....."
Hey, don't want to sound picky but I do'nt think the t6963 can do that..would be nice if it did.
Yes it has a few layers of graphics and/or text, which can be displayed on top of eachother or mixed with XOR. But its a pretty basic controller, essentially a level up from the KS108's. It also stores/prints piixel data in a different way to most controllers...so it can't scroll horizontally very well, but it can do it vertically.

the KS108's are as basic as LCD controllers come, but there-in lies the beeauty. Easy to setup, and you do'nt have to worry about any 'settings', you set the cursor at an adress and start printing pixels (8 at a time, as it takes a byte at a time).

As for 'blurring'...thats not really down to the controller, its the LCD glass itself. FSTN lcd's have a slighty better response time(100ms ish), but no where near TFT's (few ms). Ultimately, I'd pick the t6963 if you want to display a lot of text with a standard font, or have multiple screens that you regularly switch to and from. The KS108 is really just for displaying anything, as it doesn't have any special hardware geared for text or windows, but you don't have to faff about with configuring registers.

Of course LCD resolution makes a difference. KS108's are used for 128x64 max. T6963 up to 240x128..generally the SED1335 (or S1D13700) are used for 320 and above...all monochrome though.

Too much info? meh sorry, LCD's are my thing.

Blueteeth
 

Pommie

Well-Known Member
Most Helpful Member
the KS108's are as basic as LCD controllers come, but there-in lies the beeauty. Easy to setup, and you do'nt have to worry about any 'settings', you set the cursor at an adress and start printing pixels (8 at a time, as it takes a byte at a time).
I agree, the simplicity makes it easier to get something up and running.

Mike.
 

jhanus

New Member
I suggest you go for the T6963 because it has "accelerated graphics". Because you just tell it "line from here to here" While on the other display you have to tell it "draw this pixel and this pixel and this pixel....."
Yes i think the T6963 has a few layers that display text and a few layers that display bitmaps and they are overplayed on each other.
If this is possible then we have a winner, for now!


Hola jhanus,
Are you going the C route because you change to the 18F family? I still do it in Assembly with he 18Fs just because it's easier than with the previous 16F.
Most probably my next project would be a display like you mention here. Completely unknow territory for the moment.
¡Buena suerte!

Hola, :D

Yes, I'm going to C because of rapid development and for portability, but in reality I don't want to, I simply love assembly, tinkering and so much code and data to track, like a beautiful game for my mind.
Not that I have a aversion to new(good) languages, I know C/C++ but little bit of brushing my skills wouldn't hurt.

And Gracias por la buena suerte!

(I had to cut a bit)
It also stores/prints piixel data in a different way to most controllers...so it can't scroll horizontally very well, but it can do it vertically.
the KS108's are as basic as LCD controllers come, but there-in lies the beeauty. Easy to setup, and you do'nt have to worry about any 'settings', you set the cursor at an adress and start printing pixels (8 at a time, as it takes a byte at a time).

Too much info? meh sorry, LCD's are my thing.
Blueteeth
*** Can you explain a bit more of how he stores pixels, I read somewhere(forgot where) that it needs to rotate every data before printing!
*** And there is no problem with changing pages?,I ask because it's said that this is in fact 2x 64x64.
*** No, no, no keep it coming! Thanks

A thread above/below there is whining how Microchip makes bad datasheets, well KS0107/KS0108 an T6963C are just blossoming with quality and examples.

Thanks to all!
 

futz

Active Member
*** And there is no problem with changing pages?,I ask because it's said that this is in fact 2x 64x64.
Page changes are trivial. You can write to one or the other or both at the same time for speed, like when clearing the screen.

There's an article I wrote while learning to use the KS0108 and some C code for it on my site.
 

jhanus

New Member
Page changes are trivial. You can write to one or the other or both at the same time for speed, like when clearing the screen.

There's an article I wrote while learning to use the KS0108 and some C code for it on my site.
I will read trough certainly, but first I must conquer asm code of Pommie. Thx
 

Blueteeth

Well-Known Member
Can you explain a bit more of how he stores pixels, I read somewhere(forgot where) that it needs to rotate every data before printing!
And there is no problem with changing pages?,I ask because it's said that this is in fact 2x 64x64.
Hi,

I'm used to epsons series of controllers, which stores pixel data, pixel by pixel, line by line, like a raster scan.

I *think* the t6963 draws from top to bottom, as opposed to horizontally, altohugh its been a while since I did any coding for it, so I can't be sure. Changing pages with the t6963 should be a snap, as you can write data to one page, write data to another, then switch between them...although the number of pages, or even their size is limited by the amount of ram you have conected to the controller, as well as the LCD resolution. If you're using 128x64 LCD, you should get a few pages out of it. Most controllers will use 32k of ram, so thats 32 * 1024 *8 bits (pixels). Well, some of the memory is used for other things, but considering you can get a couple of pages for 240x128, I'm sure you'll get plenty for your 129x64.

A thread above/below there is whining how Microchip makes bad datasheets, well KS0107/KS0108 an T6963C are just blossoming with quality and examples.
Hmm :( I quite like microchips datasheets, maybe its because I'm acustomed to their format. I'm not a fan of Atmel ones though. But you are right, the daatasheets for the
KS108 and T6963 are bloody awful. In fact there have been several re-writes of it by 'non toshiba' people because of the sheer frustration with it.

T6963C Controller based Displays
http://www.electro-tech-online.com/custompdfs/2008/06/t6963c.pdf


Some other useful links:
http://www.electro-tech-online.com/...Interfacing_and_set-up_for_Toshiba_T6963C.pdf
http://www.electro-tech-online.com/custompdfs/2008/06/T6963rr.pdf
http://www.electro-tech-online.com/custompdfs/2008/06/t6930C.pdf

Good luck. You're lucky as theirs loads of info on these controllers. Far more documentation than the embedded controllers you get in smaller LCD's (nokia ones for example).

Good luck, and you're most welcome :)

Blueteeth
 

jhanus

New Member
Blueteeth, what can I say, thank you very much, you gave me literature to read, which I like to read, a fine book of sorts :D

In two days I'm getting DEM128064H(T6963C) and will torture it 24/7, hopefully not to death.:eek:

Thanks again Blueteeth and all who helped
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top