CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

ST7920 how to set a pixel ON

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mortaurat



Joined: 23 Jul 2009
Posts: 14

View user's profile Send private message

ST7920 how to set a pixel ON
PostPosted: Tue Aug 11, 2009 2:21 am     Reply with quote

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.
mortaurat



Joined: 23 Jul 2009
Posts: 14

View user's profile Send private message

PostPosted: Tue Aug 11, 2009 5:33 am     Reply with quote

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.
mortaurat



Joined: 23 Jul 2009
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 12, 2009 10:42 am     Reply with quote

up
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 12, 2009 4:25 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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