If it weighed more and wasn't wired to my computer I would have thrown it across the room.
Loaded up cougar's mandelbrott demo and got the blue screen of nothingness.
Loaded up the gravitech code with phokur's changes and got a sorta kinda good result. There seem to be bleeding pixels in the middle of the blocks.
with the code below, trying to us the 16bit color interface, I get something more than nothing, but less useful. With a line in the middle that I don't understand at all.
/* Nokia 6100 LCD interface
rev - = basically copy of Gravitech LCD6610 (epson) program
*/
const byte DISON = 0xaf; //Display On, 0 byte
const byte DISOFF = 0xae; //Display Off, 0 byte
const byte DISNOR = 0xa6; //Normal Display, 0 byte
const byte DISINV = 0xa7; //Inverse Display, 0 byte
const byte COMSCN = 0xbb; //Common Scan Direction, 1 byte
const byte DISCTL = 0xca; //Display control, 3 bytes
const byte SLPIN = 0x95; //Sleep in, 0 bytes
const byte SLPOUT = 0x94; //Sleep Out, 0 bytes
const byte PASET = 0x75; //Page Address Set, 2 bytes
const byte CASET = 0x15; //Column Address Set, 2 bytes
const byte DATCTL = 0xbc; //Data Scan Direction, 3 bytes
const byte RGBSET8 = 0xce; // 256 color position set, 20 bytes
const byte RAMWR = 0x5c; //Writing to memory, Data
const byte RAMRD = 0x5d; //Reading from memory, Data
const byte PTLIN = 0xa8; //Partial Display in, 2 Bytes
const byte PTLOUT = 0xa9; //Paritial Display out, 0 byte
const byte RMWIN = 0xe0; //Read and modify Write, 0 bytes
const byte RMWOUT = 0xee; //End (?), 0 bytes
const byte ASCSET = 0xaa; //Area scroll set, 4 bytes
const byte SCSTART = 0xab; //Scroll start set, 1 byte
const byte OSCON = 0xd1; //Interfnal Osciallation On. 0 byte
const byte OSCOFF = 0xd2; //Internal Osciallation Off, 0 byte
const byte PWRCTR = 0x20; //Power Control, 1 byte
const byte VOLCTR = 0x81; //Electronic volume control, 2 bytes
const byte VOLUP = 0xd6; //Inscrement electronic volume control by 1, 0 byte
const byte VOLDOWN = 0xd7; //Decrement electronic volume control by 1, 0 byte
const byte TMPGRD = 0x82; //Temperature gradient set, 14 bytes
const byte EPCTIN = 0xcd; //Control EEPROM, 1 byte
const byte EPCOUT = 0xcc; //Cancel EEPROM Control, 0 byte
const byte EPMWR = 0xfc; //Write into EEPROM, 0 byte
const byte EPMRD = 0xfd; //Read from EEPROM, 0 byte
const byte EPSRRD1 = 0x7c; //Read Register 1, 0 byte
const byte EPSRRD2 = 0x7d; //REad Register 2, 0 byte
const byte NOP = 0x25; //No Operation
//Arduino pins for control of LCD, using all PORTD pins for now
int LCDCS = 3;
int LCDSCK = 4;
int LCDDIO = 5;
int LCDRST = 6;
const byte pmin = 2;
const byte pmax = 131;
const byte cmin = 0;
const byte cmax = 129;
boolean d = true;
int j=1;
#define cbi(reg, bit) (reg&=~(1<<bit))
#define sbi(reg, bit) (reg|= (1<<bit))
#define setCS cbi(PORTD,LCDCS); //Chip select on
#define clearCS sbi(PORTD,LCDCS); //Chip select off
#define clearSCK cbi(PORTD,LCDSCK); //Clock low
#define setSCK sbi(PORTD,LCDSCK); //clock high
#define clearDIO cbi(PORTD,LCDDIO); //data low
#define setDIO sbi(PORTD,LCDDIO); //data high
#define setReset cbi(PORTD,LCDRST); //enable reset
#define clearReset sbi(PORTD,LCDRST); //disable reset
//#define BL0 cbi(PORTD,BL);
//#define BL1 sbi(PORTD,BL);
void lcdData(byte _b){
setSCK
clearCS
setCS
clearSCK
setDIO
setSCK
writeToLCD(_b);
}
void lcdCmd(byte _b){
setSCK
clearCS
setCS
clearSCK
clearDIO
setSCK
writeToLCD(_b);
}
void writeToLCD(byte _b){
clearSCK
if((_b&B10000000)!=0){setDIO} else {clearDIO}
setSCK
clearSCK
if((_b&B01000000)!=0){setDIO} else {clearDIO}
setSCK
clearSCK
if((_b&B00100000)!=0){setDIO} else {clearDIO}
setSCK
clearSCK
if((_b&B00010000)!=0){setDIO} else {clearDIO}
setSCK
clearSCK
if((_b&B00001000)!=0){setDIO} else {clearDIO}
setSCK
clearSCK
if((_b&B00000100)!=0){setDIO} else {clearDIO}
setSCK
clearSCK
if((_b&B00000010)!=0){setDIO} else {clearDIO}
setSCK
clearSCK
if((_b&B00000001)!=0){setDIO} else {clearDIO}
setSCK
clearCS
}
void setBox(byte c1,byte c2,byte p1,byte p2){
lcdCmd(CASET);
lcdData(c1);
lcdData(c2);
lcdCmd(PASET);
lcdData(p1);
lcdData(p2);
}
void fillBox(byte color, byte c1, byte c2, byte p1, byte p2)
{
uint16_t total_bytes1;
uint16_t total_bytes2;
uint16_t total_bytes;
setBox(c1, c2, p1, p2);
lcdCmd(RAMWR);
total_bytes1 = (c2 - c1 + 1);
total_bytes2 = (p2 - p1 + 1);
total_bytes = total_bytes1 * total_bytes2;
for (unsigned int i = 0; i < total_bytes; i++){
lcdData(color);
lcdData(color);
}
}
void fillScreen(byte color){
fillBox(color,cmin, cmax,pmin,pmax);
}
//LCD Initialize------------------------------------
void lcdInit(){
setReset
delay(10);
clearReset
clearCS
setDIO
setSCK
lcdCmd(DISCTL); //Display Control ---------------------------------
lcdData(0x0A); //CL dividing ratio
lcdData(0x20); //130 line display
lcdData(0x11); //no inversely highlighted lines
lcdData(0x01); //dispersion
lcdCmd(COMSCN); //Com Scan ----------------------------------------
lcdData(0x01);
lcdCmd(OSCON); //Oscillator On -----------------------------------
lcdCmd(SLPOUT); //Sleep Out ---------------------------------------
lcdCmd(VOLCTR); //Voltage Control----------------------------------
lcdData(0x20);
lcdData(3);
//Temperature Gradient
// lcdCmd(TMPGRD);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
// lcdData(0);
//Power Control -----------------------------------
lcdCmd(PWRCTR);
lcdData(0x0f);
delay(100);
//Invert Display-----------------------------------
lcdCmd(DISINV);
//Clear Partial disply data------------------------
lcdCmd(PTLOUT);
//Autoscroll clearing (I hope)
lcdCmd(ASCSET);
lcdData(00);
lcdData(32);
lcdData(32);
lcdData(3);
//Data Scan Direction------------------------------
lcdCmd(DATCTL);
lcdData(0x00);
lcdData(0x00);
lcdData(0x04); //1 = 8 bit, 2 = 12 bit, 3=12 of 16 bit
lcdData(0);
//RGB Mapping--------------------------------------
// lcdCmd(RGBSET8);
// lcdData(0x00);
// lcdData(0x02);
// lcdData(0x04);
// lcdData(0x06);
// lcdData(0x08);
// lcdData(0x0A);
// lcdData(0x0C);
// lcdData(0x0F);
// lcdData(0x00); // 000 GREEN
// lcdData(0x02); // 001
// lcdData(0x04); // 010
// lcdData(0x06); // 011
// lcdData(0x08); // 100
// lcdData(0x0a); // 101
// lcdData(0x0c); // 110
// lcdData(0x0f); // 111
// lcdData(0x00); // 00 BLUE
// lcdData(0x06); // 01
// lcdData(0x09); // 10
// lcdData(0x0f); // 11
lcdCmd(NOP);
delay(100);
lcdCmd(NOP);
fillScreen(0x0F);
lcdCmd(DISON);
}
void setup(){
DDRD |= B01111100; // Set SPI pins as output
PORTD |= B01111100; // Set SPI pins HIGH
delay(500);
pinMode(8,INPUT);
pinMode(9,INPUT);
lcdInit();
//Make some shit happen
lcdCmd(RAMWR);
d = false;
}
void loop(){
d = false;
byte C = 0xFF;
int dC=30;
digitalWrite(11,LOW);
delay(250);
fillScreen(C);
if(C > dC){
C-=dC;
}else{
C=0;
}
}