PIC16f916, LCD Black Boxes problem

Discussion in 'Embedded Systems and Microcontrollers' started by RobP, May 1, 2014.

  1. RobP

    Thread Starter New Member

    May 1, 2014
    3
    1
    Ive looked at a lot of threads about Black boxes on the top line of a 16x2 LCD display however I could not find any where the system had been previously working.

    I have a PIC16F916 hooked up to a DISPLAYTECH162F 16x2 LCD display using 4-bit mode. Im using a PICKIT2 to program the chip. I have had the system running and displaying perfectly for the past week however I was checking my PCB's connections with the power on and the top line of the LCD just turned to black boxes. I have another board which i know also works correctly so i swapped the PIC and LCD over to the Board and i got the same problem. I then went on to try a new PIC with no success and a new LCD screen with no success. I tried swapping out the 3.2768MHz crystal oscillator for a new one and im still getting black boxes. Its almost as if the LCD wont initialise Ive tested the pins on the PIC and its still performing all tasks including sending information to the display.

    Also ive tried just running some basic code to initialise the LCD and display a few characters which did not work either.

    Typically i have my final hand in on tuesday as its for my final year project, any help in diagnosing this problem would be awesome.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,447
    3,362
    This is very common problem that can be a result of too many possible things.

    I can only offer the following suggestions:

    1) Check all the connections between the display and the PIC.
    2) Measure the voltage across the Vss (pin-1) and Vcc (pin-2) to make sure they are within limits (+5V +/- 0.25V).
    3) Install a 0.1μF ceramic capacitor between Vss and Vcc of the LCD.
    4) Increase the time delay between clocking signals.
    5) Execute the display initialization routine twice.
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Black boxes are not as serious as the blue screen of death: it means you have to start the init process, not turn things off and start again.

    Most probably a connection problem as Mr C suggests, if the code was truly working and you made no changes since it was working. Don't forget to check the pot too.

    Since you may have fried both A & B then tried old A with a new B then new B with new A you may just be propagating a shorted pin so make a test program to wiggle all the control and data pins so you can test each signal line with a scope (faster) or a DVM (slower) or even a LED (if nothing else available).
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Black boxes may be a result of to low dealy between each setup command or a missing connection to the contrast regulation pin. That pin on the LCD is named VEE or VO and is by the standard pin 3. Connect a pot between pin 2 and 3 like shown in this picture (random picture from the net)
    [​IMG]
     
  5. RobP

    Thread Starter New Member

    May 1, 2014
    3
    1
    Thanks for the advice I will try again in the lab tomorrow and update if i get anywhere.
     
  6. RobP

    Thread Starter New Member

    May 1, 2014
    3
    1
    Turns out that I had actually bust the LCD I was using. The LCD I replaced it with the first time also happened to be broken but I bought a new one and everything seems to work fine. Whilst I was checking connections I must have short one of the Pins.

    Thanks for all the suggestions though.
     
    ErnieM likes this.
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    How/where did you get an LCD in 2 days?
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,447
    3,362
    I have to add to my list of things to check:

    6) Confirm that the LCD is working on a functioning system.
     
  9. paulfjujo

    New Member

    Mar 6, 2014
    20
    3
    hello,

    Did you check the PCF8574 reference ?
    because PCF8574A has not the same I2C adress...
     
  10. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    HA! That happened to me. I busted the first one, and the second one was DOA. I should have remembered and suggested it.
     
Loading...