Can't get either 20*4 LCD to initialize now.

Discussion in 'Embedded Systems and Microcontrollers' started by Simy, Apr 15, 2015.

  1. Simy

    Thread Starter New Member

    Aug 8, 2013
    Awhile back I purchased 2 "Amerlight TM LCD Module for Arduino 20 x 4, White on Blue, based on the popular HD44780 controller" from Amazon. I've used them a few times but never put a project into use. I remember last time I tried I had some difficulty, but once I found a library I was good to go. Recently I used what I found at I did have to remove the 'rom' keyword from one definition, but after changing the relevant bits for my PIC18F25k80 I was up and running -- sort of. I had off text. It was like the last two bits were stuck high. I tested the micro-controller, used a different one, same issue. While tinkering at some point it stopped getting past the initialization stage, and just shows #'s across the first and third line. I tried many more things, tried the second screen I had, no change. While trying to figure out what might be going on I ended up doing some testing and changing code, etc. I even manually went through a reset procedure, did a debug and also stepped through the code bit by bit to ensure everything was behaving as expected. On both LCD's the RS and RW pins read high. From my reading you can't judge the pins without power to E, so I tried holding E high, same issue RS and RW are high from the LCD. Are both my screens broke, or am I missing something else here? I find it odd that I've killed both screens in the same way. I've double checked all jumper wires on my breadboard.

    I'm really perplexed by this one, and I haven't even gotten into the bulk of the project yet. Any help or tips would be greatly appreciated.
  2. MrChips


    Oct 2, 2009
    This is a very common problem that has been documented many times here on AAC and elsewhere.

    Firstly, begin with the hardware.
    Post a circuit schematic and a clear well focused photographs of your setup.

    After that we'll need to see the code.
  3. Simy

    Thread Starter New Member

    Aug 8, 2013
    Ok I've made progress and I think I've got it from here. I tried yet another chip (an 18f45k80) that sorta worked. I went again and tried my first 18f25k80, worked as well, just the one didn't work. I still have the odd character issue but that looks like it is being caused by the port priority being given to the CCP module. I'm reading up how to disable that. If I cant figure it out after a day or so I'll create a new topic.

    I'm starting to think that a little dusty box in the corner is not the best place for microchips I have no current use for....

    Thanks for your quick reply though!
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    From the code posted the E, RS and RW pins should come out directly as output pins. While it is possible the LCD is shorted on these pins it is more likely they are either stuck at a high state, or they are actually inputs and the LCD's pull ups are making them read high. You can check this a number of ways, writing some test code, removing the LCD and see if the voltage goes away.

    Without the LCD you should be able to wiggle all your driving lines as you want. If not, well, read thru the port registers also assosciated with those pins in the data sheet. Oft there are other functions there. Digital functions normally default OFF, but analog functions must default to ON (because putting a digital output on an analog thing even for a moment at turn on is very bad thing).
  5. atferrari

    AAC Fanatic!

    Jan 6, 2004
    I do not know how do you initialize your micro but as far as I know, all PICs, at RESET, get their peripherals disabled. CCP included.

    Is this YOUR code or you got it from somewhere?

    Do you work in Assembler or....? Edit / I can C you are using see. Sorry. /Edit.