BS2p24/BOE and LCD Terminal AppMod
Mike G
Posts: 2,702
I'm having a problem using the LCD Terminal Appmod with a BS2p24. Even the LCD_AppMod_Demo.BS2 found on the LCD Terminal Appmod page is not functioning properly. However, if I use the BS2 the LCD functions as expected. BTY not functioning means Blackish squares where chars should be. Yes, I tried adjusting the contrast POT
Test code (from PBASIC help)
' {$STAMP BS2p}
' {$PBASIC 2.5}
Init_LCD:
PAUSE 1000 ' allow LCD to power-up
LCDCMD 1, 48 ' Send wake-up sequence (3x)
PAUSE 5
LCDCMD 1, 48
PAUSE 1
LCDCMD 1, 48
PAUSE 1
LCDCMD 1, 32 ' Set data bus to 4-bit mode
LCDCMD 1, 40 ' Set 2-line mode with 5x8 font
LCDCMD 1, 8 ' Turn display off
LCDCMD 1, 12 ' Turn display on without cursor
LCDCMD 1, 6 ' Auto-increment cursor
LCDCMD 1, 1 ' Clear the display
Main:
GOSUB Init_LCD - Oops - should have removed this line
LCDOUT 1, 1, [noparse][[/noparse]"Hello World!"]
STOP
Thanks a bunch
Mike
Post Edited (Mike Gebhard) : 10/26/2006 11:53:26 PM GMT
Test code (from PBASIC help)
' {$STAMP BS2p}
' {$PBASIC 2.5}
Init_LCD:
PAUSE 1000 ' allow LCD to power-up
LCDCMD 1, 48 ' Send wake-up sequence (3x)
PAUSE 5
LCDCMD 1, 48
PAUSE 1
LCDCMD 1, 48
PAUSE 1
LCDCMD 1, 32 ' Set data bus to 4-bit mode
LCDCMD 1, 40 ' Set 2-line mode with 5x8 font
LCDCMD 1, 8 ' Turn display off
LCDCMD 1, 12 ' Turn display on without cursor
LCDCMD 1, 6 ' Auto-increment cursor
LCDCMD 1, 1 ' Clear the display
Main:
GOSUB Init_LCD - Oops - should have removed this line
LCDOUT 1, 1, [noparse][[/noparse]"Hello World!"]
STOP
Thanks a bunch
Mike
Post Edited (Mike Gebhard) : 10/26/2006 11:53:26 PM GMT
bs2
11K
Comments
The code is a little mixed up - no return from the Subroutine Init_LCD - and the main code was after the sub so as you presented it, it would go through the Init_LCD code, fall into Main when the Init_LCD is called again (without a return), etc.
A couple of other observations,
- there are distinctly different commands when using the BS2 vs BS2P - the code you used and the code below are for BS2P
- LCDCMD for BS2P family
- PULSOUT for BS2
- the statement #DEFINE _LcdReady = ($STAMP = BS2P) OR ($STAMP = BS2PE) is key as it determines which to use based on the $STAMP definition
- you may need to allow for Proc speed vs. LCD speed via PAUSESes (I'm not sure as I have been working exclusively with Serial LCD's.
Try this (on your BS2P:
Post Edited (Paul Sr.) : 10/26/2006 12:49:05 PM GMT
Your right I should have removed the sub call from main.· That was a mistake when I pasted into the forum.· The original was
' {$STAMP BS2p}
' {$PBASIC 2.5}
Main:
· GOSUB Init_LCD
· LCDOUT 1, 1, [noparse][[/noparse]"Hello World!"]
· STOP
Init_LCD:
· PAUSE 1000··························· ' allow LCD to power-up
· LCDCMD 1, 48························· ' Send wake-up sequence (3x)
· PAUSE 5
· LCDCMD 1, 48
· PAUSE 1
· LCDCMD 1, 48
· PAUSE 1
· LCDCMD 1, 32························· ' Set data bus to 4-bit mode
· LCDCMD 1, 40························· ' Set 2-line mode with 5x8 font
· LCDCMD 1, 8·························· ' Turn display off
· LCDCMD 1, 12························· ' Turn display on without cursor
· LCDCMD 1, 6·························· ' Auto-increment cursor
· LCDCMD 1, 1·························· ' Clear the display
REturn·
Your code and the code above does not display "Hello World" when using a BS2p24/BOE and LCD Appmod revision A.· I can get the display working if I use·use a BS2.· Even the LCD_AppMod_Demo.BS2 found on the·LCD Terminal Appmod page is not functioning properly.· However, if I use a BS2/BOE·the LCD functions as expected.
The attached code function perfectly with a BS2\LCD and was working on a BS2p\LCD.· To make matter worse, I've had many different LCD Terminal Appmods on several different projects.· So I'm not sure if this particular LCD ever functioned properly with a BS2p since it was attached to a BS2 project.
Thanks,
Mike
·
·· I can confirm that the following code works on our LCD AppMod on a BS2p24 as I just tested it now.· Try the attached file and see if that works for you.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The attached LcdAppmodDemo.BS2 is not working with my BS2p24/BOE - LCD Terminal Appmod setup. However, if I swap the BS2p for a BS2 it works fine
Thanks,
Mike
I found another LCD Terminal Appmod lying around plugged it in and it has the same problem. It works with a BS2 and not the BS2p24 using "LcdAppmodDemo.BS2".
·
·· This is strange, indeed!· I cannot reproduce your results at Parallax with the same exact hardware and software…What sort of power supply are you running this from?· I know it’s grasping, but something has to be the cause.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I can send you my LCD/BS2p/BOE if you like.
Mike
·
·· Contact me via e-mail regarding that.· My address is in the E-Mail icon to the left.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support