SED1335 and RA8835

General discussion on mikroC.
Author
Message
mpavlica
Posts: 161
Joined: 02 Jan 2006 19:18

SED1335 and RA8835

#1 Post by mpavlica » 20 May 2008 15:12

Image

Greetings :))[/img]
Milan Pavlica YU7XW

dronology
Posts: 106
Joined: 29 Dec 2007 23:48
Location: istanbul
Contact:

Re: SED1335 and RA8835

#2 Post by dronology » 31 Oct 2008 23:35

mpavlica wrote:Image

Greetings :))[/img]

How can we get these drivers??
R. Giskard Reventlov & R. Daneel Olivaw

http://www.circuitechs.com
http://www.dronology.com

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#3 Post by LGR » 01 Nov 2008 15:13

Seconded. This would be a very nice project, if the source is available.
If you know what you're doing, you're not learning anything.

petrd
Posts: 82
Joined: 14 Feb 2008 11:04
Location: Russia, Voronezh

#4 Post by petrd » 03 Nov 2008 12:11

Hi!
My example for SED1335:

Code: Select all

/*
  Library for work with GLCD based on controller SED1335
            Petr Dynin  - mmaana@bk.ru
 * Description:
     This code context all need function for work this SED1335 on low level.
     Code may be not optimal, but work.
 * Test configuration:
     MCU:             PIC16F877A
     Dev.Board:       EasyPIC5
     Oscillator:      HS, 08.0000 MHz
     Ext. Modules:    -
     SW:              mikroC v8.2.0.0
 * NOTES:
     1. This code tested only MCU PIC16F877A and GLCD WG320240C.
     2. WG320240C connect in CN6 EasyPIC5.
     3. Interface mode WG320240C - 6800.
     4.      pin WG320240C     CN6 EasyPIC5
             1     GND     ---     GND
             2     +5V     ---     Vсс
             3     NC
             4     /RD     ---     RB2
             5     /WR     ---     RB3
             6     A0      ---     RB4
             7     DB0     ---     RD0
             8     DB1     ---     RD1
             9     DB2     ---     RD2
             10    DB3     ---     RD3
             11    DB4     ---     RD4
             12    DB5     ---     RD5
             13    DB6     ---     RD6
             14    DB7     ---     RD7
             15    /CS     connect on GND
             16    /RES    connect via 10 kOm on Vcc(+5v)
             17    NC
             18    NC
             19    NC
             20    NC
     5. Example config in test program:
             Sed_Config(&PORTB,4,3,2,&PORTD);
             Sed_Init();
     6.  Function Sed_Init() depended at mode work GLCD.
*/

#include <built_in.h>


volatile unsigned short  TRIS, ctrl;
static unsigned short *PORTdata, *PORTctrl, TRISdata;
unsigned short ctrl_A0, ctrl_RD, ctrl_WR;

//-----------------------------------------------------------------------------
// Function set and clear bit in byte
//-----------------------------------------------------------------------------
void WriteBit(unsigned short *var, unsigned short pos, char bit)
{
 if (bit)
   switch(pos)
   {
    case 0: *var|=0x01;break;
    case 1: *var|=0x02;break;
    case 2: *var|=0x04;break;
    case 3: *var|=0x08;break;
    case 4: *var|=0x10;break;
    case 5: *var|=0x20;break;
    case 6: *var|=0x40;break;
    case 7: *var|=0x80;break;
   }
 else
  switch(pos)
   {
    case 0: *var&=(~0x01);break;
    case 1: *var&=(~0x02);break;
    case 2: *var&=(~0x04);break;
    case 3: *var&=(~0x08);break;
    case 4: *var&=(~0x10);break;
    case 5: *var&=(~0x20);break;
    case 6: *var&=(~0x40);break;
    case 7: *var&=(~0x80);break;
   }
}
//-----------------------------------------------------------------------------
// Function write command in SED1335
//-----------------------------------------------------------------------------
void Sed_Write_Cmd(unsigned short cmd)
 {
  *PORTdata=cmd;
  WriteBit(&ctrl,ctrl_WR,0);
  *PORTctrl=ctrl;
  WriteBit(&ctrl,ctrl_RD,1);
  *PORTctrl=ctrl;
  WriteBit(&ctrl,ctrl_RD,0);
  WriteBit(&ctrl,ctrl_WR,1);
  *PORTctrl=ctrl;
 }
