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 CCS Technical Support

RA8835 driver
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

RA8835 driver
PostPosted: Sat May 31, 2008 2:32 pm     Reply with quote

Hi,

I have a graphic LCD built-in controller RA8835. But i did not driving the LCD. someone have a opinion_? or Someone have a driver_? How i can drive the LCD_?
_________________
MurtiS
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

Hi again,
PostPosted: Sun Jun 01, 2008 7:37 am     Reply with quote

Nobody send an answer. So, how can i change the driver sed1335 for driver RA8835_? i did not understand 8080 mode or 6800 mode in pin diagram. Anyone can help me about this situation_?
_________________
MurtiS
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jun 01, 2008 1:31 pm     Reply with quote

Searching with Google for a few seconds, shows that the RA8835 is
software compatible with the SED1335/S1D13305:
http://www.mitsutech.com/new_product.html

Then, go to the Drivers directory for the CCS compiler and find this:
Quote:
c:\Program Files\picc\Drivers\sed1335.c


To confirm that SED1335 = S1D13305, a little more searching
gives this data sheet. On page 3, it says that S1D13305 is a new
part number for the SED1335 chip.
http://www.topwaydisplay.com/Pub/IC_DataSheet/S1D13305-e.pdf


In the SED1335.c driver, the main control signals are listed near the
top of the file. These are:
Quote:

GLCD_RST
GLCD_RD
GLCD_WR
GLCD_CS
GLCD_A0


Then look at this data sheet again:
http://www.topwaydisplay.com/Pub/IC_DataSheet/S1D13305-e.pdf
It has these two sections:
Quote:
6.3.1. 8080 Family Interface Timing
6.3.2. 6800 Family Interface Timing

Go down and look at that section. On page 6 (page 12 in Acrobat reader)
it has a table. It shows the 8080 family uses A0, \RD, and \WR signals.
It shows 6800 uses A0, R/W, and E.
So clearly, the CCS driver is using the Intel 8080 signals.


The CCS sed1335.c driver has some default PIC pins assigned to the
LCD signals, as shown below. You can change these to some suitable
pins on your PIC. Make sure the pins that you select can do i/o.
Some pins on some PICs are input-only. It's also common for one
pin to be open-drain (requires an external pull-up resistor, if used as
a normal output pin). These special pins are usually on Port A.
Read the "Overview" section of the PIC data sheet to carefully check
if the i/o pins that you select are not some of these special pins.
Code:
#ifndef GLCD_RST
#define GLCD_RST           PIN_C3
#endif

#ifndef GLCD_RD
#define GLCD_RD            PIN_B5
#endif

#ifndef GLCD_WR
#define GLCD_WR            PIN_B1
#endif

#ifndef GLCD_CS
#define GLCD_CS            PIN_B2
#endif

#ifndef GLCD_A0
#define GLCD_A0            PIN_B4
#endif
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

Hi again,
PostPosted: Mon Jun 02, 2008 7:36 am     Reply with quote

Graphic LCD working but, something is wrong. I will send my driver code and main program... if you see the main program code, i must see the vertical line and horizontal line etc... But, i am seeing the line like this below:
..... .... ............ ... ..... ....... ..... ......
..
.
.
.
..
..
.
..
.
.
.
..
.
..

some pixel is not turn on or there are many pixel turned on.
How can i solve this problem_?

driver code for RA8835 is below:
Code:
#ifndef GLCD_WIDTH
#define GLCD_WIDTH         320
#endif

#ifndef GLCD_HEIGHT
#define GLCD_HEIGHT        240
#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_B3
#endif

#ifndef GLCD_RD
#define GLCD_RD            PIN_B0
#endif

#ifndef GLCD_WR
#define GLCD_WR            PIN_B1
#endif

#ifndef GLCD_CS
#define GLCD_CS            PIN_B4
#endif

#ifndef GLCD_A0
#define GLCD_A0            PIN_B2
#endif

SED1335.c driver code deleted by Forum Moderator.
Ref. Forum rule #10:
10. Don't post the CCS example code or drivers.


Also, you will see the main code is that below:

