PDA

View Full Version : lcd problem



malc-c
- 7th July 2010, 12:29
I'm after some advice from those more experienced with LCD's than I !

I'm in the process of taking a project off the EasyPIC5 development board and building the prototype on stripboard. My 20 x 4 LCD has been fitted with a female header which plugs directly onto the pins on the EasyPIC board, so to make life easy I've soldered wires to a set of male header pins so I can easily remove the LCD or stripboard if needed whilst I de-bug any errors in my layout. I've wired the LCD up as per the diagram below

http://micro-heli.co.uk/lcd.jpg

However all I get is a backlit LCD - not even rows of blocks when the device is powered up. I've tripple checked each wire to make sure it's going to the right pins on PORT B and checked the board to make sure there are no shorts / breaks (as far as I can see). My first thought was that the PIC isn't running, so connecting up a sensor caused an indication LED to flash as it should. I've also used an LED to check to see if any voltage is present on RB0 - RB5 and noted that some ports were pulsing the LED much the same way as the leds on the EasyPIC board did, so it would seem that the PIC is running OK. I've used a 10K trim pot, which seems to have no effect, but then if the LCD isn't drawing anything I guess there will be nothing to adjust. - If I place the LCD back in the EasyPIC board with no PIC I get two rows of blocks, but If I remove the PIC from the stripboard this isn't replicated.

Any suggestions

Acetronics2
- 7th July 2010, 12:53
Hi, Malc

IF it already worked on your EP5 ... ( ??? ) :rolleyes:

@ first try to raise somewhat the delay DEFINES for the LCD ... ;)

Commandus @ 2500 and Dataus @ 100 ...

should do the trick.

IF NOT ...

POST your code beginning ... :p

Alain

And trim VEE to .5 -.6 volts ...

rsocor01
- 7th July 2010, 14:03
Malcolm,

Double check the voltage on Vo (contrast adjustment). Go all the way from the minimum to the maximum on the potentiometer.

Robert

malc-c
- 7th July 2010, 14:05
Alain,

Thanks for the reply. The PIC works fine in the EP5, and here's the start of the LCD config



DEFINE LCD_DREG PORTB ' LCD Data port
DEFINE LCD_DBIT 0 ' starting Data bit (0 or 4)
DEFINE LCD_EREG PORTB ' LCD Enable port
DEFINE LCD_EBIT 5 ' Enable bit (on EasyPIC 5 LCD)
DEFINE LCD_RSREG PORTB ' LCD Register Select port
DEFINE LCD_RSBIT 4 ' Register Select bit (on EasyPIC 5 LCD)
DEFINE LCD_BITS 4 ' LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 4 ' number of lines on LCD
DEFINE LCD_COMMANDUS 2000 ' Command delay time in us
DEFINE LCD_DATAUS 50 ' Data delay time in us


I've checked the voltage on the trim pot and set it to 0.6v.

I've also used an LED to check if anything is happening on the data lines (hope this makes sense)

RB3 (D7) - slow pulsing (50:50)
RB2 (D6) - slow pulsing (25:75 on /off)
RB1 (D5) - slow pulsing (50:50)
RB0 (D4) - quick pulse (25:75)

RB5 (E) - nothing
RB4 (RS) - on, but with a slight regular flicker

I've scraped a blade between all tracks on the board, bur still no blocks appear on the lcd

malc-c
- 7th July 2010, 14:07
Malcolm,

Double check the voltage on Vo (contrast adjustment). Go all the way from the minimum to the maximum on the potentiometer.

Robert

Robert, thanks for the input - voltage range = 0.00 to 4.46v

Jerson
- 7th July 2010, 15:18
Malcolm

Please post the code you're using. I suspect the code is re-starting after printing the message.

Jerson

aratti
- 7th July 2010, 15:29
DEFINE LCD_LINES 4 ' number of lines on LCD


Your define is for a 4 lines LCD while you are using a two lines display (as per picture in your post #1)

Al.

malc-c
- 7th July 2010, 15:35
Personally I don't think it's the code - this has been running fine in the development board (see the 4ch thermostat post under the code section), and the PIC seems to be running OK when used on the stripboard as the LEDs indicate the PID routines work when the temperature detected by the probes are increased / decreased. My hunch is that it has to be something with the stripboard, I might try re-soldering the wires as it could be something as simple as a dry joint ?

malc-c
- 7th July 2010, 15:36
DEFINE LCD_LINES 4 ' number of lines on LCD


Your define is for a 4 lines LCD while you are using a two lines display (as per picture in your post #1)

Al.

Sorry, but misleading as that was taken from the EasyPIC manual, I'm actually using a 4 x 20 as stated in my 1st post.

malc-c
- 7th July 2010, 16:00
Personally I don't think it's the code - this has been running fine in the development board (see the 4ch thermostat post under the code section), and the PIC seems to be running OK when used on the stripboard as the LEDs indicate the PID routines work when the temperature detected by the probes are increased / decreased. My hunch is that it has to be something with the stripboard, I might try re-soldering the wires as it could be something as simple as a dry joint ?

Uhmm... well I just belled out each wire pin fo pin and it all checks out. :confused:

Jerson
- 7th July 2010, 16:10
Could be even simpler - decoupling caps 0.1uF? since you mentioned using strip board

malc-c
- 7th July 2010, 16:42
Yep, have one fitted across the supply lines next to the pic - might put a few more in

I've just breadboarded the pic (pic, xtal, caps and the lcd) and it's running fine... must be a fault somewhere on the board...

Thanks guys for all your inputs

Archangel
- 8th July 2010, 04:16
Try allowing D0 : D3 to float without grounding them and ground pin 3 of the LCD instead of the pot(I always do this).

malc-c
- 9th July 2010, 19:14
We'll I couldn't work out what the actual fault was so I started again with a fresh stripboard, and this time built the board up as I went rather than try and plan it out first. Net result is that the LCD is displaying the data as it did when on the EasyPIC5 board.

However......
I'm now having strange issues with the DS18B20 sensors. The code (listed in the code section under 4ch Thermostat) should show NC if there is no sensor connected, but ch3 shows up as 655.4c... If I connect is sensor to Ch3 it correctly reads the right temperature, but then Ch2 displays 655.4c... but if both have sensors connected both read correctly. Ch1 and Ch4 work perfectly. I've checked the board, replaced the resistors between the data and +ve, even re-made the links between the PIC and the sensor input.

I'm testing the board by hooking it up to the Expansion port on the EP5, and have decoupling caps across the supply lines.

Any suggestions.... at least I've made some progress over the 1st prototype :)

Oh... and is there any difference in addressing the NXP PCF8583 RTC and the Maxim DS1307 RTC ? - I used the DS1307 module when developing the code, but the shop supplied this
http://www.mcustore.com/acatalog/rtcproto_550.jpg
which is based on the NXP chip. - The clock can be read, but it doesn't update (shows 10:10 all the time)

malc-c
- 15th July 2010, 12:01
I'm now having strange issues with the DS18B20 sensors. The code (listed in the code section under 4ch Thermostat) should show NC if there is no sensor connected, but ch3 shows up as 655.4c... If I connect is sensor to Ch3 it correctly reads the right temperature, but then Ch2 displays 655.4c... but if both have sensors connected both read correctly. Ch1 and Ch4 work perfectly. I've checked the board, replaced the resistors between the data and +ve, even re-made the links between the PIC and the sensor input.

I'm testing the board by hooking it up to the Expansion port on the EP5, and have decoupling caps across the supply lines.

Any suggestions.... at least I've made some progress over the 1st prototype :)



Reprogrammed the pic as it did the same on the development board - Now working fine