Strange. I don't know what the problem would be unless something's broken. But if you are occasionally seeing something on the not working side it's even stranger. Maybe there's some contact problem somewhere ?
Quote:
Another question, do either the E or D/I pins need to be changed when switching between CS1/2?
You mean when physically switching the wires or switching in code ? I don't see any reason why they should be changed when physically switching CS pins.
Some code I've been using:
Code:
void cKS0108::WriteCommand(unsigned char Command, unsigned char CS)
{
Delay(delay);
SetPortVal(CONTROL, ENABLE_LO | CS | RS_LO, 1);
SetPortVal(DATA, Command, 1);
SetPortVal(CONTROL, ENABLE_HI | CS | RS_LO, 1);
Delay(delay);
SetPortVal(CONTROL, ENABLE_LO | CS | RS_LO, 1);
//SetPortVal(DATA, 0, 1);
}
void cKS0108::WriteData(const unsigned char Data[], unsigned int amount)
{
unsigned char cs;
unsigned int counter;
for (counter=0; counter < amount;counter++)
{
cs = CurrentColumn>63?CS2:CS1;
Delay(delay);
SetPortVal(CONTROL, ENABLE_LO | cs | RS_HI, 1);
SetPortVal(DATA, Data[counter], 1);
SetPortVal(CONTROL, ENABLE_HI | cs | RS_HI, 1);
Delay(delay);
SetPortVal(CONTROL, ENABLE_LO | cs | RS_HI, 1);
CurrentColumn++;
if (CurrentColumn > 127)
return;
}
}