//-----------------------------------------------------------------------------
// Function write data in SED1335
//-----------------------------------------------------------------------------
void Sed_Write_Data(unsigned char dat)
 {
  *PORTdata=dat;
  WriteBit(&ctrl,ctrl_A0,0);
  WriteBit(&ctrl,ctrl_WR,0);
  WriteBit(&ctrl,ctrl_RD,0);
  *PORTctrl=ctrl;
  WriteBit(&ctrl,ctrl_RD,1);
  *PORTctrl=ctrl;
  WriteBit(&ctrl,ctrl_A0,1);
  WriteBit(&ctrl,ctrl_WR,1);
  WriteBit(&ctrl,ctrl_RD,0);
  *PORTctrl=ctrl;
 }
//-----------------------------------------------------------------------------
// Function read data from SED1335
//-----------------------------------------------------------------------------
unsigned short Sed_Read_Data()
 {
  char data;
  sed_write_cmd(MRead);
  *(unsigned short*)TRISdata=0xff;
  WriteBit(&ctrl,ctrl_RD,1);
  *PORTctrl=ctrl;
  data = (char)*PORTdata;
  WriteBit(&ctrl,ctrl_RD,0);
  *PORTctrl=ctrl;
  *(unsigned short*)TRISdata=0;
  return data;
 }
//-----------------------------------------------------------------------------
// Function clear graphic screen in SED1335
//-----------------------------------------------------------------------------
void Screen_Clear(unsigned long addr_RAM_GLCD)
{
  unsigned int i;
   sed_write_cmd(Cs_dir_right);
   sed_write_cmd(CsRw);
   sed_write_data(Lo(addr_RAM_GLCD));
   sed_write_data(Hi(addr_RAM_GLCD));
   sed_write_cmd(MWrite);
  for(i=0;i<9600;i++) sed_write_data(0x00);
}
//-----------------------------------------------------------------------------
// Function config ports for work with SED1335
//-----------------------------------------------------------------------------
void Sed_Config(unsigned short *portctrl, unsigned short A0, unsigned short WR,
                  unsigned short RD, unsigned short *dataport)
{
  ctrl=0xff;
  PORTdata=dataport;
  PORTctrl=portctrl;
  ctrl_A0=A0;
  ctrl_RD=RD;
  ctrl_WR=WR;

 WriteBit(&ctrl,A0,0);
 WriteBit(&ctrl,RD,0);
 WriteBit(&ctrl,WR,0);

 switch ((char)PORTctrl)
 {
  case 5: {TRISA&=ctrl;} break;
  case 6: {TRISB&=ctrl;} break;
  case 7: {TRISC&=ctrl;} break;
  case 8: {TRISD&=ctrl;} break;
  case 9: {TRISE&=ctrl;} break;
 }
  WriteBit(&ctrl,A0,1);
  WriteBit(&ctrl,WR,1);
  *PORTctrl=ctrl;

  switch ((char)PORTdata)
  {
  case 5: {TRISA=0;PORTA=0;TRISdata=0x85;} break;
  case 6: {TRISB=0;PORTB=0;TRISdata=0x86;} break;
  case 7: {TRISC=0;PORTC=0;TRISdata=0x87;} break;
  case 8: {TRISD=0;PORTD=0;TRISdata=0x88;} break;
  case 9: {TRISE=0;PORTE=0;TRISdata=0x89;} break;
  }
}

dronology
Posts: 106
Joined: 29 Dec 2007 23:48
Location: istanbul
Contact:

#5 Post by dronology » 03 Nov 2008 14:24

I'm going to use ds33 and 24H series PIC for my project. And also I want to drive 240x160 or 320x240 GLCD by using these pics. Most of the GLCD's Power Supply Voltage is 5V. But input voltages min 0 - max Vdd. 24H and ds33 pics work under 3.3V.
Question: Is it possible to drive 5V power supplied GLCD by 3.3V PIC?
T6963C drivers of MikroC fail to compile for ds33PIC and PIC24H series. (the reason given from mikroE is : voltage incompatibility).
By the other words, "For low voltaged ds33pic and PIC24F or PIC24H series it is impossible to drive GLCDs by T6963C (that mikroC supports in its library)."

Other alternate is Raio 8835 or SED1335. From their documents it can be understood that they can drive till to 320x240 GLCD. Some GLCDs still work under 5V Power Supply (such as Winstar WG320240C0 RA8835), but some of them have 3.3V power supply (such as Winstar WX320240C0 RA8835).

