suman_urfeeling
Joined: 10 Aug 2009 Posts: 1
|
help me for read data from 320x240 GLCD, platform c6713dsk |
Posted: Mon Aug 24, 2009 5:25 am |
|
|
Dear Friends
I am using 320x240 Graphical LCD display & my platform c6713 dsk kit. I have interfaced GLCD with dsk through EMIF. During establish program code, one if library function(read data function) make a big trouble.
I want to set a pixel on particular addresses. just see below as an example ..
void GLCD_SetPixel(unsigned int x,unsigned int y, int color)
{
unsigned char tmp = 0;
unsigned int address = ((0x04 << 8) + 0xB0)+(40*y)+(x/8)
///////////////////////////SED1335_GRAPHICSTART + (40 * y) + (x/8);
GLCD_SetCursorAddress(address);
glcd_cmd(0x43);
tmp =GLCD_ReadData();
if(color)
tmp |= (1 << (7 - (x % 8)));
else
tmp &= ~(1 << (7 - (x % 8)));
GLCD_SetCursorAddress(address);
glcd_cmd(0x42); //GLCD_WriteCommand(0x42);
glcd_writedata(tmp); //GLCD_WriteData(tmp);
}
For the above case, i need glcd_cmd(), glcd_writedata(), glcd_readdata() and glcd_setcursoraddress() to set pixel on x, y coordinate. I have build all of function myself except glcd_readdata() function. given below ..
void glcd_cmd(int cmd)
{
int j,i;
i= 0x001F0000; //A0 High, Reset and RD high
*output=i;
i&= 0x001F0000; //A0 High, Reset and RD high
*output=i;
cmd=cmd<<(24);
i|=cmd;
*output=i;
i&=0xFFF30000;
*output=i;
for (j=15;j>0;j--);
i|= 0x000C0000;
*output=i;
for (j=15;j>0;j--);
}
void glcd_writedata(int data)
{
int j,i;
*output = 0x000F0000; //A0 Low.... Reste and RD high
i=data;
i=i<<(24);
i|= 0x000F0000;
*output = i;
i&=0xFFF30000;
*output = i; // CS and WR enable
for (j=15;j>0;j--);
i|=0x000C0000;
*output = i; // CS and WR disnable
for (j=15;j>0;j--);
}
void GLCD_SetCursorAddress(int addrl,int addrh)
{
glcd_cmd(0x46);
glcd_dat(addrl);
glcd_dat(addrh);
}
If you have this glcd_ReadData function code to read data from my graphical LCD 320x240 (sed1335). Kindly mind it, my platform is TMS320C6713 dsk kit & using EMIF port
EMIF define address ..
#define ADDRESS 0xA0000000
#define GBLCTL 0x01800000
#define CE2 0x01800010
int *output = (int *)ADDRESS;
int *gblctl = (int *)GBLCTL;
int *ce2 = (int *)CE2;
.
.
*ce2=0x22A28A22;
.
.
I shall be highly obliged if you kindly give solution about my trouble..
i wish your kind cooperation.
Regards .
Gopal Sarkar
Kolkata, India |
|