I am trying to use the newhaven NHD-C0220AZ-FSW-FTW LCD display with an Arduiino Pro-Mini. Does anyone have any idea why this display just won't work? I cannot get a thing out of it; not even an indication that it sees power even though there is 3.3V to it.
I am using the pro Mini 3.3, ATmega328 and am only trying to initialize it. I am not a programmer by any means so please if you see something wrong, please respond. Also, this is just the preliminary stage. I have to get something out of it before I can continue. I am using port registers for my data lines. (PORTB) I do have all the correct responses on my logic analyzer, just cannot get anything out of this LCD dsplay. I don't even know if I can use an Arduino with it.
I followed the timing diagram in the Newhaven data sheet to set enable, RW, and RS on and off and to collect data, then followed the 4-bit interface sequence in the NT7605 datasheet to initialize. In the end after each line I should have initialized and then wrote an N.
Here is my code:
//Enable
//R/W
//R/S
//D7
//D6
//D5
//D4
//PORTB =
//Global Variables
int E = 7; // Enable pin on LCD set to digital pin 7 on Arduino
int RW = 6; // R/W pin on LCD set to digital pin 6 on Arduino
int RS = 5; // R/S pin on LCD set to digital pin 5 on Arduino
void setdata(int data, int mode) // Bus Write Operation Sequance Function
{
pinMode(E, OUTPUT);
pinMode(RW, OUTPUT);
pinMode(RS, OUTPUT);
digitalWrite(RW, LOW);
delay(10);
digitalWrite(E, HIGH);
delay(10);
if(mode) //mode set to zero to write commands
digitalWrite(RS, LOW);
else
digitalWrite(RS, HIGH);
delay(10);
PORTB = data;
delay(10);
digitalWrite(E, LOW);
delay(10);
digitalWrite(RW, LOW);
delay(10);
digitalWrite(E, HIGH);
delay(10);
}
void setup ()
{
//Pins 13 to 8. NOTE: bits (7,6) are not usable
//DDRB = B11111111; // Sets the 13-8 pins as outputs
DDRB = DDRB | B11111111; // NOTE - the bitmask '| B11111100'
// sets the 13-8 pins as outputs
PORTB = B00000000; // NOTE - this sets everything to '0'
pinMode(RS, OUTPUT);
digitalWrite(E, LOW); //Start up
digitalWrite(RW, LOW);
digitalWrite(RS, LOW);
delay(10);
setdata(0x02, 1); //Start Function set
//delay(10);
setdata(0x02, 1);
//delay(10);
setdata(0x08, 1);
delay(10); //wait more than 40us
setdata(0x00, 1); // Start Display ON/OFF controls
//delay(10);
setdata(0x07, 1);
delay(10); //wait more than 40us
setdata(0x00, 1); //Start Clear Display
//delay(10);
setdata(0x01, 1);
delay(10); //wait more than 1.64ms
setdata(0x00, 1); //Start Entry Mode Set
//delay(10);
setdata(0x02, 1); //Initialization End
//delay(10);
setdata(0x04, 0); // Start Write to DDRAM
//delay(10);
setdata(0x0E, 0); //Write 'N'
//delay(10);
digitalWrite(E, LOW);
delay(10);
}
void loop ()
{
}
MANY THANKS IN ADVANCE TO ANYONE THAT HAS ANY COMMENTS!!!!