New driver of epson S1D13700 is other way. Some of Winstar's new model GLCDs use this driver but still for 5V power supply. But Crystalfontz CFAG320240CX uses driver of epson S1D13700 and power supplied by 3.3V. But it (crystalfontx) is now widen (not easily found) as Winstar.
But the problem is "MikroC has no proper driver for these GLCDs". We need open source codes to drive these GLCDs or write our own (by several months worktime).

What do you suggest?
R. Giskard Reventlov & R. Daneel Olivaw

http://www.circuitechs.com
http://www.dronology.com

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#6 Post by LGR » 03 Nov 2008 15:21

From what I understand, the inputs to the GLCD usually will understand 3.3 logic levels, and anything coming out of the GLCD requires a voltage divider network, but the module itself will require a 5V supply. But the only way to be sure is to try is with the particular module that you intend to use.
If you know what you're doing, you're not learning anything.

dronology
Posts: 106
Joined: 29 Dec 2007 23:48
Location: istanbul
Contact:

#7 Post by dronology » 03 Nov 2008 15:50

from the microchip datasheet of PIC24H series PIC24HJ256GP610, it is written that:

Output pins can drive from 3.0V to 3.6V
All digital input pins are 5V tolerant
4 mA sink on all I/O pins

According to LGR's info
"the inputs to the GLCD usually will understand 3.3 logic levels"
it seems that 5V input tolerated MCUs could be directly connected to 5V GLCDs.
R. Giskard Reventlov & R. Daneel Olivaw

http://www.circuitechs.com
http://www.dronology.com

picdog
Posts: 390
Joined: 28 Feb 2006 09:32

#8 Post by picdog » 03 Nov 2008 20:11

Hello,
my 2 cents to the topic. I use since long time T6963c with dsPIC. There is no problem with mikroe lib. Just they stated to be careful because of the different voltage. On my board I have a first regulator for 5.0 volt for the LCD and then another regulator for 3.6 volt for the other components (included the mcu). I use displays from Winstar. The pinout is not identical to those from mikroe but just swap some pins. It works without problems. I use 240x128 models. Afaik dsPIC33/Pic24 are able to withstand with 5 volt on digital input. I suffered no problem, and the display see my 3.6 volt signal correctly as "1" so I don't use any voltage translator.
I also use a ribbon cable that is 20 cm long between the cpu board and the display. Here I had no problem regarding speed.
(I used dsPIC33FJ256GP710, but in the next project I will use the 510 model).
Hope this might help you,
picdog
... a proud user of MikroElektronica EasyPic3, EasyPic4, BigPic4, MikroC for PIC, EasydsPIC2, dsPIC-Pro2, LV24-33 and MikroC for dsPIC :)

dronology
Posts: 106
Joined: 29 Dec 2007 23:48
Location: istanbul
Contact:

#9 Post by dronology » 04 Nov 2008 09:26

MikroC's T6963C Graphic LCD Library says that:
This library supports the dsPIC30 only due to the dsPIC33 and PIC24 voltage incompatibility with a certain T6963C based GLCD modules.

But according to picdog's and LGR's messages, I'll try T6963C with 3.3V dsPIC. Both If I succeed or not, I'll inform all.
R. Giskard Reventlov & R. Daneel Olivaw

http://www.circuitechs.com
http://www.dronology.com

picdog
Posts: 390
Joined: 28 Feb 2006 09:32

#10 Post by picdog » 04 Nov 2008 10:29

The success of direct connection depends primarily on the module itself: some of them have schm.triggers with 0.8V logic "1", so a 3.3 volt might be not enough. I had no problem with my module, also I used PIC32 to drive T6963c.
picdog
... a proud user of MikroElektronica EasyPic3, EasyPic4, BigPic4, MikroC for PIC, EasydsPIC2, dsPIC-Pro2, LV24-33 and MikroC for dsPIC :)

dronology
Posts: 106
Joined: 29 Dec 2007 23:48
Location: istanbul
Contact:

#11 Post by dronology » 04 Nov 2008 11:08

Dear picdog,
My GLCDs are Winstar WG160128C and WG240128B, what is yours?
R. Giskard Reventlov & R. Daneel Olivaw

http://www.circuitechs.com
http://www.dronology.com

