Shop OBEX P1 Docs P2 Docs Learn Events
Need help with 2 X 16 Parallel LCD Display — Parallax Forums

Need help with 2 X 16 Parallel LCD Display

mike_smike_s Posts: 42
edited 2005-12-25 20:33 in BASIC Stamp
I am just about at my wits end trying to reliably integrate a hitachi· type 44780 16x2 lcd to a basic stamp 2
I am running it in four bit mode but the results are really inconsistent.
If the power goes down it does not always initialise and show the message in a variable named msg.
I have also found that spaces do not work in strings. All I get is a muddled up mess.
I have started the main sub with a 150 pause and have tried various other intervals to allow the ideal power conditions for initialisation.
What could be causing the problem?
I find if I download the program again sometimes this works but that is useless once it is installed in the appliance.
I am at the point of writing obscene messages into the variable please someone put an end to my frustration.
I am running it in a loop for testing purposes but the display seems to either get stuck on the message without clearing the screen and rewriting or it has no display or just a screen full of blocks.

Post Edited By Moderator (Chris Savage (Parallax)) : 12/24/2005 1:50:24 AM GMT

Comments

  • ForrestForrest Posts: 1,341
    edited 2005-12-24 01:33
    How are you powering the LCD? LCD's with no backlight require very little current (1 mA), but a backlight can consume 75-100 mA - which can cause a brownout if you're trying to use the onboard BS2 regulator to drive the backlight.
  • mike_smike_s Posts: 42
    edited 2005-12-24 01:34
    The display has no backlight and power consumption is about 1.5mA
  • mike_smike_s Posts: 42
    edited 2005-12-24 01:46
    It definately appears an initialisation problem if I hit the reset enough times on my stamp it finally obeys my command.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-24 01:52
    You can find example code for interfacing a 2X16 LCD at the following link:

    http://www.parallax.com/detail.asp?product_id=603-00006

    P.S. - You should try to use a descriptive subject line when posting.· I added one for you this time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-24 02:21
    Give this code a try (you may need to adjust pin assignments).· I've been using this same code for years and have never had a lick of trouble.· You can find a full description of this program (as·well as additional LCD code)·in the latest version of StampWorks.

    http://www.parallax.com/detail.asp?product_id=27220

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • mike_smike_s Posts: 42
    edited 2005-12-24 02:45
    No I give up. Unless its because I have the lcd through a separate 5v reg to the stamps onboard reg I cannot see any reasonable explanation for why it is so troublesome. I think I'll give this game away. Go fishing or something instead. ANybody wanna buy a used bs2 your welcome to it.

    I heard lcds were difficult to init but this is ridiculous.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-12-24 02:52
    mike_s -

    Where did you pick up the LCD and/or what is the manufacturer and model number?

    Regards,

    Bruce Bates
  • ForrestForrest Posts: 1,341
    edited 2005-12-24 03:06
    If you're using a seperate power supply to drive the LCD, then you must tie the grounds of the stamp and the external regulator together.
  • mike_smike_s Posts: 42
    edited 2005-12-24 06:58
    thanks for the help everyone has given. The grounds between stamp and lcd are common just the positives are different. The lcd +5v comes from an lm7805 12v input and I am feeding approx 12v dc into the stamps vin pin. which regulates back to the 5 volts onboard.

    While it is not a genuine hitachi and in fact in the attached pdf for it you will notice the ground and postive supply are opposite to the arrangement on the hitachi. Could this be a printing error I dare not reverse polarity to the lcd fearing the consequences.

    Only markings on the back of the lcd are SDEC ssc2a16dry-01

    2k05-03

    Like I said if I patiently hit the reset enough times the lcd finally changes to the correct display. Hope that I have given enough information?
  • mike_smike_s Posts: 42
    edited 2005-12-25 20:31
    I gave up on 4 bit mode and added the extra connector to run in 8 bit mode. All problems gone.

    I don't know whether it's because of my inadequate programming skills or incomplete understanding of the 4 bit timing chart but I'll just have to budget enough pins to run in 8 bit mode unfortunately.
  • mike_smike_s Posts: 42
    edited 2005-12-25 20:33
    one other possibility perhaps is in 4 bit mode I might need to check the busy flag and delay the main routine till it is clear?

    How to do this programatically I don't know.
Sign In or Register to comment.