Continue to Site

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.

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

Status
Not open for further replies.

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,

**broken link removed**

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:
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.
 
Mike have you ever heard of Conways Life? This is what I'd like the demo to do. I figured on using only half a display for a 64x64 board. I wonder what a maple leaf does in life?

PS can I use the photo with the leafs on my site? Will give credit to you of course.
**broken link removed**
**broken link removed**
https://www.bitstorm.org/gameoflife/
 
Last edited:
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.
 
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:
The max operating current is 15mA - typically 6mA. The backlight takes up to 120mA, in the photo above I have it at about 20mA.

**broken link removed**.

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

**broken link removed**.

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 (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
 
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.
**broken link removed**

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

Mike.
 
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.
 
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...:)
 
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.
 
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.

**broken link removed**

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:
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:
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

  • GLCD.JPG
    GLCD.JPG
    16.2 KB · Views: 1,081
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.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top