PIC16f916, LCD Black Boxes problem

Thread Starter

RobP

Joined May 1, 2014
3
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.
 

MrChips

Joined Oct 2, 2009
30,618
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.
 

ErnieM

Joined Apr 24, 2011
8,377
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).
 

t06afre

Joined May 11, 2009
5,934
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.
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)
 

Thread Starter

RobP

Joined May 1, 2014
3
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.
 

Brownout

Joined Jan 10, 2012
2,390
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.
HA! That happened to me. I busted the first one, and the second one was DOA. I should have remembered and suggested it.
 
Top