View previous topic :: View next topic |
Author |
Message |
mortaurat
Joined: 23 Jul 2009 Posts: 14
|
ST7920 how to set a pixel ON |
Posted: Tue Aug 11, 2009 2:21 am |
|
|
Hello,
I need to complete my driver for lcd with ST7920 controler.
I would like to set a pixel on with a XY position in order to trace line and circle.
In the lcd display datasheet there is no instruction to set a pixel on, moreover there is no function to place the cursor in a XY position.
In order to create a pixel I think that I've to create one character into the CGRAM and display it when I need to use this one. But I couldn't display two dots nearby (if the character is store in a 5x5 matrice and if I set the pixel 3x3 On the next character will be far of two pixel). Moreover I don't know how to store a character into the CGRAM....
To put on a pixel with a XY position, I think I've to use the function "cursor display control" but when I use this instruction, the cursor move toward the right or the left but not of one pixel....
Moreover if I divide my lcd display in 4 parts (4line) and if I try to display a sentence, it will display first in line one then line 3, then line 2 and the end of the sentence line 4...
What do you think about it ?
sorry for my english. |
|
![](templates/subSilver/images/spacer.gif) |
mortaurat
Joined: 23 Jul 2009 Posts: 14
|
|
Posted: Tue Aug 11, 2009 5:33 am |
|
|
I think I succeed to write a character into the CGRAM.
Code: | void lcd_define_custom_char ()
{
//define what's a pixel
int pixel[1][8] = {{128,128,128,128,132,128,128,128}};
int i, j;
Lcd_instruction(0x40); // aller à l’adresse de début de la CGRAM
for (i=0; i<=1; i++) // send pixel[1][8]
{
for (j=0; j<=7; j++)
{
Lcd_data(pixel[i][j]);
delay_us(100);
}
}
lcd_instruction(0x1); //go home
} |
But I don't know how to display it and select it's position. |
|
![](templates/subSilver/images/spacer.gif) |
mortaurat
Joined: 23 Jul 2009 Posts: 14
|
|
Posted: Wed Aug 12, 2009 10:42 am |
|
|
up |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Aug 12, 2009 4:25 pm |
|
|
My advice is to Google for code and study how other people do it.
Not all of the code will be finished code, but some of it may give
you some tips on how to do it. Search for these words:
Quote: | ST7920 int char while main pixel |
This will find C source code associated with pixel operations |
|
![](templates/subSilver/images/spacer.gif) |
|