View previous topic :: View next topic |
Author |
Message |
Bcox
Joined: 09 Oct 2007 Posts: 17 Location: Windsor, CT
|
Large fonts for KS0108 glcd |
Posted: Thu Oct 25, 2007 7:23 am |
|
|
Hello all,
I am developing a system to read and display ADC values using a KS0108 controlled glcd. I am looking for character map for numbers 0-9 that are around 40 pixels tall. I have tried using the glcd_text57 in the glcd.c drivers with a scale of 4 but the numbers look too blocky. I did find the large font that I require but the numbers are not rotated 90 degrees so I can't use the glcd_writeByte function. I am forced to display the characters pixel by pixel using the glcd_pixel which is extremely slow. I would like to find a font such that I can use code that is somewhat similar to what I have created to display an image over the entire screen (below). I am storing my character maps in program memory and am trying to get away with using the internal 8Mhz clock of the PIC16F917 chip I am using. Any help would be greatly appreciated!
Code: | void glcd_image(long mempointer)
{ 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);
}
}
} |
|
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
|
octal
Joined: 15 Jan 2007 Posts: 39
|
|
Posted: Thu Oct 25, 2007 8:45 am |
|
|
You can easily create your fonts using GLCD Font Creator (@site Admin: sorry I hope it will not be considered as an advertisement for my shareware here... ) http://www.pocketmt.com . For rendering the big fonts you can reuse the C code from the XGLCD Lib project (sources given for another C compiler on my same own web page) and adapt the sources for CCS. It's very easy to do adaptation (I'll do it if I have enough time) since in XGLCD Lib you need only two high level functions, so you can use the CCS driver's functions:
1- One for Initialising the display (from CCS driver)
2- the glcd_writeByte function (from CCS driver)
Reuse these two functions instead of that I used in the lib and you can got the XGLCD Lib adapted to use CCS driver and you can draw BIG fonts of any size.
Regards
octal _________________ http://www.pocketmt.com the GLCD Font Creator home |
|
|
0xFF_GLCD Guest
|
Image |
Posted: Thu Oct 25, 2007 6:20 pm |
|
|
You have a picture on display? Post code please! |
|
|
Bcox
Joined: 09 Oct 2007 Posts: 17 Location: Windsor, CT
|
|
Posted: Fri Oct 26, 2007 5:22 am |
|
|
oxFF,
The code I previously posted displays an image. I am using a 128x64 KS0108 glcd. This code displays an image that is 128x64. To create the image in C data form, I created a monochrome bitmap and then used a program called glipic from http://www.compsys1.com/workbench/Benchware/Glipic/glipic.html
I am storing the image in program memory because I do not want to use any external hardware. The input to the function is the program memory location where the picture is stored.
Octal, If you end up having the time to post that code, it would be appreciated. Thanks for the link. I will be checking out the program and code today. |
|
|
Bcox
Joined: 09 Oct 2007 Posts: 17 Location: Windsor, CT
|
|
Posted: Fri Oct 26, 2007 5:39 am |
|
|
I almost forgot...I used the glcd.c driver and added this code to it. You will need to check your chip select signals for your glcd. My chip selects are low active so I needed to modify glcd.c to give an active low when writing to GLCD_CS1 or GLCD_CS2. If your cs lines are low active like on my glcd, then your picture will have the left half of the picture on the right side of the screen and visa-versa. |
|
|
eduardoludgero
Joined: 14 Oct 2007 Posts: 3
|
|
|
octal
Joined: 15 Jan 2007 Posts: 39
|
|
Posted: Fri Oct 26, 2007 1:53 pm |
|
|
Bcox wrote: |
Octal, If you end up having the time to post that code, it would be appreciated. Thanks for the link. I will be checking out the program and code today. |
Hi,
I'll be glad to do the quick port of my XGLCD Lib to CCS compiler. The problem I'm facing is that I do not own a CCS license, and with the Demo version I can not build code with more than 2KB of data, which is a really big problem because BIG FONTS already make tables larger or near 2KB, so there will not be sufficient room for the lib code.
What I'll try to do is what I does for the other compiler I wrote the XGLCD lib for, i.e. I'll make a font with only 3 or 4 BIG chars and I'll try to develop everything with that, and once finished I'll send you (or publish) codes to do tests with full fonts tables.
I'll try to do the port this weekend.
Regards
octal _________________ http://www.pocketmt.com the GLCD Font Creator home |
|
|
Bcox
Joined: 09 Oct 2007 Posts: 17 Location: Windsor, CT
|
|
Posted: Mon Oct 29, 2007 5:32 am |
|
|
Thanks Octal. If it doesn't work out, no big deal. I spent some time the other day developing my own character set for numbers 0-9 that are 29Wx47H. I should be testing them and developing code this week to display them. I am not sure when I will get to it, I many other things on my plate this week. Thanks again! |
|
|
Deep Guest
|
request - XGLCDlib |
Posted: Sun Feb 28, 2010 6:06 am |
|
|
Bcox wrote: | Thanks Octal. If it doesn't work out, no big deal. I spent some time the other day developing my own character set for numbers 0-9 that are 29Wx47H. I should be testing them and developing code this week to display them. I am not sure when I will get to it, I many other things on my plate this week. Thanks again! |
hey can you just share the XGLCD lib - ported for CCS C compiler?
Then it would be very useful.... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Feb 28, 2010 1:18 pm |
|
|
Go to Octal's website and contact him there. His website is given in his
post. |
|
|
Deepu
Joined: 06 May 2009 Posts: 2
|
Request for GLCD bitmap font algorithm |
Posted: Mon Mar 01, 2010 3:26 am |
|
|
Hi PCM programmer,
I had tried different code many times, till now I was not able to display a letter in GLCD (with CCS C 4.088).
I was trying to use the fonts with 16f877a but due to the RAM limitation for 2d array I changed to 18f452. Actually I was trying to port the font algorithm code used in Michael J. Kara solution, found on 8502.com /modified for the ARM7-glcd-Demo-Project (fonts used in
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/glcd_dcf77/index.html )
I don't know other compilers, could you please help me on this ?
It would be very grateful if you can identify the requirement.
Thanks
Deep |
|
|
Deepu
Joined: 06 May 2009 Posts: 2
|
Re: Request for GLCD bitmap font algorithm |
Posted: Wed Mar 03, 2010 9:10 pm |
|
|
Deepu wrote: | Hi PCM programmer,
I had tried different code many times, till now I was not able to display a letter in GLCD (with CCS C 4.088).
I was trying to use the fonts with 16f877a but due to the RAM limitation for 2d array I changed to 18f452. Actually I was trying to port the font algorithm code used in Michael J. Kara solution, found on 8502.com /modified for the ARM7-glcd-Demo-Project (fonts used in
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/glcd_dcf77/index.html )
I don't know other compilers, could you please help me on this ?
It would be very grateful if you can identify the requirement.
Thanks
Deep |
Thanks for no reply |
|
|
guest1 Guest
|
GLCD Bitmap font algorithm |
Posted: Thu Mar 04, 2010 12:10 pm |
|
|
You would probably receive more assistance if you posted a short, working program to show your efforts and request *help*, rather than a blanket request for someone else to do it for you. Getting angry when someone does not stop their work to do something for you is not very nice, either. |
|
|
Deepu1 Guest
|
Re: GLCD Bitmap font algorithm |
Posted: Thu Mar 04, 2010 10:05 pm |
|
|
guest1 wrote: | You would probably receive more assistance if you posted a short, working program to show your efforts and request *help*, rather than a blanket request for someone else to do it for you. Getting angry when someone does not stop their work to do something for you is not very nice, either. |
Sorry, Guest1 and PCM Programmer..........
I didn't mean like that...... didn't even think....... anyway i'm sorry...
Thanks. |
|
|
|