LCD 16X2 HELP PLEASE

sorry for my english. I'm an Newbie in arduino, but i want to connect one LCD 16x2 display to it. I'm having a big trouble with it. Its model is MGD1602n-FL-YBS (http://www.eletrodex.com.br/Eshop.Admin/Imagens/eletrodex/MGD1602N-FL.pdf). I'm trying for over a week , the hello word example and did nothing, i've broused arround the forum with no success..... it uses a S6A0069 (http://www.datasheetcatalog.org/datasheet/SamsungElectronic/mXruzuq.pdf) chip from Samsung witch (so it seems to me) slightly different from the HD 47780 (hitachi).i even tried to write the initialization process byte to byte and nothing. As soon as i can i'll send some pictures. Thanks everyone..... P.S. never used this forum so my Hyperliks maybe incorrect, sorry.

This is what I use to test my LCD configuration.

// The LCD is usually interfaced via 16 pins which are labelled as shown below:
                         //Connections to Arduino
                         //  LCD                                                 Connection
                         //  1. GND - Ground                                     GND
                         //  2. VDD - 3 - 5V                                     5V
                         //  3. VO  - Contrast                                   (Tap off a 5K - 10K pot across VCC and Ground)
#define LCD_RS       12  //  4. RS  - Register Select - 0=Command / 1=Character  Arduino Pin as defined
                         //  5. RW  - Read/Write - 0=Write or 1=Read             GND
#define LCD_ENABLE   11  //  6. E   - Enable - Enable data transmit              Arduino Pin as defined
                         //  7. DB0 - Data Bit 0                                 N/A
                         //  8. DB1 - Data Bit 1                                 N/A
                         //  9. DB2 - Data Bit 2                                 N/A
                         // 10. DB3 - Data Bit 3                                 N/A
#define LCD_DB4       4  // 11. DB4 - Data Bit 4 - used in 4 bit operation       Arduino Pin as defined
#define LCD_DB5       6  // 12. DB5 - Data Bit 5 - used in 4 bit operation       Arduino Pin as defined
#define LCD_DB6       7  // 13. DB6 - Data Bit 6 - used in 4 bit operation       Arduino Pin as defined
#define LCD_DB7       8  // 14. DB7 - Data Bit 7 - used in 4 bit operation       Arduino Pin as defined
#define LCD_Backlight 9  // 15. BL1 - Backlight +                                Emitter of 2N3904, Collector to VCC, Base to D9 via 10K resistor
                         // 16. BL2 - Backlight -                                GND

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
// LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(LCD_RS, LCD_ENABLE, LCD_DB4, LCD_DB5, LCD_DB6, LCD_DB7);


void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2); lcd.clear();
  pinMode(LCD_Backlight, OUTPUT); analogWrite(LCD_Backlight, 128); // Set the brightness of the backlight
}

void loop() {
  DisplayBackLightTest();
  analogWrite(LCD_Backlight, 128);
  Test16X2();
}

void Test16X2(void)
{
  lcd.clear();
//           123456789+123456789+123456789+123456789+
  lcd.print("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,./=");
  // Set cursor to Col and Row
  lcd.setCursor(0, 1);
//           123456789+123456789+123456789+123456789+
  lcd.print("abcdefghijklmnopqrstuvwxyz!@#$%^&*()<>?+");
  delay(3000);

  // Set cursor to Col and Row
  lcd.setCursor(0, 1);

  for (uint8_t i=0; i<40; i++) {
    lcd.scrollDisplayLeft();
    delay(250);
  }

  delay(2000);

  for (uint8_t i=0; i<40; i++) {
    lcd.scrollDisplayRight();
    delay(250);
  }

  delay(2000);
}

void DisplayBackLightTest(void)
{
  lcd.clear();

  for(uint8_t fadeValue=0;   fadeValue < 255; fadeValue +=1) {
    lcd.home();
    lcd.print(fadeValue); lcd.print(" ");
    analogWrite(LCD_Backlight, fadeValue);
    delay(200);
  }

  for(uint8_t fadeValue=255; fadeValue > 0;   fadeValue -=1) {
    lcd.home();
    lcd.print(fadeValue); lcd.print(" ");
    analogWrite(LCD_Backlight, fadeValue);
    delay(200);
  }
  analogWrite(LCD_Backlight, 128);
}

@miudo01: Try this tutorial: http://www.ladyada.net/learn/lcd/charlcd.html

Don

@ RandallR:

I wouldn't rely solely on PWM to limit the backlight current.

Why are you repeatedly sending the same unchanging information to the LCD?

Don

floresta: I wouldn't rely solely on PWM to limit the backlight current.

You are probably correct. I have not had any problems yet but I might add a small resistor to the +5 at some point.

floresta: Why are you repeatedly sending the same unchanging information to the LCD?

I don't understand the question. Without knowing for sure what you are talking about I might ask, "why not", what is this test program doing that is so important that it can't resend a little data?

Thaks RandallR , but this havent worked for me, as you can see in the s6a0069 datasheet, the 4-bit initialization process is quite different..... what im trying to do now is to modify the LiquidCristal.cpp and LiquidCristal.h to match the requirements for the controller. Its quite difficult to me since im a zero in c programming, but i have de impression it will pop out somehow...... if somebody could help id really apreciate it....... thanks everybody.... ill post my progress.... (i hope it will come soon )............... again thanks everybody....

