lcd with pic basic

Status
Not open for further replies.

SwingeyP

Member
Im back to LCD's again. I have an ASM routine working with lots of help from this forum. I now wanted to have a go at doing a similar thing with picbasic and the oshon simulator. This is mainly because im writing a menu and basic makes it much easier.

Can anyone tell me why this simple code doesn't work - it keeps reporting the delays aren't long enough. Does anyone know what the default values are for setup with 'busy handshaking'

Define LCD_BITS = 8
Define LCD_DREG = PORTB
Define LCD_DBIT = 0
Define LCD_RSREG = PORTA
Define LCD_RSBIT = 0
Define LCD_EREG = PORTA
Define LCD_EBIT = 2
Define LCD_RWREG = PORTA
Define LCD_RWBIT = 1
Define LCD_READ_BUSY_FLAG = 1

Define LCD_COMMANDUS = 5000 'delay after LCDCMDOUT, default value is 5000
Define LCD_DATAUS = 200 'delay after LCDOUT, default value is 100
Define LCD_INITMS = 500


Lcdinit LcdCurBlink
loop:
Lcdout "Hello world!"
WaitMs 1000
Lcdcmdout LcdClear
WaitMs 1000
Goto loop


Many thanks

Regards - Paul
 
I do not use basic but it looks like you are misusing DEFINE

try


Define LCD_BITS 8
 
Sorry should have said the code compiles ok with no errors. I am running it on the oshon simulator. I just want to know the correct setings to allow for proper handshaking.
 
Hi Paul..
I dont know what pic you are using but if it
is one with AD converter on port a like pic16f628 pic16f876 pic16f877 or pic16f887
you need to make it digital using ALLDIGITAL command just above your LOOP:
sorry for all my spelling errors but i dont talk english very often
--------------------------------------------------------------------
I just tryed your program and also got an error but the error
disapered when i removed "Define LCD_READ_BUSY_FLAG = 1"
and the program works fine now.
All the best from oz1lqb / Claus
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…