BS2p40 and 2x16 LCD
![Bill Chennault](https://forums.parallax.com/uploads/userpics/820/n25YAQT2TKN7D.jpg)
All--
Long ago, I bought StampWorks. It includes an LCD. I never got that far in the book, having learned enough to begin Stamping. Now, I want to use the 2x16 parallel LCD with my PDB. It sounded simple to me; just plug the attached cable into X2 on the PDB, run some jumpers from P0, P2, P3, P4, P5, P6, and P7 to E, R/W, RS, DB4, DB5, DB6, and DB7, respectively (using the outboard sides of DB4, DB5, DB6, and DB7). Tie P0 to VSS via a 4.7k ohm, and P4, P5, P6, and P7 to VSS via a 10k ohm.
Load the sample code and . . . nothing except a blinking cursor on the left.
After more reading, I found that although the Parallax LCD documentation calls for 10k ohm resistors on the pins mentioned above (p2), StampWorks says to use 220k ohm (p75). So, I switched them out.
Same results.
All the pins on the BS2p40 work fine.
Here is the code I downloaded .·. .
' =========================================================================
'·· File...... Parallel_LCD_2X16.bsp
'·· Purpose... Parallel LCD Display Demo
'·· Author.... Parallax, Inc.
'·· E-mail.... support@parallax.com
'·· {$STAMP BS2p}
'·· {$PBASIC 2.5}
'
[noparse][[/noparse] Program Description ]
' This program demonstrates using a Hitachi-compatible Parallel LCD Display
' This code works with the BS2p24, BS2p40, BS2pe and BS2px24
'
[noparse][[/noparse] I/O Definitions ]
Lcd············ PIN···· 0·············· ' LCD Enable Pin
'
[noparse][[/noparse] Variables ]
temp··········· VAR···· Byte
char··········· VAR···· Byte
'
[noparse][[/noparse] Initialization ]
Init_Lcd:
· PAUSE 1000
· FOR temp = 0 TO 2
··· LCDCMD Lcd, 48····················· ' Reset LCD (Send 3 times)
··· PAUSE 5···························· ' Delay Require By LCD Specs
· NEXT
· LCDCMD Lcd, 32······················· ' Set 4-bit Mode
· LCDCMD Lcd, 40······················· ' Set 2-line Mode
· LCDCMD Lcd, 12······················· ' Turn On Display With No Cursor
· LCDCMD Lcd, 6························ ' Set To Auto-Increment Cursor
· LCDCMD Lcd, 1························ ' Clear Display
'
[noparse][[/noparse] Main Routine ]
Main:
· DO
··· LCDOUT Lcd, 1, [noparse][[/noparse]"Hello, this is"]·· ' Clear LCD & Print Line 1 Text
··· LCDOUT Lcd, 192, [noparse][[/noparse]"the LCD demo."]· ' Move To Line 2 & Print Text
··· PAUSE 3000························· ' Wait A Few Seconds
··· LCDCMD Lcd, 1······················ ' Clear LCD
··· PAUSE 500·························· ' Wait 1/2 Second
· LOOP································· ' Do It Again
· END
I wonder where I've gone wrong? The power supply is a 7.5 volt wall wart from Parallax.
Thanks and Happy New Year!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Long ago, I bought StampWorks. It includes an LCD. I never got that far in the book, having learned enough to begin Stamping. Now, I want to use the 2x16 parallel LCD with my PDB. It sounded simple to me; just plug the attached cable into X2 on the PDB, run some jumpers from P0, P2, P3, P4, P5, P6, and P7 to E, R/W, RS, DB4, DB5, DB6, and DB7, respectively (using the outboard sides of DB4, DB5, DB6, and DB7). Tie P0 to VSS via a 4.7k ohm, and P4, P5, P6, and P7 to VSS via a 10k ohm.
Load the sample code and . . . nothing except a blinking cursor on the left.
After more reading, I found that although the Parallax LCD documentation calls for 10k ohm resistors on the pins mentioned above (p2), StampWorks says to use 220k ohm (p75). So, I switched them out.
Same results.
All the pins on the BS2p40 work fine.
Here is the code I downloaded .·. .
' =========================================================================
'·· File...... Parallel_LCD_2X16.bsp
'·· Purpose... Parallel LCD Display Demo
'·· Author.... Parallax, Inc.
'·· E-mail.... support@parallax.com
'·· {$STAMP BS2p}
'·· {$PBASIC 2.5}
'
[noparse][[/noparse] Program Description ]
' This program demonstrates using a Hitachi-compatible Parallel LCD Display
' This code works with the BS2p24, BS2p40, BS2pe and BS2px24
'
[noparse][[/noparse] I/O Definitions ]
Lcd············ PIN···· 0·············· ' LCD Enable Pin
'
[noparse][[/noparse] Variables ]
temp··········· VAR···· Byte
char··········· VAR···· Byte
'
[noparse][[/noparse] Initialization ]
Init_Lcd:
· PAUSE 1000
· FOR temp = 0 TO 2
··· LCDCMD Lcd, 48····················· ' Reset LCD (Send 3 times)
··· PAUSE 5···························· ' Delay Require By LCD Specs
· NEXT
· LCDCMD Lcd, 32······················· ' Set 4-bit Mode
· LCDCMD Lcd, 40······················· ' Set 2-line Mode
· LCDCMD Lcd, 12······················· ' Turn On Display With No Cursor
· LCDCMD Lcd, 6························ ' Set To Auto-Increment Cursor
· LCDCMD Lcd, 1························ ' Clear Display
'
[noparse][[/noparse] Main Routine ]
Main:
· DO
··· LCDOUT Lcd, 1, [noparse][[/noparse]"Hello, this is"]·· ' Clear LCD & Print Line 1 Text
··· LCDOUT Lcd, 192, [noparse][[/noparse]"the LCD demo."]· ' Move To Line 2 & Print Text
··· PAUSE 3000························· ' Wait A Few Seconds
··· LCDCMD Lcd, 1······················ ' Clear LCD
··· PAUSE 500·························· ' Wait 1/2 Second
· LOOP································· ' Do It Again
· END
I wonder where I've gone wrong? The power supply is a 7.5 volt wall wart from Parallax.
Thanks and Happy New Year!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Comments
My specs show 220 ohm resisters not 220K. And if Your using the Pro.Dev.Board their built in as well as the 4.7K. I've never seen such a sort code for the parallel LCD either. The codes I have are a lot longer.
I got all balled up a fews years ago using the BS2p40 on the Pro.Dev.Board. as the pin # very after a certain count,But I think pins 0 - 7 are OK.
I'll dig up the demo code I have and attach it to this post.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
Post Edited ($WMc%) : 1/1/2010 12:11:09 AM GMT
The "k" was caused by dumb fingers: I really used 220 ohm resistors.
I will try your code tomorrow. Thank you very much for posting it!
Happy New Year!
--Bill
ps Where is that Parallax WiFi module? What's wrong with these guys? Taking the holidays off, OR WHAT? [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Your code and the BS2p40 I used gave me the same dismal results. In desperation, I swapped the BS2p40 for a BS2px24 and your code worked fine, as did other code. Next, I broke out a new BS2p40 and it worked fine, also.
Although the original BS2p40 will blink LEDs on all pins, there must be something wrong with it. (Now and then, I also get a "hardware communications error" with it, as well.) This is sad! But, that particular BS2p40 served as the brains of both Ugly Buster and RC Buster, which were my two multi-processor, bit-signalling robots. That BS2p40 was certainly abused as I learned how to make one Stamp talk to another via connecting pins.
It lived long and served·well under adverse conditions!
I'll mark it as defective, but will keep it because it still KINDA works. (Maybe if I don't look at it for a long, long, long time it will come back to health! [noparse]:)[/noparse] )
I really appreciate your help. In reality, your help is what spurred me to try other things, starting with your code.
Now, I will go back to my original goal of trying to get one of Robert Doerr's most-excellent SX48 modules to work with PING and display results on the LCD. One of his modules is the brains on my latest machine, which will have a PING personality.
Happy New Year!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
I have had similar results with and old BS2 I've downloaded and downloaded so many times, I wonder if its the EEPROM we're wearing out?
ps I was really hoping to see a WiFi device in the new product lineup at parallax for 2010. Since Santa didn't bring it,May be the Easter Bunny will.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA