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.

Picbasic Pro - 2x16 LCD problem, please help

Status
Not open for further replies.

s.triker

Newbie level 1
Joined
Jan 4, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Hi all,

I'm trying to drive my LCD module (2x16 ATM1602B with driver S6A0069) from PIC16F88. I spent 2 days on this, but I can't display any character on LCD. I checked connections many times, it is correct.

Only thing I see is the first line containing blank squares. I've read several post with this topic, and it seems to be a problem with LCD init.

I tried the same code and circuit in Proteus and it works perfectly. But in real nothing :(.

Does anyone have an idea how to initialize LCD properly in PicBasic pro? Or if you see any other error please let me know.

My connections are:
D4-D7 .... RB0-RB3
RS ......... RB4
E ........... RB5
RW ........ Ground
Vo ........ Pot against Ground (approx 0.8 V)

Here is my code:
Code:
@ DEVICE INTRC_OSC_NOCLKOUT & WDT_OFF & PWRT_OFF & MCLR_OFF & BOD_ON & LVP_OFF & PROTECT_OFF
             
' Define LCD registers and bits
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG    PORTB
DEFINE LCD_RSBIT    4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5
DEFINE LCD_BITS 4
DEFINE LCD_LINES    2
DEFINE LCD_COMMANDUS    2000 
DEFINE LCD_DATAUS   50 ' 1000 

DEFINE OSC 4

OSCCON = %01100110 ' internal 4MHz
OPTION_REG = $7f  
ANSEL = 0     
CMCON = 7   

FLAGS = 0

    Pause 500       ' Wait for LCD to startup

mainloop: 
    Lcdout $fe, 1   ' Clear LCD screen
    Lcdout "Hello"  ' Display Hello
    Pause 500       ' Wait .5 second
    
    Lcdout $fe, 1   ' Clear LCD screen
    Lcdout "World"
    Pause 500       ' Wait .5 second
    
    Goto mainloop   ' Do it forever

I would appreciate any help,
many thanks,
regards,
Paul
 

Its been years since I last used picbasic, but apparently the code you have posted does not include a device.inc like (16f88.inc)

Secondly for Vo, remove it from the pot leave it as not connected and then try the code, I think after device.inc and Vo open the code should work.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top