I recently bought a KTM-S1201 lcd module for the purpose of making myself learn how to use it with arduino. I wrote some code that I think should work for it, but I'm getting nothing on the display. I'm wondering if it's actually broken or something like that. Is there a way to test it to verify that it's working without having working code? Any help would be appreciated. Here are some links to some stuff that might be helpful.
some notes on using the ktm-s1201 module
this is the data sheet for the controller on the module ([ch956]PD7225)
http://www2.renesas.com/maps_download/pdf/S14308EJ6V1DS00.pdf
this guy made some programs to work with the ktm-s1201 that i was trying to learn some stuff from
http://www.qsl.net/ve3lny/ktms1201.html
Since I'm sure somebody will ask, here is the code and wiring diagram. If you see any problems here, let me know. I'm not even sure this code should work.
const int BUSY = 8; // variables are what the pins are called on the lcd module
const int SCK = 9; // the numbers are the arduino pins they are connected to
const int SI = 10;
const int CD = 11;
const int RESET = 12;
const int CS = 13;
const int MODE = 0x40;
const int UNSYNCHRONIZED = 0x30;
const int BLINKOFF = 0x18;
const int DISPLAYON = 0x11;
const int SEGMENTDECODERON = 0x15;
const int CLEARDATAANDPOINTER = 0x20;
const int NUM1 = 0x01;
const int NUM2 = 0x02;
const int NUM3 = 0x03;
void setup() {
pinMode(BUSY, INPUT); // BUSY is the only input. When low, lcd module is processing data
// and can't recieve. When high, lcd module is ready to accept data.
pinMode(SCK, OUTPUT); // SCK is clock pin. When it goes high, it stores the state (bit) from
// SI. It will wait for it to go high again to store the next one. After 8 pulses, the lcd module
// will lock out until CS goes high.
pinMode(SI, OUTPUT); // This is where the data bits go for serial communication
pinMode(CD, OUTPUT); // If this is high, it will register info from SI as a command. If it's low
// it will register as data.
pinMode(RESET, OUTPUT); // Resets lcd module when it goes low.
pinMode(CS, OUTPUT); // Hold this low the whole time while transferring a byte. Return it high when
// done so it stores the info.
// initial setup of lcd module
digitalWrite(RESET, LOW); // reset module
delay(1000); // wait 1000 ms to make sure it's done resetting
digitalWrite(CD, HIGH); // this will be a command to change settings
digitalWrite(CS, LOW); // this tells it we are going to send some data
while(digitalRead(BUSY) == 0){ // makes sure BUSY is high. if low, lcd module is busy, and
// it waits 1 ms before checking again
delay(1);
}
shiftOut(SI, SCK, MSBFIRST, MODE); // setting up the controller
shiftOut(SI, SCK, MSBFIRST, UNSYNCHRONIZED);
shiftOut(SI, SCK, MSBFIRST, BLINKOFF);
shiftOut(SI, SCK, MSBFIRST, DISPLAYON);
shiftOut(SI, SCK, MSBFIRST, SEGMENTDECODERON);
shiftOut(SI, SCK, MSBFIRST, CLEARDATAANDPOINTER);
digitalWrite(CS, HIGH);
digitalWrite(CD, LOW);
digitalWrite(CS, LOW);
while(digitalRead(BUSY) == 0){
delay(1);
}
shiftOut(SI, SCK, MSBFIRST, NUM3); // should hopefully make it display 123 on the screen
shiftOut(SI, SCK, MSBFIRST, NUM2);
shiftOut(SI, SCK, MSBFIRST, NUM1);
digitalWrite(CS, HIGH);
}
void loop(){
delay(1);
}
If the picture isn't showing up, find it here.
http://www.freeimagehosting.net/image.php?70a1fc8349.png
Any help is appreciated.