Greetings all,

I am attempting to connect aCFAG320240 to a Arduino Mega 2560. I have gotten the epson driver code from the "s2d13700 beta library" that is available, amongst others. What I get on the screen in horizontal white bars, that seem to refresh with the code as it loops.
Here is the init code: (the values are declared in h file, posted after.

writeCommand(S1D13700_SYSTEM_SET);
delayMicroseconds(1000);
writeData(S1D13700_SYS_P1);
delayMicroseconds(1);
writeData(S1D13700_SYS_P2);
delayMicroseconds(1);
writeData(S1D13700_FY);
delayMicroseconds(1);
writeData(S1D13700_CR);
delayMicroseconds(1);
writeData(S1D13700_TCR);
delayMicroseconds(1);
writeData(S1D13700_LF);
delayMicroseconds(1);
writeData(S1D13700_APL);
delayMicroseconds(1);
writeData(S1D13700_APH);

writeCommand(S1D13700_SCROLL);
writeData(S1D13700_SAD1L);
writeData(S1D13700_SAD1H);
writeData(S1D13700_SL1);
writeData(S1D13700_SAD2L);
writeData(S1D13700_SAD2H);
writeData(S1D13700_SL2);
writeData(S1D13700_SAD3L);
writeData(S1D13700_SAD3H);
writeData(S1D13700_SAD4L);
writeData(S1D13700_SAD4H);

writeCommand(S1D13700_CSRFORM);
writeData(S1D13700_CRX);
writeData(S1D13700_CSRF_P2);

writeCommand(S1D13700_CGRAM_ADR);
writeData(S1D13700_SAGL);
writeData(S1D13700_SAGH);

writeCommand(S1D13700_CSRDIR_R);

writeCommand(S1D13700_HDOT_SCR);
writeData(S1D13700_SCRD);

writeCommand(S1D13700_OVLAY);
writeData(S1D13700_OVLAY_P1);

writeCommand(S1D13700_DISP_ON);
writeData(S1D13700_FLASH);
}

Values from .h file:

#define READDELAY() asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop")

/*definitions for specific LCD settings as well as the
command codes for various function */

#define S1D13700_SYSTEM_SET 0x40
#define S1D13700_SLEEP_IN 0x53
#define S1D13700_DISP_OFF 0x58
#define S1D13700_DISP_ON 0x59
#define S1D13700_SCROLL 0x44
#define S1D13700_CSRFORM 0x5d
#define S1D13700_CGRAM_ADR 0x5c
#define S1D13700_CSRDIR_U 0x4e
#define S1D13700_CSRDIR_D 0x4f
#define S1D13700_CSRDIR_L 0x4d
#define S1D13700_CSRDIR_R 0x4c
#define S1D13700_HDOT_SCR 0x5a
#define S1D13700_OVLAY 0x5b
#define S1D13700_CSRW 0x46
#define S1D13700_CSRR 0x47
#define S1D13700_MWRITE 0x42
#define S1D13700_MREAD 0x43
#define S1D13700_SCR_WIDTH 319
#define S1D13700_M0 0
#define S1D13700_M1 0
#define S1D13700_M2 0
#define S1D13700_WS 0
#define S1D13700_IV 1
#define S1D13700_FX 7
#define S1D13700_FY 7
#define S1D13700_WF 1
#define S1D13700_CR 39
#define S1D13700_TCR 90
#define S1D13700_LF 239
#define S1D13700_APL 40
#define S1D13700_APH 0
#define S1D13700_LINES 30
#define S1D13700_SAD1L 0
#define S1D13700_SAD1H 0
#define S1D13700_SL1 0xEF
#define S1D13700_SAD2L 0xB0
#define S1D13700_SAD2H 0x04
#define S1D13700_SL2 0xEF
#define S1D13700_SAD3L 0
#define S1D13700_SAD3H 0
#define S1D13700_SAD4L 0
#define S1D13700_SAD4H 0
#define S1D13700_CRX 0x04
#define S1D13700_CRY 0x07
#define S1D13700_CM 0
#define S1D13700_MX0 1
#define S1D13700_MX1 0
#define S1D13700_DM1 0
#define S1D13700_DM2 0
#define S1D13700_OV 0
#define S1D13700_SAGL 0
#define S1D13700_SAGH 0x70
#define S1D13700_SCRD 0
#define S1D13700_FLASH 0x16
#define S1D13700_TEXTSIZE ((S1D13700_SAD2H << 8) + S1D13700_SAD2L)
#define S1D13700_GRAPHICSTART ((S1D13700_SAD2H << 8) + S1D13700_SAD2L)
#define S1D13700_GRAPHICSIZE ((S1D13700_SL2+1) * (S1D13700_SCR_WIDTH+1))>>3
#define S1D13700_MEM_END 10800
#define S1D13700_SYS_P1 0x10 | (S1D13700_IV << 5) | (S1D13700_WS << 3) | (S1D13700_M2 << 2) | (S1D13700_M1 << 1) | S1D13700_M0
#define S1D13700_SYS_P2 0x00 | (S1D13700_WF << 7) | S1D13700_FX
#define S1D13700_CSRF_P2 0x00 | (S1D13700_CM << 7) | S1D13700_CRY
#define S1D13700_OVLAY_P1 0x00 | (S1D13700_OV << 4) | (S1D13700_DM2 << 3) | (S1D13700_DM1 << 2) | (S1D13700_MX1 << 1) | S1D13700_MX0

and the main exe that i am testing with:

/*Blink the LED for verification that
the program is executing succesfully */
pinMode(13,OUTPUT);
while(1)
{
digitalWrite(13,1);
glcd.drawLine(150,1,150,200);
glcd.drawCircle(150,120,50);
delay(5000);
//glcd.clearText();
//glcd.clearGraphic();
digitalWrite(13,0);
glcd.drawLine(10,10,300,200);
delay(5000);
//glcd.clearText();
//glcd.clearGraphic();
digitalWrite(13,1);
delay(5000);
drawBitmapText();
digitalWrite(13,1);
delay(2500);
digitalWrite(13,0);
delay(2500);
// drawLogo();
digitalWrite(13,1);
delay(2500);
digitalWrite(13,0);
delay(2500);
digitalWrite(13,1);
delay(2500);
digitalWrite(13,0);
delay(2500);

}

Any input would be awesome. I somewhat think the issue is with timing, maybe the TCR value. But I am pretty lost. Please help!!

Thanks in advance!