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

Winstar GLCD display

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



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

Winstar GLCD display
PostPosted: Tue Oct 08, 2013 12:43 am     Reply with quote

Hi,
I'm using PIC18LF2520, Oscillator type: Internal 1Mhz, GLCD: Winstar WG12232A-YYH, Compiler version: 4.114

Earlier i worked with KS0108 display. But i have problem with winstar display. I can't see the enable pin.

Which driver can i use to display the text on the display?

Thanks in advance:)
Ttelmah



Joined: 11 Mar 2010
Posts: 19346

View user's profile Send private message

PostPosted: Tue Oct 08, 2013 2:35 am     Reply with quote

You'd have to write your own.....

However not (possibly) quite as bad as it sounds. This display has two controllers each operating half the display. Each is a SBN1661, and these are compatible with the SED1520. Now the SED 1520, uses a subset of the commands supported by the SED1335 (which supports larger panels). There is a driver for the 1335 with the compiler. There are two separate 'enable' pins for the two chips, pins 5&6 (CE1, and CE2). Temporarily ignore half the display, and using just one enable, try the SED1335 driver, modified for the smaller display. If this can be got working, then it just becomes a matter of enabling the second chip when using the second half of the display, and offsetting the X coordinate.

Best Wishes
hemnath



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

PostPosted: Tue Oct 08, 2013 3:57 am     Reply with quote

Thanks Ttelmah for your suggestion.

First, I'm displaying all the pixels ON. But nothing on the display.

Code:
#include "18F2520.h"
#fuses INTRC_IO
#use delay(clock = 1000000)

#define CS1 PIN_B4
#define CS2 PIN_B5
#define A0  PIN_B3

void main()
{
   // R/W pin - LOW; RES pin- HIGH
   output_high(CS1);   
   output_high(CS2);

   output_high(A0);   // command mode
   output_a(0x3F);      //

   while(1)
   {   
      output_low(CS1);
      output_high(CS2);
      delay_ms(500);
      output_high(CS1);
      output_low(CS2);   
   }
}
Ttelmah



Joined: 11 Mar 2010
Posts: 19346

View user's profile Send private message

PostPosted: Tue Oct 08, 2013 4:19 am     Reply with quote

You are just toggling the chip selects. You still have to write data, set direction etc...

As I said, look at the SED1335 driver, and modify this for one half the display width.
You are not going to get very far just operating the select lines. You need byte wide data, plus the R/W control etc...
hemnath



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

PostPosted: Tue Oct 08, 2013 4:42 am     Reply with quote

In SED1335 Driver, I have changed the following lines,

GLCD_WIDTH as 122
GLCD_HEIGHT as 32
input_d() as input_a()
A0 as PIN_B3
CS as PIN_B4

But don't know what to assign to these defines,
Code:

#ifndef GLCD_RD
#define GLCD_RD            PIN_B5
#endif

#ifndef GLCD_WR
#define GLCD_WR            PIN_B1
#endif
hemnath



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

PostPosted: Wed Oct 09, 2013 2:30 am     Reply with quote

I have only R/W pin.. What is GLCD_RD and GLCD_WR in that driver?
Which pins should i connect to?

Please help.
Ttelmah



Joined: 11 Mar 2010
Posts: 19346

View user's profile Send private message

PostPosted: Wed Oct 09, 2013 3:12 am     Reply with quote

As I said, _modified_.

The larger chip has separate read/write pins. The smaller has instruction/data enable, chip enable, and a combined R/W. The point is that the basic command set is the same, so you have to write the I/O section using this, to talk to your display.

It's called programming.....
hemnath



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

PostPosted: Wed Oct 09, 2013 3:42 am     Reply with quote

Yes i have modified the code as you said.

sample code:
Quote:
#include "18F2520.h"
#fuses INTRC_IO
#use delay(clock = 1000000)

#include "SED1335_LPM.c"

