|
|
View previous topic :: View next topic |
Author |
Message |
ROBOTICAR
Joined: 28 Aug 2007 Posts: 45
|
show picture in glcd (k0108) |
Posted: Thu Dec 20, 2007 2:38 am |
|
|
how can I show image in glcd?are there any function for that?
I use PIC16F877A . How many page can I show in glcd?
thanks a lot |
|
|
Foppie
Joined: 16 Sep 2005 Posts: 138 Location: The Netherlands
|
|
Posted: Thu Dec 20, 2007 3:22 am |
|
|
these files may give you a hint in the right direction:
c:\program files\picc\examples\ex_glcd.c
c:\program files\picc\drivers\graphics.c
c:\program files\picc\drivers\ks0108.c
c:\program files\picc\drivers\hdm64gs12.c
You also can try a look through the code library. There are many code examples for glcds there, some might have code for pictures included.
Hope this helps |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
|
ROBOTICAR
Joined: 28 Aug 2007 Posts: 45
|
|
Posted: Fri Dec 21, 2007 12:01 pm |
|
|
How many byte can I definition to array in 16f877?
for example when I want to definition a array to show it in glcd ;
I can't definition more than [90].
but I want to definition I[512] for show to glcd.
Can you help me? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Dec 21, 2007 12:25 pm |
|
|
Use the 'const' keyword to put the array in ROM, instead of RAM.
Then you can make an array larger than 90 bytes. When it's
in ROM, it can be up to 255 bytes. (This is the limit for 16F-series PICs).
If you need a const array larger than this, then split it into two or more
arrays. See the example in the GLCD.c file. It's in this directory:
Quote: | c:\Program Files\picc\Drivers\glcd.c |
Two arrays are used to store the character data in ROM:
Code: | const int8 Text[51][5] =
{0x00, 0x00, 0x00, 0x00, 0x00, // SPACE
0x00, 0x00, 0x5F, 0x00, 0x00, // !
// Etc. |
Code: | const int8 Text2[44][5]=
{0x26, 0x49, 0x49, 0x49, 0x32, // S
0x01, 0x01, 0x7F, 0x01, 0x01, // T |
|
|
|
ROBOTICAR
Joined: 28 Aug 2007 Posts: 45
|
|
Posted: Tue Dec 25, 2007 6:32 am |
|
|
thanks for help.
can you introduce some programs to create bitmap picture for glcd? |
|
|
Bcox
Joined: 09 Oct 2007 Posts: 17 Location: Windsor, CT
|
|
Posted: Fri Jan 04, 2008 7:10 am |
|
|
Here is a function I have created to put into the glcd.c file when using it with a 128x64 KS0108 glcd. The program reads from program memory where I had to store my image (i.e. #ROM 0x1000 = image in hex format).
For those somewhat new to GLCDs, make sure you take a look at your chip select lines on your glcd. On the display I am using, they are low active instead of high active so in my glcd.c file, I had to reverse this so my image would show up on the correct side of the screen. Just a small note but I have seen this come up in other threads.
Code: | void glcd_image(long mempointer //This is the image location in program memory)
{ int j, i;
int page = 0xB8;
char chipsel;
char buffer[1];
output_low(GLCD_DI); // Set for instruction
glcd_writeByte(GLCD_CS1, 0x40); // Set the column address to 0
glcd_writeByte(GLCD_CS2, 0x40);
glcd_writeByte(GLCD_CS1, page); // Set the page address to 0
glcd_writeByte(GLCD_CS2, page);
for (j = 0; j < 8; j++, page+=1)
{ output_low(GLCD_DI);
glcd_writeByte(GLCD_CS1, page);
glcd_writeByte(GLCD_CS2, page);
for (i = 0; i < 128; i++)
{
if ( i < 64)
{
chipsel = GLCD_CS1;
}
else
{
chipsel = GLCD_CS2;
}
read_program_memory(mempointer, buffer, 1);
mempointer++;
output_high(GLCD_DI);
glcd_writeByte(chipsel, *buffer);
}
}
} |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|