|
|
View previous topic :: View next topic |
Author |
Message |
fiasgardone
Joined: 19 Jan 2010 Posts: 71
|
GLCD_TESTING |
Posted: Thu Apr 19, 2012 2:54 am |
|
|
Hi!!
I making some tests with GLCD, want on top of GLCD white and black letters in the bottom of GLCD black and white letters.
That is, the table top as opposed to low!!
But does not work with my code!
thank you
[/img]
Code: |
#include <16F877A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay (clock=20M)
#include <HDM64GS12.c>
#include <graphics.c>
#use standard_io(A)
void main()
{
char tmp4[]= "TODAY";
glcd_init(1);
while(1)
{
glcd_rect(0,1,127,30,no,ON); //
glcd_text57(30,10,tmp4,2,on);
delay_ms(1500);
glcd_rect(0,35,127,63,yes,on);
glcd_text57(30,40,tmp4,2,off);
}
}
|
|
|
|
hoangkhuong
Joined: 16 Mar 2012 Posts: 31
|
|
Posted: Thu Apr 19, 2012 3:28 am |
|
|
It does not work but can you tell us why ? What does it display ? |
|
|
fiasgardone
Joined: 19 Jan 2010 Posts: 71
|
|
Posted: Thu Apr 19, 2012 3:56 am |
|
|
hoangkhuong wrote: | It does not work but can you tell us why ? What does it display ? |
For example!, I want the bottom frame shows how this image
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Thu Apr 19, 2012 8:06 am |
|
|
More information is needed...
1) is this real hardware or a simulation ?
2) does the text show up?
You should run a few test to confirm all GLCD locations work correctly and that you do not have a wiring error.
If that is Ok, then either the GLCD does not conform to the driver or you may have a bad GLCD.
I do not have that GLCD so cannot test to see if it's a driver or GLCD problem. |
|
|
fiasgardone
Joined: 19 Jan 2010 Posts: 71
|
|
Posted: Thu Apr 19, 2012 11:42 am |
|
|
temtronic wrote: | More information is needed...
1) is this real hardware or a simulation ?
2) does the text show up?
You should run a few test to confirm all GLCD locations work correctly and that you do not have a wiring error.
If that is Ok, then either the GLCD does not conform to the driver or you may have a bad GLCD.
I do not have that GLCD so cannot test to see if it's a driver or GLCD problem. |
Hi!
I'm doing the tests currently in proteus! I always do the first tests in proteus, and then step into the real circuit!
The code works, the problem is when I want GLCD all black and the letters visible! instead of the letters or the word appears as small squares in the first post, rather than TODAY, five square appears
thanks for help |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Thu Apr 19, 2012 2:53 pm |
|
|
Hi,
I think you are misunderstanding the glcd_text57 function. The 'color' parameter determines whether pixels that define the character are On or Off, not whether the character is black on white, or white on black. If you want that functionality, you need to write a custom function to do this. Once you realize this, the solution is trivial.
A common usage with the color parameter set to Off is to erase previously written text.
John |
|
|
fiasgardone
Joined: 19 Jan 2010 Posts: 71
|
|
Posted: Fri Apr 20, 2012 1:43 am |
|
|
ezflyr wrote: | Hi,
I think you are misunderstanding the glcd_text57 function. The 'color' parameter determines whether pixels that define the character are On or Off, not whether the character is black on white, or white on black. If you want that functionality, you need to write a custom function to do this. Once you realize this, the solution is trivial.
A common usage with the color parameter set to Off is to erase previously written text.
John
|
Hi!
I did several tests today, but I can not do what I want! Do not know why I can not for the GLCD black and the letters visible!
Quote: |
If you want that functionality, you need to write a custom function to do this. Once you realize this, the solution is trivial.
|
John, what function do I have to work it, can you give an example? |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Fri Apr 20, 2012 9:09 am |
|
|
Hi,
The function you need to modify is the glcd_text57 routine itself.
You really should try to understand how this code is working for yourself, and then the solution will become obvious. If you just re-cycle someone else's code, you'll never learn anything....
Each character that can be written by glcd_text57 routine has 5 bytes of data associated with it. This data is contained in the TEXT and TEXT1 arrays in the driver file. I recommend that you pick a character, say the number '3', and see how the array data for this character relates to what is displayed on the GLCD. Use a piece of graph paper to visualize the 5 X 7 character, and see which pixels are turned On to make the '3' appear. You'll note that the character is 7 pixels high (this fits in a byte!), and five pixels wide (5 bytes per character!). Once you get this, you should see clearly what needs to be modified in the routine to do what you want!
I modified my glcd_text57 routine in two ways:
1. The original routine only turned On pixels that were required for a given character. This required clearing the display space when text was being updated with different values. I modified the routine to explicitly turn On required pixels, and explicitly turn Off non-required pixels. This allows data to be rapidly updated on the GLCD without flickering.
2. I added a 'Reverse' parameter to the function argument list. When set to '0' the function works normally. When set to '1', the function inverts the pixel definition for a character. This allows data to be present as black on white, or white on black.
I hope this helps you to understand things a little bit more?
John |
|
|
fiasgardone
Joined: 19 Jan 2010 Posts: 71
|
|
Posted: Sat Apr 21, 2012 2:49 am |
|
|
ezflyr wrote: | Hi,
The function you need to modify is the glcd_text57 routine itself.
You really should try to understand how this code is working for yourself, and then the solution will become obvious. If you just re-cycle someone else's code, you'll never learn anything....
Each character that can be written by glcd_text57 routine has 5 bytes of data associated with it. This data is contained in the TEXT and TEXT1 arrays in the driver file. I recommend that you pick a character, say the number '3', and see how the array data for this character relates to what is displayed on the GLCD. Use a piece of graph paper to visualize the 5 X 7 character, and see which pixels are turned On to make the '3' appear. You'll note that the character is 7 pixels high (this fits in a byte!), and five pixels wide (5 bytes per character!). Once you get this, you should see clearly what needs to be modified in the routine to do what you want!
I modified my glcd_text57 routine in two ways:
1. The original routine only turned On pixels that were required for a given character. This required clearing the display space when text was being updated with different values. I modified the routine to explicitly turn On required pixels, and explicitly turn Off non-required pixels. This allows data to be rapidly updated on the GLCD without flickering.
2. I added a 'Reverse' parameter to the function argument list. When set to '0' the function works normally. When set to '1', the function inverts the pixel definition for a character. This allows data to be present as black on white, or white on black.
I hope this helps you to understand things a little bit more?
John |
Thanks for helping John
I do not know to modify the function GLCD , sorry!!! I have studied the grafics driver, but I do not know what to change to my application.
I do not want anything done, I'm here to learn, but sometimes it is difficult to understand.
Today I did a test with the example of CCS EX_GLCD not show WARNING!
Look at the picture, any help is welcome
|
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Sat Apr 21, 2012 7:25 am |
|
|
Hi,
Sorry, I can't help you anymore, as your problem seems to be a "moving target" (ie. the question keeps changing), and you seem more interested to "just get it working" than to try to understand what is going on. Also, this seems to be a pure simulation exercise which doesn't interest me.
Good luck!
John |
|
|
fiasgardone
Joined: 19 Jan 2010 Posts: 71
|
|
Posted: Sat Apr 21, 2012 8:29 am |
|
|
ezflyr wrote: |
and you seem more interested to "just get it working" than to try to understand what is going on.
John |
Hi! John!!
I regret that so'll understand, I would like to understand how it works great, but understand who knows!
Thanks for helping |
|
|
|
|
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
|