Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Lcd 16*2 displays garbbled vales after long time usage

Status
Not open for further replies.

SIVAPRAKASHTRIDENT

Junior Member level 1
Joined
Dec 8, 2015
Messages
16
Helped
0
Reputation
0
Reaction score
1
Trophy points
1
Activity points
114
I am using a 16*2 LCD display for my design.

It works fine initially during long run it displays wrong characters. controller works fine for the other operations

i have use PIC16f876 controller. LCD lampex 16200

Anyone help me to resolve this issue
 

I have used this display for one my project. It works fine for a 4 years without power cut.
 

I have used this display for one my project. It works fine for a 4 years without power cut.

Easyrider83 it also worked for me well for 8 months. Suddenly i got the noise issue. once i power off the whole circuit for sometime. it worked properly again.

I want to know what could be the reason..
 

Code is written poorly. Bank switching is not implemented properly. Which Compiler was used to write the code ? Code is written in assembly or C ? Maybe some strings used for LCD are placed in RAM instead of storing it in ROM as const char and access it when needed. Due to this and bank switching issue the text becomes garbage on LCD.

If you don't have the code then new code has to be written after reverse engineering the product. This is a problem if 16F devices is used with mikroC PRO PIC Compiler.
 

Code is written poorly. Bank switching is not implemented properly. Which Compiler was used to write the code ? Code is written in assembly or C ? Maybe some strings used for LCD are placed in RAM instead of storing it in ROM as const char and access it when needed. Due to this and bank switching issue the text becomes garbage on LCD.

If you don't have the code then new code has to be written after reverse engineering the product. This is a problem if 16F devices is used with mikroC PRO PIC Compiler.



The compiler used in this is HITECH C. code is written in C.
 

Provide the Circuit and .hex file if possible. Hi-Tech C generates bank switching code. Only reason is strings used for LCD are stored in RAM instead of storing it in ROM as const char and when strings are accessed when RAM usage is more by the controller for writing to LCD then text becomes garbage.

If you have C Code then modify it and place all strings used for LCD in ROM as const char if there is free space in ROM. If no free space in ROM then it is time to change your PIC to a PIC18F.

If you can post the C Code then I can make the modifications.

What does the device do ?
 

Hi,

* maybe the timing is at the limit, or slightely out of specification... --> check the timing with a scope
* maybe the voltage levels are at the limit, or slightely out of specification... --> check the voltage levels and ringing with a scope
* or an input is left floating.. --> check schematic

Klaus
 

Provide the Circuit and .hex file if possible. Hi-Tech C generates bank switching code. Only reason is strings used for LCD are stored in RAM instead of storing it in ROM as const char and when strings are accessed when RAM usage is more by the controller for writing to LCD then text becomes garbage.

If you have C Code then modify it and place all strings used for LCD in ROM as const char if there is free space in ROM. If no free space in ROM then it is time to change your PIC to a PIC18F.

If you can post the C Code then I can make the modifications.

What does the device do ?


the Device is doing the same operation for 8 moths .

I have a doubt will the memory overflow arose after that much working hours.

hex file and schematic are attached for your ref
 

Attachments

  • sch.JPG
    sch.JPG
    65.8 KB · Views: 107
  • file.txt
    2.5 KB · Views: 95

Hi,

a better error description is necessary.

Are ALL chracters garbage?
Does the display react at all?

After a reset (not power down) does it work correctely?
After a power down, does it work correctely?
Is your design EMC compliant?
Do all other things connected to the microcontroller work correctely?

Klaus
 

Although code errors are a possible reason, electrical noise is much more likely. In both cases reconfiguring the display periodically would solve the problem.

If you don't want to perfoma reconfiguration on spec, you can implement a read/write interface and read back the display memory and compare with expected content. Reconfigure and rewrite in case of differences.
 

If you have the MPLAB Hi-Tech PICC Project then zip it and pot it here. Looking at the circuit I can guess the code is small but I see menu system implemented in LCD. I am sure that strings used for menu system is placed in RAM and hence very less RAM is left for run time operation and I also suspect there are some functions used for LCD menu system which are large and eating up stack space and during this bank switching is not being done properly and hence the problem.

