PIC 16F887 LCD Interfacing Problem – electroSome https://electrosome.com/topic/pic-16f887-lcd-interfacing-problem/feed/ Sat, 18 Mar 2023 04:53:55 +0000 https://bbpress.org/?v=2.6.9 en-US https://electrosome.com/topic/pic-16f887-lcd-interfacing-problem/#post-13135 <![CDATA[PIC 16F887 LCD Interfacing Problem]]> https://electrosome.com/topic/pic-16f887-lcd-interfacing-problem/#post-13135 Wed, 16 Nov 2016 14:48:12 +0000 Rob Edge Hello,

I am trying to use the lcd.h header, with a PIC16F887, and xc8.
The code compiles fine, but the lcd will only power up, giving solid blocks on the first line.
The code is directly copied from the tutorial with the following changes.

#define _XTAL_FREQ 20000000
#define RS RB2
#define EN RB3
#define D4 RB4
#define D5 RB5
#define D6 RB6
#define D7 RB7
#include <xc.h>
#include "lcd.h";
TRISB = 0x00;
ANSELH = 0x00;

I have checked the connections, and all are ok. I suspect that port b is not working for some reason, but I have studied the datasheet, and can’t see that I have missed anything.
Can anyone please help?

Regards
Bob.

]]>
https://electrosome.com/topic/pic-16f887-lcd-interfacing-problem/#post-13141 <![CDATA[Reply To: PIC 16F887 LCD Interfacing Problem]]> https://electrosome.com/topic/pic-16f887-lcd-interfacing-problem/#post-13141 Thu, 17 Nov 2016 06:49:36 +0000 Ligo George Hi,

First make sure that PORTB is functing correctly by connecting some LEDs and programing accordingly.

Did you connected the contrast adjusting variable resistor to the LCD ? If so try adjusting the contrast.

]]>
https://electrosome.com/topic/pic-16f887-lcd-interfacing-problem/#post-13152 <![CDATA[Reply To: PIC 16F887 LCD Interfacing Problem]]> https://electrosome.com/topic/pic-16f887-lcd-interfacing-problem/#post-13152 Thu, 17 Nov 2016 14:57:25 +0000 Rob Edge Thank you Ligo for your reply.

It is working fine on port d. After I removed the return from the example code.

Feel a bit silly now. I have the PICkit 2 connected to port b, so it would not work at the same time as I was debugging it.

 

Kind regards

Bob.

]]>