void main()
{
glcd_systemSetup();
glcd_init(ON);
glcd_power(ON);
while(1)
{
glcd_fillScreen(ON);
}
}


SED1335_LPM.c
Code:
#ifndef GLCD_WIDTH
#define GLCD_WIDTH         122
#endif

#ifndef GLCD_HEIGHT
#define GLCD_HEIGHT        32
#endif

#ifndef GLCD_CHAR_WIDTH
#define GLCD_CHAR_WIDTH    8
#endif

#ifndef GLCD_CHAR_HEIGHT
#define GLCD_CHAR_HEIGHT   8
#endif

#ifndef GLCD_RST
#define GLCD_RST           PIN_C1
#endif

#ifndef GLCD_RD
#define GLCD_RD            PIN_C0
#endif

#ifndef GLCD_WR
#define GLCD_WR            PIN_C0
#endif

#ifndef GLCD_CS
#define GLCD_CS            PIN_B4
#endif

#ifndef GLCD_A0
#define GLCD_A0            PIN_B3
#endif

and output_d() as output_a()

But nothing is displayed on the display. I don't know what to do now. Please help.
Ttelmah



Joined: 11 Mar 2010
Posts: 19346

View user's profile Send private message

PostPosted: Wed Oct 09, 2013 4:18 am     Reply with quote

As I said, _you_need to modify the code. Not just the settings.
hemnath



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

PostPosted: Wed Oct 09, 2013 4:37 am     Reply with quote

I dunno where to modify. So i'm writing of my own. Please check this program. It is not working. Does my glcd_cmd and glcd_data are correct?

Code:
#include "18F2520.h"
#fuses INTRC_IO
#use delay(clock = 1000000)

#define A0    PIN_B3
#define CS1   PIN_B4
#define CS2   PIN_B5

const unsigned char data[]  = {0x00, 0x00, 0xE7, 0xE7, 0xE7, 0xE7, 0x00, 0x00};    // invert of H

void glcd_data(unsigned char z);
void glcd_cmd(unsigned char c);

unsigned int i;

void main()
{
   output_high(CS1);      // CS1 connected to PIN_B0
   output_high(CS2);     //  CS2 connected to PIN_B1
   
   glcd_cmd(0xe2);   //software Reset
   glcd_cmd(0xa0);   //Select ADC = 0
   glcd_cmd(0xa4);   //Static  Drive OFF
   glcd_cmd(0xa9);   //Select Duty = 1 /32
   glcd_cmd(0xc0);   //Set Start Line 0(C0H)~31(DFH)
   glcd_cmd(0xb8);   //Set Page Address 0(B8H)~3(BBH)
   glcd_cmd(0x00);   //Set segment Address 0(00H)~(4FH)
   glcd_cmd(0xaf);   //Set Display ON

   while(1)
   {   
      output_high(CS1);
      output_high(CS2);

      glcd_cmd(0xC0);   // display start line
      glcd_cmd(0xB8);
                     
      for (i = 0; i < 8; i++)
      {
         glcd_data(data[i]);
      }
   }
}

void glcd_cmd(unsigned char c)
{
   output_low(A0);
   output_a(c);
   output_low(CS1);
   output_low(CS2);
   delay_ms(50);

   output_high(CS1);
   output_high(CS2);
}

void glcd_data(unsigned char z)
{
   output_high(A0);
   output_a(z);
   output_low(CS1);
   output_low(CS2);
   delay_ms(50);

   output_high(CS1);
   output_high(CS2);   
}



hemnath



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

PostPosted: Thu Oct 10, 2013 5:32 am     Reply with quote

by which command, the chip gets activated?

output_high(CS1);
(or)
output_low(CS1);

??
oxo



Joined: 13 Nov 2012
Posts: 219
Location: France

View user's profile Send private message

PostPosted: Thu Oct 10, 2013 5:53 am     Reply with quote

Read the display data sheet and understand it. If you can't do that, then embedded programming is not for you.
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