Code:
unsigned int x=0,y=0,i=0;
loop1:
glcd_fillScreen(ON);
for(i=0;i<=239;i++)
{
glcd_pixel(0,i,OFF);
delay_ms(250);
}
for(i=0;i<=239;i++)
{
glcd_pixel(i,0,OFF);
delay_ms(250);
}
for(i=0;i<=239;i++)
{
glcd_pixel(i,i,OFF);
delay_ms(250);
}

glcd_fillScreen(OFF);
for(i=0;i<=239;i++)
{
glcd_pixel(0,i,ON);
delay_ms(250);
}
for(i=0;i<=239;i++)
{
glcd_pixel(i,0,ON);
delay_ms(250);
}
for(i=0;i<=239;i++)
{
glcd_pixel(i,i,ON);
delay_ms(250);
}
goto loop1;

_________________
MurtiS
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 02, 2008 12:20 pm     Reply with quote

1. Post the manufacturer and part number of your LCD.

2. Post your compiler version.
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

Compiler version and LCD Manufacturer
PostPosted: Mon Jun 02, 2008 12:25 pm     Reply with quote

WG320240C0 Graphical LCD built-in RA8835 controller from Winstar

PCWH 4.071 compiler version
_________________
MurtiS
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 02, 2008 1:55 pm     Reply with quote

In your main() code posted above, I don't see that you have called
the init routine. Example:
Code:
glcd_init(ON);


Post a complete test program. Show the #include statement for the PIC,
and the #fuses, #use delay() and #include<sed1335.c> statements.
Post all variable declarations. Show the main(). Show the code that
you posted for main above. The program should be compilable without
errors.
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Tue Jun 03, 2008 7:00 am     Reply with quote

Hi again,

you will see the main program that is below:

Code:
#include "C:\Documents and Settings\Murti\Desktop\GLCD_WNSTR\glcd_wnstr.h"
#include<sed1335.c>
#include<graphics.c>

void basla_ayar()
{
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF|ADC_TAD_MUL_0);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   glcd_init(ON);
   delay_ms(250);
}

void main(){
unsigned int x=0,y=0,i=0;
basla_ayar();
set_tris_b(0x00);
mesela:
glcd_fillScreen(ON);
glcd_circle(160, 120, 20, YES, OFF);
for(i=0;i<=239;i++)
{
glcd_pixel(0,i,OFF);
delay_ms(250);
}
for(i=0;i<=239;i++)
{
glcd_pixel(i,0,OFF);
delay_ms(250);
}
for(i=0;i<=239;i++)
{
glcd_pixel(i,i,OFF);
delay_ms(250);
}

glcd_fillScreen(OFF);
glcd_circle(160, 120, 20, YES, ON);
for(i=0;i<=239;i++)
{
glcd_pixel(0,i,ON);
delay_ms(250);
}
for(i=0;i<=239;i++)
{
glcd_pixel(i,0,ON);
delay_ms(250);
}
for(i=0;i<=239;i++)
{
glcd_pixel(i,i,ON);
delay_ms(250);
}
goto mesela;
}


you will see the part of the driver code from CCS that is below:

Code:
#ifndef SED1335
#define SED1335

#ifndef GLCD_WIDTH
#define GLCD_WIDTH         320
#endif

#ifndef GLCD_HEIGHT
#define GLCD_HEIGHT        240
#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_B3
#endif

#ifndef GLCD_RD
#define GLCD_RD            PIN_B5
#endif

#ifndef GLCD_WR
#define GLCD_WR            PIN_B1
#endif

#ifndef GLCD_CS
#define GLCD_CS            PIN_B2
#endif

#ifndef GLCD_A0
#define GLCD_A0            PIN_B4
#endif

#ifndef ON
#define ON                 1
#endif

#ifndef OFF
#define OFF                0
#endif


screen view will be attached to here later. Sorry about this.

you will see the glcd_wnstr.h that is below:

Code:
#include <18F4620.h>
#device adc=10

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES XT                       //Crystal osc = 4mhz
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOIESO                   //Internal External Switch Over mode disabled
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                      //Low Voltage Programming on B3(PIC16) or B5(PIC18)
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOCPB                    //No Boot Block code protection
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES MCLR                     //Master Clear pin enabled

