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.

Glcd

Status
Not open for further replies.

AtomSoft

Well-Known Member
Just got my GLCD in yesterday and went programming. Im using a PIC18F248 and noticed im going to need some more memory :D or at least learn SD. I was wondering if anyone can recommend a larger dsPIC or something. Here are some images of what ive got so far. Im like a fat kid in the candy store lol (so happy)

So can someone recommend a new PIC and or some memory device.
I can only fit about 2 pages on both sides. Also for some reason i have to have it upside down?

When i first got it:
**broken link removed**

**broken link removed**

Soldering Skills (even though lots of space):
**broken link removed**

My Logo:
**broken link removed**

It at work: (yay!)
**broken link removed**

I know... i know... its messy but heh its easier to move wiers if anything.
 
Why do you need more memory? Why not a bigger 18F PIC? Try a 18F4620, it is as bill referred to it as "A beast" :)
 
Hi,

That looks a great start - it sure is a good feeling when it finally displays.

Have you coded it in MCC18 or Assembler ?

Think you might find your upside down thing is one of the glcd initialisation parameters.

If you are wanting to create your own fonts - your might find this link / utility very handy - it also has a couple of fonts there for you to try.
**broken link removed**

Richard
 
lol futz and mike.

Futz no one told me its rotated for the GLCDs. Well i just read something on a site and it seems there is a sticker on the back which will tell you if its Top Side or Bottom Side. Anyone got some ideas on how to store large amount of bytes for example 300 bytes and be able to pull them out 1 by 1. I used a unsigned char and it works well but the max allowed is 255 by the whole program. I rewrote it to work on MCC18.

I have full version now. But anyway... Any thoughts on the code?
 
lol futz and mike.

Futz no one told me its rotated for the GLCDs. Well i just read something on a site and it seems there is a sticker on the back which will tell you if its Top Side or Bottom Side. Anyone got some ideas on how to store large amount of bytes for example 300 bytes and be able to pull them out 1 by 1. I used a unsigned char and it works well but the max allowed is 255 by the whole program. I rewrote it to work on MCC18.

