• 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.

Unicorn GLCD demo.

Pommie

Well-Known Member
Most Helpful Member
Here is a simple demo using a graphic LCD on Bill's Unicorn.

My C is a little rusty and the C18 compiler with the Harvard architecture makes it a little more challenging. I did however manage a few routines that should get people started.

This is what it looks like when it's working,



As you can see, I'm not an artist and my version of the Canadian Maple leaf leaves a lot to be desired.:eek:

This should work with any pic18 and a GLCD with two KS0108 controllers. It is however a lot simpler with the Unicorn.

The attached zip file contains the c files. Comments and constructive criticism welcome. Thinking about it, the lack of comments in the code will probably be most commented on.:rolleyes:

Mike.
 
Last edited:

Pommie

Well-Known Member
Most Helpful Member
Yes, I tried the oscilloscope and it looks good.

One thing I forgot to mention earlier which may cause people problems is that the data sheet you link to (topway) doesn't mention the fact that, when reading from the display data, you need to do a dummy read before you get valid data. If you look at the plot routine you'll see what I mean. Don't you just hate it when data sheets are wrong.:rolleyes:

Mike.
 

Pommie

Well-Known Member
Most Helpful Member
I thought about implementing "life" and the biggest problem is buffering the display. You have to buffer it or you get weird things happening. Just using half the display would mean you need 512 bytes for a buffer, not really feasible. You could just buffer 2 rows (8 pixels deep) at a time with 2 64 byte buffers and treat them as a cache.

If I get time I may have a go at doing this at the weekend.

Sure, use the photo. If you have a better bitmap that you want converting into a usable form (c string) just let me know. Have you had a play with the code yet? It's not been tested much and so has probably got a few bugetes in it.

Mike.
 

Pommie

Well-Known Member
Most Helpful Member
It was a lot easier than I thought. Only took half an hour - I'm starting to like C18.

Here is Life on the Unicorn. There is just a glider and a small exploder on there at the moment.

Mike.
 
Last edited:

Pommie

Well-Known Member
Most Helpful Member
The max operating current is 15mA - typically 6mA. The backlight takes up to 120mA, in the photo above I have it at about 20mA.

Data sheet here.

Mike.
 

mvs sarma

Well-Known Member
Pommie said:
The max operating current is 15mA - typically 6mA. The backlight takes up to 120mA, in the photo above I have it at about 20mA.

Data sheet here.

Mike.
Your Demo is really nice sir and should encourage many other enthusiasts to start experimenting.Once Bill, being a canadian, has acknowledged the Maple leaf what more.
 

Mike - K8LH

Well-Known Member
Mike (Pommie),

I'm expecting a 128x64 Blue/White KS0108 GLCD from Warren's company to show up in the post any day now and I'm very excited to see your example.

Thank you Sir.

Happy Holidays. Mike
 

Pommie

Well-Known Member
Most Helpful Member
Mike,

It was my first time using the C18 compiler and so the code is not very well written. I have since written a serial LCD driver that allows me to do things like this.


I'm probably going to make the code and circuit available on the web when I get it finished.

Mike.
 

Mike - K8LH

Well-Known Member
My display just came in the post. Can't believe I've been sitting here over an hour agonizing over wether to install a female or male connector on it.
 

ericgibbs

Well-Known Member
Most Helpful Member
Mike said:
My display just came in the post. Can't believe I've been sitting here over an hour agonizing over wether to install a female or male connector on it.
hi Mike,
As its 0.1inch pin pitch I would use a male/pin connector.
This will match up with your project board and also give it the 'stand off' height above any pcb/project board socket... Have a relaxing xmas break...:)
 

bryan

Member
Pommie:

Any luck in the serial LCD Driver?


Mike,

It was my first time using the C18 compiler and so the code is not very well written. I have since written a serial LCD driver that allows me to do things like this.

I'm probably going to make the code and circuit available on the web when I get it finished.

Mike.
 

Pommie

Well-Known Member
Most Helpful Member
Yes, it's all done, I just haven't got around to debugging and documenting it. Maybe it's something I should try and get completed in the next couple of weeks.

I've even done a PCB, two actually, one with ICD and 9 Pin D connector and a more compact one with an SMD EEPROM.

These are the boards and I need to make a decision and get one of them made.



Anyone have any pros/cons between the two boards?
Some relevant info,
The serial can be connected through the D connector or the 4 pin header.
The serial auto switches polarity so it can connect to a PC or a Pic chip without a Max232 chip.
The crystal, keyboard components and serial EEPROM are optional and can be omitted.
Both boards fit comfortably behind the main GLCD display board.

All comments welcome.

Mike.
 
Last edited:

Mike - K8LH

Well-Known Member
Both are extremely nice Mike. I don't think I would put that big DB-9 connector on the board but that's just a personal preference.

Mike
 
Last edited:

bryan

Member
Hi Pommie:

Experimenting with you KS0108 GLCD code with limited success. I can properly simulate you example on Proteus and works like a charm. But when hardwired it fails and I can not get anything to display. Using ICSP and programming the PIC I will get some semblence of the display to work, but when the project is powered off/on nothing is displayed. I suspect the KS0108 is not initializing properly. Have experimented with adding various delays etc, but still no luck. The GLCD is fine as I have experimented displaying using other project code with success, just can not get you example to work. Any suggestions??
 

Attachments

Pommie

Well-Known Member
Most Helpful Member
Hi bryan,

The only thing that would stop it working is if the defines in LCD.h were wrong or you don't have a crystal. I'm assuming you are using the code from this thread. If you have earlier code then you need to change Init_GLCD in GLCD.c. You should also try switching to the internal oscillator - see page two of above thread.

Mike.
 

Latest threads

EE World Online Articles

Loading

 
Top