I don't understand the question.

The LCD display memory does not have to be refreshed. Once you send it the information corresponding to your message that message will be displayed until overwritten.

Without knowing for sure what you are talking about I might ask, "why not",

The manner in which you presented your code appears to be that of an experienced LCD user trying to help out an inexperienced one. With that in mind it is not a good idea to imply to the unknowing that you have to resend the information when in fact you don't.

The practice of including an 'lcd.clear()' instruction within loop() has proven to be a problem in the past. It has been reported that this seems to cause flickering in the display. This instruction takes a lot more time to execute than almost all of the other LCD instructions which is probably the cause. By not repeatedly resending your message you avoid the need to repeatedly clear the screen.

what is this test program doing that is so important that it can't resend a little data?

In my opinion if the purpose of the program is to 'test' to see if the LCD is connected properly and functioning properly then this program is overkill. It would more properly be described as a program that demonstrates some of the shifting (the proper term for 'scrolling') functions of the LCD controller.

Don

as you can see in the s6a0069 datasheet, the 4-bit initialization process is quite different.....

As far as I know the Samsung S6A0069 controller is completely compatible with the Hitachi HD44780 and your display should work with an unmodified LiquidCrystal library.

You really shouldn't attempt a 4-bit initialization routine as your first attempt at LCD controller programming but if you really want to try then check out the [u]LCD initialization[/u] link at http://web.alfredstate.edu/weimandn.

It would be easier to help you if you posted your code and a photo of your setup.

Don

Finaly ive got some pictures, its not so organized but its the best i can do right now, sorry. The pins where inverted during the soldering proccess so de 1st pin is the 2nd, the sequence is (2,1,4,3,6,5,8,7,10,9,12,11,14,13,BK+,BK-). So i have:

LCD function Arduino
1 VDD +5
2 GROUND GND
3 Vo Potentiometer
4 RS D12
5 RW GND
6 E D11
7 DB0 NC
8 DB1 NC
9 DB2 NC
10 DB3 NC
11 DB4 D4
12 DB5 D5
13 DB6 D6
14 DB7 D7
15 BK+ NC
16 BK- NC

solder:

breadboard

arduino connections

thanks for the help…

Finaly ive got some pictures, its not so organized but its the best i can do right now, sorry.

Where are the pictures?

You should be able to post them by using the 'Additional Options' (at the bottom left of your 'Reply' window) and then the 'Attach' box that appears at the bottom.

Don

floresta:
The LCD display memory does not have to be refreshed. Once you send it the information corresponding to your message that message will be displayed until overwritten.

Since I only write the data once for each call to Test16X2(), I do not view this as “refreshing” the data. The function starts assuming nothing about the current state of the display. I may or may not choose to add other “tests” which may alter the state of the display but I do not believe my actions are unreasonable. However, you are free to disagree with my choices and make different choices yourself.

The manner in which you presented your code appears to be that of an experienced LCD user trying to help out an inexperienced one.

If you want to assume that since I have successfully used an LCD display and the writer has not makes me experience and the writer inexperienced then in that small area I might agree with you. All I said is “This is what I use …”. I did not present my self in any “manner”. As stated, this is code I use. I frequently use this sketch after I wire up an LCD display. I have another similar sketch for a 20x4 display. It also demonstrates the wrapping of the text. I display the entire display ram space. I find it useful. You might not, you are not required to use it.

With that in mind it is not a good idea to imply to the unknowing that you have to resend the information when in fact you don’t.

If the worst think that could come from the snippet of code is someone writes unnecessary data to the display, I can live with that.

The practice of including an ‘lcd.clear()’ instruction within loop() has proven to be a problem in the past. It has been reported that this seems to cause flickering in the display. This instruction takes a lot more time to execute than almost all of the other LCD instructions which is probably the cause. By not repeatedly resending your message you avoid the need to repeatedly clear the screen.

I have not experienced that problem, however, I don’t see where this help miudo01 get the display functioning. If you would like to discuss the pros and cons of various methods, perhaps you would like to wait until after the display is functioning.

In my opinion if the purpose of the program is to ‘test’ to see if the LCD is connected properly and functioning properly then this program is overkill. It would more properly be described as a program that demonstrates some of the shifting (the proper term for ‘scrolling’) functions of the LCD controller.

OK you caught me. I was exercising some of the functions of the LCD not absolutely necessary to verify that the display is correctly connected.

Since I only write the data once for each call to Test16X2(), I do not view this as "refreshing" the data.

Your function is called in a loop therefore you are writing data once for each time around the loop. That is known as refreshing the data.

The function starts assuming nothing about the current state of the display.

In that case it is the job of the calling program to decide whether or not to call the function. You could make such a decision by using a flag.

If the worst think that could come from the snippet of code is someone writes unnecessary data to the display,

The problem is not caused by the writing of unnecessary data, the problem is caused by the lcd.clear() instruction which, by the way, is not necessary in your case since you are going to overwrite all 80 memory locations anyway.

I have not experienced that problem...

But several others have - so keep it in mind.

Don