I have full version now. But anyway... Any thoughts on the code?
If your data is static (for display - doesn't need to be changed) you can store it in program memory like this:
Code:
rom char *alpha1 = {
	0x3e,0x51,0x49,0x45,0x3e,	//0
	0x00,0x42,0x7f,0x40,0x00,	//1
	0x72,0x49,0x49,0x49,0x46,	//2
	0x22,0x49,0x49,0x49,0x36,	//3
	0x0f,0x08,0x08,0x7f,0x08,	//4
	0x2f,0x49,0x49,0x49,0x31,	//5
	0x3e,0x49,0x49,0x49,0x32,	//6
	0x41,0x21,0x11,0x09,0x07,	//7
	0x36,0x49,0x49,0x49,0x36,	//8
	0x26,0x49,0x49,0x49,0x3e,	//9
	0x7c,0x0a,0x09,0x0a,0x7c,	//A
	0x7f,0x49,0x49,0x49,0x36,	//B
	0x3e,0x41,0x41,0x41,0x22,	//C
	0x7f,0x41,0x41,0x41,0x3e,	//D
	0x7f,0x49,0x49,0x49,0x41,	//E
	0x7f,0x09,0x09,0x09,0x01,	//F
	0x3e,0x41,0x49,0x49,0x3a,	//G
	0x7f,0x08,0x08,0x08,0x7f,	//H
	0x00,0x41,0x7f,0x41,0x00,	//I
	0x20,0x40,0x40,0x40,0x3f,	//J
	0x7f,0x08,0x14,0x22,0x41,	//K
	0x7f,0x40,0x40,0x40,0x40,	//L
	0x7f,0x02,0x04,0x02,0x7f,	//M
	0x7f,0x04,0x08,0x10,0x7f,	//N
	0x3e,0x41,0x41,0x41,0x3e,	//O
	0x7f,0x09,0x09,0x09,0x06,	//P
	0x3e,0x41,0x51,0x21,0x5e,	//Q
	0x7f,0x09,0x09,0x09,0x76,	//R
	0x26,0x49,0x49,0x49,0x32,	//S
	0x01,0x01,0x7f,0x01,0x01,	//T
	0x3f,0x40,0x40,0x40,0x3f,	//U
	0x1f,0x20,0x40,0x20,0x1f,	//V
	0x7f,0x20,0x10,0x20,0x7f,	//W
	0x63,0x14,0x08,0x14,0x63,	//X
	0x01,0x02,0x7c,0x02,0x01,	//Y
	0x61,0x51,0x49,0x45,0x43};	//Z
That syntax is a BoostC thing only. Other compilers use different syntax to do the same thing.
 
void loadimg(rom char *image, unsigned int len);...

unsigned rom char toplogo_bmp[1024] = ...

To call it:
loadimg(&toplogo_bmp[0], 1024);

I was able to do it using the above. Now i put a full screen logo! Heres a PIC* (lol get it?)

I actually figured it out reading the manual (thx tho futz i appreciate the help buddy! (everyone else also))

5-jpg.21275
 

Attachments

  • 5.jpg
    5.jpg
    285.1 KB · Views: 5,350
Last edited:
Congrats on getting it working.

As for storing screen images, I used a 16f886 and used the first 4k for code and the second 4k to store 4 screen images. To copy the screen from memory to the GLCD took 16mS and to write the screen to memory took (I think) around 100mS. I later added a 1M I²C EEPROM and used that to store a further 128 screen images.

Mike.
 
any links to the 1m memory? I just learned i2c and would love to intertwine the 2 :D

Here is Futz Font (well i seperated it into NUMbers and ALPHAbets). This just show the numbers side. Also i made it so once it hits 0x7F (Pixel 63 on the left side) it will jump to right side and start from y=0x40 (pixel 0). Whatcha think?

6-jpg.21277
 

Attachments

  • 6.jpg
    6.jpg
    305.4 KB · Views: 5,205
You can get the EEPROM from Microchip (**broken link removed**) about $4 each. If you have the basic I²C routines, they are very easy to use.

Mike.
 
Last edited:
yeah i got basic routines. Read / Write and all working stuff. Im building a programmer for i2c eeprom. So i can send data straight to it from a terminal program. (im making program also :D ) Its in the works but will be done in couple days.

Thanks!
 
The 208mil is the package width without the pins. However, in 8 pin devices the width and length are the same.

Mike.
 
What is really useful is havening 1KB of memory to spare. Because thats how much memory it takes to store a full screen image in ram. What this alows you is to have a buffer. It sppeds things up a great deal.

I have made a extensive GLCD lib in MPLAB for the 16bit family. It was developed with a **broken link removed** . It could draw 100 pictures of 64x64 at any Y position (not multiples of 8 or pages) with OR XOR or AND merge with background plus make them bounce around with simple physics utilizing floating point math.And all of this ran at about 30 fps. More qould be sqezed out of it if i overcooked the pic to 40MIPS (its rated for 30MIPS but seems to work fine at 40)

I can make the code available if anyone wants it.With a little tweaking it should run on a 18F too.
 
Well you can probably get it to compile for a 18F if it has enough RAM. But you need to change a few SFRs in the initialization and the C file that sends the data to the display. Altho it may be a tad slow on a 18F without optimizing the code a bit, but nothing serious.

Oh and if you want to display text you can use my font. Its not the best font but it gets the job done.
 
i think there in "font.h" . There should be a rom constant array in there.Its about 2KB

The font contains 255 ASCII characters, each character is 8x8 pixels.To draw a character you jump to 8*ascii and then print 8 bytes from it to the display.
 
dude check page 1 i already know how to put it on screen i used futz fonts before https://www.electro-tech-online.com/threads/glcd.41023/#post332104

Thanks for the tips tho.. Ill post my code give me a minute to make sure not to ugly :D

Sorry if not full of comments. Its like 7 ish am here and im still soo tired and my body hurts from work. So i need to relax. But here it is.

EDIT: UPLOADED the new (right) file.
 

Attachments

  • glcd_c18.c
    11.2 KB · Views: 1,820
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top