UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > General Vintage Technology > Components and Circuits

Notices

Components and Circuits For discussions about component types, alternatives and availability, circuit configurations and modifications etc. Discussions here should be of a general nature and not about specific sets.

Closed Thread
 
Thread Tools
Old 12th Jan 2020, 5:17 pm   #1
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolven, Wales; and Bristol, England
Posts: 2,608
Default 16x2 LCD display not working

Hi,

I built a version of the ELEKTOR lead-acid battery activator that uses a PIC16F1847 to do the work and a 16x2 LCD display to communicate results to the user.

Although the circuit appears to work, there are four LEDs that convey some system activity, the LCD is blank. The power is correct, the contrast control changes the display to show blocks at one end of the control range, the backlight is lit. Using the 'scope, I can see signals on the data lines D4 - D7. The lines D0 to D3 are connected to ground.

Another small test rig that I have that uses the same display and the display works in that.

I'm wondering which bit of magic it is that I don't know. Can anyone help?
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is online now  
Old 12th Jan 2020, 5:49 pm   #2
ian_rodger
Pentode
 
Join Date: Jan 2015
Location: Greenock, Inverclyde, UK.
Posts: 161
Default Re: 16x2 LCD display not working

Is the I2C address for the LCD set correctly? Edit: ignore - looked at circuit, its not using I2C to commmunicate to LCD.

Last edited by ian_rodger; 12th Jan 2020 at 5:55 pm.
ian_rodger is offline  
Old 12th Jan 2020, 5:49 pm   #3
RobustReviews
Pentode
 
Join Date: Dec 2019
Location: Cambridge, UK
Posts: 120
Default Re: 16x2 LCD display not working

What signal are you getting on your select line?

These Hiatchi type displays I believe have a hi/lo for either sending a command or data, long time since I've worked with a 16x02 mind.

Cheers,
RR
RobustReviews is offline  
Old 12th Jan 2020, 6:13 pm   #4
valves4amps
Triode
 
valves4amps's Avatar
 
Join Date: Sep 2006
Location: Broughton Preston Lancashire, UK.
Posts: 42
Default Re: 16x2 LCD display not working

Try resetting the processor once powered to see if display initialises. If it does then you need a longer reset on the pic. I had this problem many years ago using a 1st generation 16x2 display it would not initialise properly every time, so I increased the reset cap value and then it worked reliably.

Dave
valves4amps is offline  
Old 12th Jan 2020, 6:56 pm   #5
RogerEvans
Hexode
 
Join Date: Oct 2014
Location: Wiltshire, UK.
Posts: 381
Default Re: 16x2 LCD display not working

I remember playing with the 1602 displays some years ago with AVR micros. There is some trickery in persuading them to work in 4 bit data mode since they initially start up in 8 bit mode. I am not sure of the details but it is to do with repeating the same init command a few times and then the 1602 decides that you really, really did want 4 bit mode. When I started playing with them there were some different recommendations as to getting them started in 4 bit mode and not all methods were reliable. I can probably dig out the last version of the init code that I used but it could mean reprogramming the PIC.

Certainly I would say try valves4amps suggestion.

Regards,

Roger
RogerEvans is offline  
Old 12th Jan 2020, 8:40 pm   #6
julie_m
Dekatron
 
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
Default Re: 16x2 LCD display not working

The instruction to select 4-bit mode is chosen so that bits 0-3 are "don't care"; but it has to be the first instruction you send to the display module, and you must only strobe it once (so in effect it never gets the bottom nybble). If you assert the strobe a second time, the value you send will be interpreted as the first nybble of a new instruction, and the next thing you send will be interpreted as the second nybble of that instruction.
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments.
julie_m is offline  
Old 12th Jan 2020, 10:44 pm   #7
gingpeakin
Hexode
 
Join Date: Mar 2009
Location: Worthing, Sussex, UK.
Posts: 276
Default Re: 16x2 LCD display not working

I agree with Valveamps. These can take quite a while to initialise - longer than you average PIC or AVR device.

Ging
gingpeakin is offline  
Old 13th Jan 2020, 12:25 am   #8
Terry_VK5TM
Nonode
 
Terry_VK5TM's Avatar
 
Join Date: Oct 2010
Location: Tintinara, South Australia, Australia
Posts: 2,339
Default Re: 16x2 LCD display not working

Assuming everything is wired correctly and knowing the display works in another project, the two main causes of "blocks in the display" are:

1/ faulty code.

2/ incorrect oscillator speed setting on the PIC.
__________________
Terry VK5TM
https://www.vk5tm.com/
Terry_VK5TM is offline  
Old 13th Jan 2020, 12:41 am   #9
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,554
Default Re: 16x2 LCD display not working

mole42 hasn't mentioned whether the display is being used in read / write mode or in write-only mode.

Read/Write mode is the preferred mode if you can spare one extra uP pin to control the R/W pin on the display because the controlling uP can then poll the 'busy' bit in the status register to ascertain that the display is 'not busy' before sending the next value to the display. Obviously this allows the fastest possible communication with the display because the display tells you as soon as it is ready to receive more data.

Write-only mode uses the R/W pin of the display tied to 0V, thus holding it in write mode only. When used this way, the controlling uP has to insert a significant delay between each write to the display to give the display time to process each value sent to it. With this connection method sending the data too fast, with not enough of a delay between writes, would be one possible cause for this problem.

When you turn the contrast up and blocks appear, are the blocks on the upper line only?

Blocks on one line only = initialisation of the display has not taken place.

Blocks on both lines = initialisation of the display may have taken place, as it has been placed into two-line mode. (The default mode of the controller chip is one-line even when built into a two-line display).
SiriusHardware is offline  
Old 13th Jan 2020, 7:45 am   #10
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolven, Wales; and Bristol, England
Posts: 2,608
Default Re: 16x2 LCD display not working

Ah! The greyness fades a little.

Turning the contrast reveals only the upper line of blocks so we're not initialising the display. The R/W pin is taken to ground so it's operating in write-only.

The device appears to function, it is designed to pulse a MosFET once every 30 seconds, flashing an LED as it does so. That works and I can see the MosFET drive signal on the 'scope. The problem I see is that the PIC is used in a very autonomous fashion, there's no external timing or reset functions (it's possible to use the PIC16F1847 in this manner). As I only have the HEX file to program the chip, I'll have to dis-assemble it to try and find out how to make the display reliably initialise.

Thanks guys!
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is online now  
Old 13th Jan 2020, 10:37 am   #11
Terry_VK5TM
Nonode
 
Terry_VK5TM's Avatar
 
Join Date: Oct 2010
Location: Tintinara, South Australia, Australia
Posts: 2,339
Default Re: 16x2 LCD display not working

The "source code" is available on the Elektor site, but unless you have Flowcode 6, it won't be any use.

And disassembly of the hex file wont necessarily give you the config word parameters (went through this over the weekend with something else).
__________________
Terry VK5TM
https://www.vk5tm.com/
Terry_VK5TM is offline  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 8:25 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.