picdog
Posts: 390
Joined: 28 Feb 2006 09:32

#12 Post by picdog » 04 Nov 2008 11:16

I am not at my lab at the moment, but I guess they are the second one you mentioned ("B" model, 240x128). I use two different models, one is for internals (like a car, or home) that is blue and white (but is not suitable outside), the other is black on a light green background, that is perfect for outside use because more sunlight you get, more contrast you see. (This is also a temperature compensated model).
I use it @ 10 MHz. I didn't remember if the libs are ok also with PLL enabled. Some users experiences some problems with the other controller (128x64, that is KS0108 not T6963c). But I have to try in the next few days @ 80 MHz - 40 mips. If the delays are correctly computed, it shouldn't be any problems.
picdog
... a proud user of MikroElektronica EasyPic3, EasyPic4, BigPic4, MikroC for PIC, EasydsPIC2, dsPIC-Pro2, LV24-33 and MikroC for dsPIC :)

dronology
Posts: 106
Joined: 29 Dec 2007 23:48
Location: istanbul
Contact:

#13 Post by dronology » 04 Nov 2008 13:16

My GLCDs are blue-white. They also have led backbround for brighness. For outdoor purposes these led brightness models can be used. But as soon as possible I'll try your adviced model green backgrounded one.
I drive these T6963C's with 18F8722 at 20Mhz. T6963C lib of MikroC already contains delay codes. I use these delay codes only at the configuration stage of GLCD. Not using these delay (wait) codes never made any trouble till now at 20Mhz.
R. Giskard Reventlov & R. Daneel Olivaw

http://www.circuitechs.com
http://www.dronology.com

dronology
Posts: 106
Joined: 29 Dec 2007 23:48
Location: istanbul
Contact:

#14 Post by dronology » 04 Nov 2008 14:52

As I see that high knowledged people responded this topic, I will ask another question (cause I found you here and this topic is hot at the moment). I saw your messages in 16bit MCU side of this forum. I wrote this message to 16bit section too.

Here is my question:

I compiled this simple program by "mikroC for dsPIC 30/33 and PIC24 ver 4.0.0.0.".
Device is: 24HJ256GP206
Clock is: 20Mhz

Code: Select all

#include "T6963C.h"

/*
 * bitmap pictures stored in ROM
 */

void main(void)
        {

        TRISD = 0xFFFF;
        TRISF = 0 ;                     // portF is output only
        PORTF = 0b00000000 ;            // chip enable, reverse on, 8x8 font


        T6963C_Init_240x128();
        
        T6963C_graphics(1) ;
        T6963C_text(1) ;

        /*
         * text messages
         */
        T6963C_write_text(" GLCD LIBRARY DEMO, WELCOME !", 0, 0, T6963C_ROM_MODE_XOR) ;
        T6963C_write_text(" EINSTEIN WOULD HAVE LIKED mC", 0, 15, T6963C_ROM_MODE_XOR) ;


        }
Compile message is:
Used ROM: 1458 (2%)
Free ROM: 64077 (98%)
Totally: 65535

But as we know that 24HJ256GP206 has 256Kbyte ROM and total ROM size should be 262143.
I tried this simple program for other 256Kbyte ROM based PIC devices. Same result again. Is there any bug that I haven't came across yet or max capacity of MikroC for 16bit MCU's are limited with 64K?

And also I red some messages about this problem. They say that ds30/33 and PIC24 series use 24-bit instruction and ROM percentages are correct.

But:

When I'm compiling program for P33FJ128GP206 - that has 128Kbyte ROM result message is :
Used ROM: 1458 (2%)
Free ROM: 64077 (98%)
Totally: 65535



and when I'm compiling program for P33FJ256GP506 - that has 256Kbyte ROM result message is same:
Used ROM: 1458 (2%)
Free ROM: 64077 (98%)
Totally: 65535


ROM size is doubled but result message is same? How?
R. Giskard Reventlov & R. Daneel Olivaw

http://www.circuitechs.com
http://www.dronology.com

idakota
Posts: 334
Joined: 27 Sep 2006 08:07
Location: Pretoria/South Africa
Contact:

#15 Post by idakota » 04 Nov 2008 16:24

The 24HJ256GP206 reports 98,303 for me...

The value that mikroC reports is not the free rom in byte, but the free rom in instruction word size (24bit for the PIC24HJ)

Post Reply

Return to “mikroC General”