News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

display ks0108

Started by Pepe, Sep 28, 2021, 12:06 AM

Previous topic - Next topic

Pepe

proteus simulation

SeanG_65

I couldn't stop laughing. BRILLIANT implementation I never thought a PIC could pull this off.

top204

#2
Crickey!  I originally wrote that program in about 2003, when I was first developing the code for a KS0108 graphic LCD in the compiler, and I had the idea of trying to create a simple space invaders game. I originally wrote it on a PIC16F877 device operating at 4MHz, so I could show how fast the compiler's assembler code was, and Labcentre used it as a demo in their Isis simulator. :-)

After I first released it on the old forum, a user added the high scores to it, so I used the modified version for the compiler's samples, and re-wrote the program on an old 18F452 device to show what they could do, and the 18F device also allowed me to add sound to the game. Thanks for the additions Pepe. Sound used to work as normal when I first wrote it all of those years ago, but I can see some old mnemonics in the code that will give the optimiser some problems, so I am going through the code and re-formatting it for the Positron8 compiler. :-)

I first wrote a space invaders game, don't laugh, back in 1983 on my Sinclair ZX81 computer, but never had the idea to market it, because I, unfortunately, do not have a marketing mind, yet it did not exist as a commercial game on the machine when I wrote it. :-( I also wrote a galaxians game on the ZX81 and a few maze games. Lovely times, full of joy and learning. :-)

I still remember the day I bought my ZX81 computer with its 16K RAM pack from WH-Smiths and brought it home and plugged it into mum and dad's television, and dad asking; "what does it do?", and I replied; "I don't know yet, but I'm going to find out". :-) So I went to the library and got out a couple of books on the Z80 microproccessor and taught myself to program in assembler code, because the slow interpreted languages were not upto doing what I wanted to do.

charliecoutas

Les

I reckon I could make an interesting exhibit for the museum (tnmoc.org) using your Space Invaders code.
Kids always love anything like this and I think I could weave some cryptological/computer history into it.

I would like your permission, and Mark Rodgers who modified it, please? I would of course acknowledge you and Mark as the original authors.

Good work, as always.
Charlie

Anyone got a good source for KS0108?

top204

#4
By all means yes Charlie, and many thanks.

KS0108 displays can be found on Ebay, but they have gone up in price recently. They were once around £4.00 each:

https://www.ebay.co.uk/itm/291022261852?hash=item43c2474e5c:g:~ekAAOSwklJa1u-D

The code could be changed for any graphic LCD, including the SSD1306, because it does nothing special with it. It is the simple state machine mechanism that makes the items move all together at differing speeds without any blockages in the code. Looking at the code now, I actually cringe at how badly laid out it was. LOL

charliecoutas

Much appreciated Les. It will be a little while, we are doing stuff for the escape rooms at present.

It is great fun watching today's young people trying to work out what you do with a 1940's bakelite telephone when they are asked "Dial 05123 and you will receive another clue".

Charlie

charliecoutas

I've just had a KS0108 delivered and it doesn't seem to have CS1 or CS2 pins. Could somebody who had used a KS0108 please advise?

The 20 pins it has are:

GND
Vcc
VO
RS
R/W
E
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
PSB
No connect
RST
VOUT
BLA  Backlight
BLK     ..

Charlie

RGV250

Hi Charlie,
Are you sure it is a KS0108, looking here this ST7290 has a PSB pin which I don't think the KS has https://components101.com/displays/st7290-graphical-lcd

I have probably got one or two KS 1018 displays kicking around if you need one. Let me know and I will have a search to make sure.

Bob

top204

#8
I've had a look around and they seem to call them CSA and CSB pins now, and I have also noticed that a lot of people are obsessed with interfacing with them via a serial SPI interface, so the CSA and CSB pins are not always listed in a device's pinouts, but they must be there if the device also has the parallel pins because they choose which 64x64 pixel block to use!

With a standard microcontroller, a serial interface will "always" be slower than a parallel interface. Serial interfaces are OK for texts and stationary graphics, but for moving graphics the slower update of the display is noticable. The KS0108 graphic LCDs are not very fast themselves, and have a slow display persistence, so slower still is a very bad thing to do IMO.




charliecoutas

Thanks Les, I fear that it's not a KS0108. I ordered a 12864 GCLD, Bugger.

Bob: If you have a spare KS0108 then it would be much appreciated. Give me a price for the unit and postage.

Thanks guys
Charlie

top204

Judging from the page below, it looks like the 12864 is a KS0108 display:

https://electrobes.com/product/12864-128x64-ks0108-dots-graphic-lcd-display-module-blue-color-backlight/

See the pin listing does not have the CSA and CSB pins in it, but the circuit does, but not used.

John Drew

Looks more like a character display to me. E.g hd44780

RGV250

Hi Charlie,
I definitely have one, I will test it to make sure it is working before I send it.
Don't worry about the cost, you could always put a quid or two in the British heart foundation if you are passing but entirely up to you.
Do you want me to send it to your work address or PM me.

Bob 

RGV250

Hi Les,
If you look down the description it is a ST7920, pretty misleading information.

Bob

top204

#14
Well spotted Bob. Big letters of KS0108, but small letters for what the LCD actually is and both types very different to each other!! :-)

atomix


charliecoutas

#16
atomix: That is exactly the unit I have, it doesn't have CS1 and CS2 pins. So how it covers 128x64 is a mystery.

Bob: Very kind of you, I'll pm you my address.

Les, John: I think there is a difference, and can almost safely say that if it doesn't have CS1 and CS2, it aint a KS0108.

So thanks very much for the help guys, Bob has a unit which I will use.

Charlie

Edit: John: Yes it looks very much like a 4 line display that can do big characters. Might be useful one day...

Yasin

A tip from me. The shortest way to understand KS0108 or its derivatives by looking at the pcb is to have a negative voltage converter on it. Usually they do this with the ICL7660.
Best regards.

John Drew

If, and it's a big "If" it's a character display then you can usually see the blocks of pixels that make up each character by getting the light at a certain angle.
Cheers
John

charliecoutas

John: I've have a look tonight, I'm at the museum at Bletchley Park today. But why is it called 12864 in that case?

Yasin: The mystery deepens. There is a Vout pin which the spec says is -10V for the contrast, which is pin VO.
I can't see any IC's apart from three black blobs. There is a tiny pot on the back.

Bob is kindly sending me a spare KS0108 of his. But as lots of us will be building Les's Space Invaders, then we had better get to the bottom of what is a KS0108 and what is not.

Charlie