Some operation which happened only after eight months like a large function in the code executed only at that time based on some input condition might have resulted in the garbage after RAM data corrupted.


I see 3x NTC mentioned for 3x ADC channels ? Are these thermisters ? Are you measuring three different temperatures ? What is the device do ?
I see two relays and one solenoid valve ? Are you using one relay to turn ON/OFF heater of a boiler ? Are you using valve to control the inlet of water to boiler ?
Are you using LCD to set the relay turn ON/OFF temperatures ?

- - - Updated - - -

Compare the price of

PIC18F26K22-E/SP

https://www.microchipdirect.com/ProductSearch.aspx?keywords=PIC18F26K22

and price of

PIC16F876A-E/SP

https://www.microchipdirect.com/ProductDetails.aspx?Category=PIC16F876A&&keywords=PIC16F876A-I/SS


Also compare the features of the two devices from the datasheets

Just compare the RAM and ROM sizes of the 2 devices.

PIC18F is far more better device compared to PIC16F. Maybe you are using fake PIC16Fs and maybe you are getting it for less price. That is one of the reason I see for people using PIC16Fs.

Buy PIC18F26K22 from microchipDirect and use it.

If you have the C Code for the device then change your PIC to PIC18F26K22.

- - - Updated - - -

I suspect poorly written code. In Simulation I am not getting any data on LCD and it shows 460 errors. The simulation shows grayed out boxes for PORTB and error shows TRISB instruction deprecated. This is causing the problem. Maybe same problem in real hardware.

- - - Updated - - -

How many boards have you manufactured for this circuit ?

If few and if you can replace the boards then try PIC32MX170F256B-V/SP. I was searching for PIC32 devices in DIP package and found this. Cheaper than your PIC16F device. Lots of RAM and ROM. 3.3V device. Low power consumption and wide temperature range.

https://www.microchipdirect.com/ProductSearch.aspx?keywords=PIC32MX170F256B

If you can change to PIC32 then I can port the code for you.

- - - Updated - - -

How many boards have you manufactured for this circuit ?

If few and if you can replace the boards then try PIC32MX170F256B-V/SP. I was searching for PIC32 devices in DIP package and found this. Cheaper than your PIC16F device. Lots of RAM and ROM. 3.3V device. Low power consumption and wide temperature range.

https://www.microchipdirect.com/ProductSearch.aspx?keywords=PIC32MX170F256B

If you can change to PIC32 then I can port the code for you.

- - - Updated - - -

Sorry, I thought you were using PIC16F876A. You are using still older PIC16F876.

Compare the prices and temperature ranges here.

SPDIP 28 Pin Devices

https://www.microchipdirect.com/ProductDetails.aspx?Category=PIC16F876

PIC16F876-20/SP
PIC16F876-04/SP
PIC16F876-04I/SP
PIC16F876-10E/SP
PIC16F876-20I/SP
PIC16LF876-04/SP

https://www.microchipdirect.com/ProductSearch.aspx?keywords=PIC18F26K22

PIC18F26K22-E/SP

https://www.microchipdirect.com/ProductSearch.aspx?keywords=PIC32MX170F256B

PIC32MX170F256B-V/SP


PIC32MX170F256B-V/SP is cheaper than all versions of PIC16F876



https://www.microchip.com/wwwproducts/en/PIC16F876

https://www.microchip.com/wwwproducts/en/PIC18F26K22

https://www.microchip.com/wwwproducts/en/PIC32MX170F256B

- - - Updated - - -

I checked the datasheets of PIC16F876 and PIC18F26K22. They are pin compatible devices and hence you can replace the PIC16F device to PIC18F26K22. I can port the code to 18F device for you.

- - - Updated - - -

You are not using ADC. You are inputting some digital sensor data to J3 connector. I see that two relays are used and two different devices are controlled.

The devices connected to the relays have 4 states.

Device 1 and 2 OFF
Device 1 and 2 ON
Device 1 ON and Device 2 OFF
Device 1 OFF and Device 2 ON

The LCD you are using is HD44780 Compatible. The only thing I didn't understnad is the SMD component connected to MCLR pin. Is it for soft resetting the PIC ? I guess so.