#use delay(clock=4000000)



something happened is very interesting. I could not find any error,etc.... Can you help me about this situation__?
_________________
MurtiS


Last edited by murtis on Tue Jun 03, 2008 7:09 am; edited 1 time in total
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

Screen view
PostPosted: Tue Jun 03, 2008 7:04 am     Reply with quote


_________________
MurtiS
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jun 03, 2008 12:44 pm     Reply with quote

Your image shows a problem that occurs every 8 pixels, in the X axis.
So there might be a problem with the address calculation. Then look in
the graphics.c file, because it draws the lines. What do we find ?
For lines:
Code:

#ifdef LARGE_LCD
void glcd_line(int16 x1, int16 y1, int16 x2, int16 y2, int1 color)
#else
void glcd_line(int8 x1, int8 y1, int8 x2, int8 y2, int1 color)
#endif

For circles:
Code:
#ifdef LARGE_LCD
void glcd_circle(int16 x, int16 y, int16 radius, int1 fill, int1 color)
#else
void glcd_circle(int8 x, int8 y, int8 radius, int1 fill, int1 color)
#endif

etc.

You are using a 320x240 LCD. So clearly, the x-axis requires a 16-bit
value to use the full range of 0 to 319 coordinates. Therefore the
LARGE_LCD value must be defined. Then do a quick check of the files,
and it's not defined. That's likely the problem. Fix it by adding the line
shown in bold below:
Quote:

#define LARGE_LCD 1
#include <sed1335.c>
#include<graphics.c>
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

No change
PostPosted: Wed Jun 04, 2008 4:50 am     Reply with quote

I wrote the code you send me that is below:

Code:
#define LARGE_LCD 1
#include <sed1335.c>
#include<graphics.c>


No change on the glcd screen.
_________________
MurtiS
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Jun 04, 2008 10:49 am     Reply with quote

Perhaps its a timing issue,.. Make all the delays real long as a test.
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

any error in SED1335.c
PostPosted: Thu Jun 05, 2008 12:56 am     Reply with quote

Quote:
Perhaps its a timing issue,.. Make all the delays real long as a test.

I tried this. But, there is no change... Also,i tried to drive with 8-bit and 16-bit. Also, there is no change. I assumed that there are any error in driver SED1335. can it be any error in SED1335.c_?
_________________
MurtiS
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

Perhaps, i will find an error
PostPosted: Thu Jun 05, 2008 5:30 am     Reply with quote

Hi again,

I saw that something is wrong like below:

This is from main program
Code:
glcd_line(40, 320, 200, 320, ON);


It must be form like below:
Code:
glcd_line(int16 x1, int16 y1, int16 x2, int16 y2, int1 color);


but something is happening on driver code. this form is changing like below:

Code:
glcd_line(int16 x1, int16 y1, int16 x2, int16 y2, int8 color);


May be, this is a problem.


_________________
MurtiS
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

Perhaps!
PostPosted: Thu Jun 05, 2008 8:43 am     Reply with quote

Today, i tried the glcd_pixel(int16 x,int16 y,int1 color); code. So, i saw that this appears a problem about the function bit_clear(); or bit_set();. If i try to this main code like below:

Code:
while(TRUE){
if(!input(PIN_A0))
{
x=x+1;
glcd_pixel(x,0,OFF);
delay_ms(250);
}
if(!input(PIN_A1))
{
y=y+1;
glcd_pixel(0,y,OFF);
delay_ms(250);
}


some pixel, turned off, goes turning on. So, i understood that there is a problem about function glcd_pixel. But, i could not find any error. Can you look this part of the driver SED1335_?

Code:
void glcd_pixel(long x, long y, int1 color)
{
   long  data;
   long addr;

   // Calculate the byte address containing the pixel
   addr = GLCD_GRAPHICS_ADDR + (GLCD_WIDTH/8 * y + x/8);

   // Read the byte of data at the address
   data = getData(addr);

   // Turn the pixel on or off
   if(color == ON)
      data |= (1<<(7-x%8));
   if(color == OFF)
   data &= ~(1<<(7-x%8));

   // Write the new data byte to display memory
   setData(addr, data);
}

_________________
MurtiS
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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