Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] ST7565P COG LCD setPixel not working

Status
Not open for further replies.

abilashjoseph

Member level 1
Member level 1
Joined
Sep 8, 2009
Messages
34
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Kerala
Activity points
1,560
hi,

I have a COG LCD with part number ''NHD-C12864A1Z-FSB-FBW-HTT" and SPI interface with driver ST7565P. I displayed images and characters by page control.

My problem is i cant set single pixel in the display. that is first i set one pixel in (x,y) position after that i tried to set in (x1,y1).
at that time the (x,y) pixel is shifted to (x,y1). and (x.y) position is cleared .

any one know what is the issue. any commands error or my code error.

am using 0x40|line_address for controlling line.

Thanks in advance

Abilash Joseph
 

Hi,

don´t you think it´s a good idea to show your code? ...including display setup routine.

Klaus
 

Anyway, you should not use pixel by pixed drawing. All display drivers realising two simple functions - define the window and put the data. Same in linux framebuffer, same everywhere.
 

hi all,

Thanks for the replay. I can display the images and characters using pages. its working.

my requirement is to write a function to draw lines, rectangles, circles in the display.

The code for LCD initialization is given below

Code:
void init_lcd()
    {
        
      SPI1_send_cmd(0xA0); //RAM address segment
      SPI1_send_cmd(0xAE); // Display OFF
      SPI1_send_cmd(0xC0);  //COM output scan direction
      SPI1_send_cmd(0xA3);  //1/7 Bias
      SPI1_send_cmd(0x2C);
      DelayMs(50);
      SPI1_send_cmd(0x2E);
      DelayMs(50);
      SPI1_send_cmd(0x2F); 
      DelayMs(50);
      SPI1_send_cmd(0x26); // set built-in resistor ratio
      SPI1_send_cmd(0x81); 
      SPI1_send_cmd(0x08); 
      SPI1_send_cmd(0xA6); // Display normal (0xA6) or reverse (0xA7)
      SPI1_send_cmd(0xAF);   //on/off
    }

The code for set pixel is given below

Code:
void putPixel(int x1, int y1)
    {
    SPI1_send_cmd(0xB0);
    writeaddress(x1,0x40|y1);
    SPI1_send_data(0x01);
      
    }

 void writeaddress(unsigned char addressX, unsigned char addressY)
{
	 SPI1_send_cmd(addressY); 
     SPI1_send_cmd(0x10|addressX>>4); 
     SPI1_send_cmd(0x0F&addressX);     
}

Regards
Abilash
 
Last edited by a moderator:

hi all,

Thanks for the support, its working with circles,rectangles and lines.


regards
abilash
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top