- - - Updated - - -

There are a total of 5 PCBs in the design.

LCD board
Digital Sensors board
3 or 4 buttons board
main board
dual power supply board (24V and 5V)

TIP122 is heavy for the design. The design could have used 2N2222A for the LCD Backlight control.

If J10 jumper is not provided at the edge of the main board for user access then the device is calibrated at the factory by putting the J10 in set mode and using buttons to set the parameters and then the J10 is set into run mode. You are using internal eeprom to store the set parameters.

User doesn't have access to the buttons ? or is disbaled for user after factory settings ?

24V is used for the solenoid valve and relays and hence the device is a industrial device.

My previous device operation based on relay connections are incorrect.

There are three states

J9 device ON and J7 device OFF
J9 and J7 devices ON
J9 and J7 devices OFF

For K1 relay phase goes into relay COm pin and if relay turns ON then it goes to device through NO and J9 (1) and returns to neutral line through J9 (2)

If device 1 is ON then only device 2 connected to J7 turns ON. Return of J9 (2) goes to COM of K2 relay and if K2 is ON then connection completes through NO and J7 (1) and goes to device 2 and then returns to neutral through J7 (2)

You are not measuring RPM because you are not using counters or INT pins for sensors connected to J3.

What is connected to J3 ? Float Switches ?

Time needed to port the code to 18F26K22 is approx 1 hour.
 

Attachments

  • DUT.png
    DUT.png
    49.6 KB · Views: 104
  • DUT Error.png
    DUT Error.png
    81.1 KB · Views: 94
Last edited:

Hi,

a better error description is necessary.

Are ALL chracters garbage?
Does the display react at all?

After a reset (not power down) does it work correctely?
After a power down, does it work correctely?
Is your design EMC compliant?
Do all other things connected to the microcontroller work correctely?

Klaus



Hi,

All characters are getting garbled.

Don't have a reset switch for resetting the controller or no program reset is given in code for lcd

after power down for a minute it works properly.

No i haven't test the whole product for emc.

yes all the other components working properly except the display
 

You didn't answer to my big post 11.

How many boards do you have with this problem ?
What does the device do ?
If you can't provide the C code but tell me how the device works then I can write a new C Code for PIC18F26K22. You can replace your 16F device with this. If you have many boards then just replace the 16F with 18F for one board and see the working.

I checked the datasheet of the LCD you are using but it doesn't show LCD Initialization method. I don't know whether your LCD is compatible with HD44780 or not. Anyway I can write the code if device functioning is explained in detail.

If you can't change the 16F device and if in your current C Code the strings used for LCD menu system is placed in RAM then I can either write a new C Code and place all strings in ROM to free up the RAM or I can modify your Hi-Tech C Code so that strings are placed in ROM and used (If you can provide your Hi-Tech PICC Project).
 

You didn't answer to my big post 11.

How many boards do you have with this problem ?
What does the device do ?
If you can't provide the C code but tell me how the device works then I can write a new C Code for PIC18F26K22. You can replace your 16F device with this. If you have many boards then just replace the 16F with 18F for one board and see the working.

I checked the datasheet of the LCD you are using but it doesn't show LCD Initialization method. I don't know whether your LCD is compatible with HD44780 or not. Anyway I can write the code if device functioning is explained in detail.

If you can't change the 16F device and if in your current C Code the strings used for LCD menu system is placed in RAM then I can either write a new C Code and place all strings in ROM to free up the RAM or I can modify your Hi-Tech C Code so that strings are placed in ROM and used (If you can provide your Hi-Tech PICC Project).

1% of the boards are having the problem

it senses the temperature of the device and controls the motor for the set values.

The LCD display characters are stored in const char and called when it needed.

Its difficult for change the controller IC(Any way thanks for the suggestion)

If you could pl tell me how can we check the data is stored in ROM or RAM
 

Maybe you have to use const code char or const rom char for Hi-Tech PICC I don't remember. I used Hi-Tech PICC long back. Google for it.


Does all the boards use the same revision .hex file (firmware) or does the 1% boards having problem use a different revision firmwares ?
 

initial the LCD before you display anything, most of the time it solves these kind of issue.

William
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top