Parallel Display (Hitachi) HD44780U...standard
![hmlittle59](https://forums.parallax.com/uploads/userpics/199/nCR6ABWFQF1HY.jpg)
in BASIC Stamp
Hello All,
I currently have an OEM of my own working with the PBASIC48W/P40 Chip...YA KOOL...with the Parallax SERIAL LCD Backlit Screen. After talking to Tech Support at Parallax, they informed me that this MC's commands will support the Parallel Display...OVER THE TOP YA KOOL....
Some time has passed and now I'm ready to design in the Hitachi Display and the Commands seem to be limited. I need some help understanding all that I can do and most of all that I CAN NOT do from the Command set. Yes I read it, but still confused. I THINK, that all my previous Commands from my SERIAL routines are there EXCEPT ((LcdBLon $11 & LcdBLOFF $12), Back light ON and Back Light OFF). PLEASE tell me its just my over site or lack of understanding on how to use the Commands.
I was gonna add a Shift Reg. 74LS145 because I was still three (3) I/O pins short, but now after reading the .PDF it seems I only need max. 7 pins to make it work. That will in turn leave me with 4 pins free, but now if those Commands are not BUILT in some way, I may have to do it in Hardware from an I/O pin to the Parallel Display (looks like pins 15 or 16) not quite sure yet.
Anyway, please if any one knows for sure, point out the Commands, Thanks.
1) turning the "PARALLEL" Back light ON & OFF from the PBASIC48W/P40 Chip Command set.
Thanks again for any help
Howard
I currently have an OEM of my own working with the PBASIC48W/P40 Chip...YA KOOL...with the Parallax SERIAL LCD Backlit Screen. After talking to Tech Support at Parallax, they informed me that this MC's commands will support the Parallel Display...OVER THE TOP YA KOOL....
Some time has passed and now I'm ready to design in the Hitachi Display and the Commands seem to be limited. I need some help understanding all that I can do and most of all that I CAN NOT do from the Command set. Yes I read it, but still confused. I THINK, that all my previous Commands from my SERIAL routines are there EXCEPT ((LcdBLon $11 & LcdBLOFF $12), Back light ON and Back Light OFF). PLEASE tell me its just my over site or lack of understanding on how to use the Commands.
I was gonna add a Shift Reg. 74LS145 because I was still three (3) I/O pins short, but now after reading the .PDF it seems I only need max. 7 pins to make it work. That will in turn leave me with 4 pins free, but now if those Commands are not BUILT in some way, I may have to do it in Hardware from an I/O pin to the Parallel Display (looks like pins 15 or 16) not quite sure yet.
Anyway, please if any one knows for sure, point out the Commands, Thanks.
1) turning the "PARALLEL" Back light ON & OFF from the PBASIC48W/P40 Chip Command set.
Thanks again for any help
Howard
Comments
The Serial LCD has a controller on it which executes the commands and controls the display as well as the backlight. By using a parallel display you're controlling the display directly, but there is no built-in facility for backlight control. The way I used to do it is to have an I/O pin turn a transistor on/off which controls the voltage to the backlight. In that manner simply making a pin high/low turns the backlight on/off. I hope this helps.
That's what my other approach was going to be if it was not built in. Hardware on my controller. Which Pin 15 or 16? Looking at the Data Sheet of the Display Pin 15 = + 5 v and Pin 16 = 0 v. I'm confused, my thought is pin 15 +5 v backlite is constantly on; now if i send 5 v (I/O) pin high, to a NPN, i will have a drop across the transistor (0.7), now I will have about 4.2, is that enough for a Backlite? Also, I'm still trying to understand if I need a total of 7 I/O pins + power and ground or 7 pins total to operate the LCD. I've up dated my previous CAD that used the Serial LCD and added a 1 X 8 header. After studying your .PDF, I think that I need a 1 X 9 header slot, 2 pins for power and ground.
This is a general question. Can the Backlite be turned on, without power to pin 2?
1) Which pin turns On Backlite with 5 v applied and removed? looks like pin 15
2) Will the I/O pin and/or 5 v Backlite supply off the NPN need any resistors (current limiting). 220 ohms/ 10 k
3) How many I/O pins to operate? NOT counting the Backlite, I know that will be separate.
4) Can the Backlite (alone) be turned on and off (flash) without power to pin 2?
5) What rating of the transistor will I need. (will it be higher because of it being a display?)
6) What is the minimum header pin will I need? 1 X 7, 1 X 9 or 1 X 10? My calculation is 1 X 10 (7 Data, 2 pwer, 1 Bkl)
I don't want to do to many spins before I get the PCB correct.($$$$)
Thanks for your time and quick reponse
Howard
To answer your questions according to the most popular panels I have:
1: Apply 5 volts to pin 15, ground to pin 16. But check your own to make sure that BL+ goes to the "A" connector on the backlight and BL- goes to the "K" connector.
2: Usually the LCD panel will have a limiting resistor or two near the backlight connector at the end of the display. Your LCD Panel datasheet should provide the current and voltage required.
3: If operating in parallel and 8 bit data bus you will need 13 or 14 connections to operate the LCD. 8 data, 2 or 3 control (RS, RW, and E), and 3 power (+5, Gnd, and contrast). If you are not going to read from the LCD you can tie RW to ground.
4: The backlight is an independent circuit, does not require the LCD itself to be powered. (Some LCD panels tie the backlight ground to the LCD panel ground plane forcing you to switch the 5V only)
5: You can usually use most any general purpose transistor, or a suitable MOSFET if excessive voltage drop is a concern.
6: All my LCD panels have a 16 pin header (see # 3) which includes the backlight. They are either 1x16 or 2x8.
Thanks for the reply. I'm printing out your answer, because I was relaying out the Serial version that will use this Display and just switched over and saw your reply. My understanding is the Chip uses 4 bit, I will double check.
Had to move the Piezo from the middle of the Chip to the beginning to get the Header (16) to fit and now the other 22 pins have to shift one (1), OUCH. Will come back for trace shifting and go over your answer to the data sheet. Feeling a lot better about it now, thanks. Still have a lot of cramming / rearranging to do for this to fit in same space. I'm sure I will have more questions.
Thanks again
Howard
D4, D5, D6, and D7 along with the control lines. I just realized you are using the interpreter chip from the BS2P40. The built in LCD commands should make operating the LCD a breeze. Otherwise, if you had to program it yourself it can be a real PIA.
Just came back to the computer and saw your reply, thanks for that insight. Been walking around with a printout today trying to figure out the new layout. Will spend another hour now to see if it will works.
Thanks again
Howard
Using an NPN transistor to switch the K (BL-) pin on the LCD to ground should work just fine. Some of the displays I have used have a current-limiting resistor, but most Parallel displays I have used do not. So check the datasheet to see if you need one in the BL circuit. Essentially the BL circuit will work completely independent of the rest of the display and would be set up much like an LED (assuming it is LED backlit).
Just got cleared up and confused!
1) The BL operates independently of the Display..CLEAR
2) Operates like an LED....CLEAR
3) Limiting Resistor on LCD Screens may or may not be in place (Can add to my design..???ohms or 0 ohms)...CLEAR
NOT CLEAR
1) Not clear on how to operate (A or K) from I/O pin(s)?
a. Data Sheet: Is this on first power up with no connection on it (5 v and 0 v correct)?
b. Is the Backlite ON or OFF?
c. If I take a I/O pin high (5 v) through 220 ohms to NPN, which switches K to Gnd, what happens to A?
d. Do I have to do anything with A (before or after) Grounding K?
e. Looks like I can use a certain 24 pin MC Module (BS2p,pe,px) to test this out with my BOE correct?
f. Per. Stamp Manual 2.2, LCD pins (5), 7-10 can be connected to ground... not using LCDIN?
g. If Contrast is not used, can it float or connect to 5 v?
h. Although it's a Max. of 7 pins to write, is it correct to say, all pins must be tied off?
Already have Displays, 1 x 16 headers and ribbon cable and BOE, will need 1 x 16 mass term connectors and MC.
getting more comfortable as I study text and help from you and Hal
After these question I will be able to finish my PCB layout.
Thanks again.
Howard
A sure way to see if your panel has a backlight resistor would be to use an Ohmmeter and measure from pin 15 to A, 0 or near 0 means no resistor to the Anode. Then measure pin 16 to K, again 0 or near 0 means no resistor. The panels I have use an SMD resistor labeled 680 or 68 Ohms between pin 15 and A. This resistor could just as well be from pin 16 to K.
NOTE: You should not connect directly to A or K, use pins 15 and 16.
a. Not sure what you are referring to, the LCD or the backlight...
b. With no connections to the backlight it will be off. Remember, the LCD circuit and the back light circuit are completely independent of each other.
c. If properly connected, nothing happens to A. It should be connected to +5, possibly through a onboard resistor. The transistor collector should be connected to K (through a current limiting resistor of around 220 Ohms if there are no onboard resistors. The base resistor should be much higher.
d. If you are using a transistor to switch ground to K through a resistor, A should be connected directly to +5. Again, make all connections to the backlight to pins 15 and 16, not directly to A or K
e. Yes
f. An LCD module using HD4470 driver has weak pull down on all signal pins except E. You can connect the unused pins to ground or just not connect them.
g. Do not let contrast float, you probably won't see anything. Many LCD panels will show maximum contrast with this pin at 0 Volts.
h. see f.
Yet one more question.
While learning with the Serial LCD, there were spots through out my 7 slot code that I left off (PAUSE's) before and after screen prints and I had to monitor lots of (BUTTON) commands and other internal code monitor. This eventually caused Screen flicker or Screen lag. Looked bad at times. I finally caught all my problems and optimized my code. Now almost real time key response...No lag or flicker with either the BS2 or the BS2e and NOT interrupt driven, GREAT.
I want to plan ahead for that with this display. I want know which Bank should I wire the Display to and I should never never ever consider splitting between Banks or don't use Bank 2 if you need to CONSTANTLY update the LCD. I went back and checked and I use 7 of the 8 RAM SLOTS for code but I only up date from 4. Will the BS2 40 pin be more then fast enough to bounce between Banks and refresh without flicker.
** Will it be, if it works smooth now there should be no reason it will be any different with this display.
The current code for the BS2 40 is working but not optimized and needs more of the User friendly (STUFF) added to it and I'm really concerned of any lag or flicker.
I monitor 8 switches and DS1302 and all current calculations appear to be less then 1 second.
1) Is there a preferred Bank to connect to?
2) Will LCD Commands work between Main Bank and AUX Bank without any set up?
Thanks again....
Howard
Got a pop up that you were on line. Thanks for the response. Will read through now, just made a post.
Thanks
Howard
Using various Banks for different program functions requires additional programming overhead unless your application doesn't mind starting over from the beginning each time you switch to another bank. There is no automatic going back to where you left off when switching. There were some Nuts & Volts articles on how to implement a return to where you switched from but I'm not sure where those articles are now.
Those answers you just gave were GREAT. That's what I was looking for. As the saying goes. I didn't know what I didn't know.
I'm gonna start over and make sure I didn't miss anything.
I do write in new data in their designated area and that did clear most flicker. I have 3 versions of my program and 1 is BS2 and the other is BS2e and the 40 pin also. The last 2 are in 7 Slots and with the rewrite, I already planned it rolling over to slot 8. I've figured out how to remember were I came from, so that works great with the Serial LCD. I'm just trying to plan ahead for the Parallel LCD and want to avoid any bad layouts that cause down the road problems or not being able to write directly to the Screen from the AUX Bank (such as: Save Values, move back to Bank 1 or were the screen is wired).
Will buy a MC Module and do a setup to test some code.
Thanks
Howard
PS: got to go do some running around for now... Thanks
I think this is the one you speak of.
Latest update. I got one of my Displays out and I can see the 15/A and 16/K locations and what you were talking about. My Display is a single row (1 x 16) and pin 15 goes through a 100 ohm resistor. I have the single row male connectors and ribbon cable but can not find any single row mass terminated female ribbon cable connectors online to purchase. If anyone knows were to purchase this part let me know please. I've tried all the regular places. (mouser,digikey,ebay)(1 x 16) press on mass terminated connector.
Stuck on the relay out of the PCB. I want to keep the display and switch board, along with other key checks in Bank 1, for a smoother program response. May have to move the DS1302 to Bank 2 and that will lengthen my trace connection which I've always avoided on all my previous layout. Will have to think this out some more.
Cable appears to be the bigger problem for now. Oh, do I ground pin 3, still not clear?
Thanks for all the help
Howard
As far as just grounding pin 3 (contrast) you might be better off using a 10K pot which will give some contrast adjustment. It really depends on the LCD display itself. Some will work just fine with 0 volts while others will show increased background at each character position, resulting in dark characters inside grey boxes. Wire the pot ends to +5 and ground and the wiper to pin 3. BTW, all those Chinese LCD displays on eBay with "serial" interfaces include the 10K pot for contrast.
I used about 10 of Parallax's Serial Displays and have yet needed to adjust the Contrast. May try and find a happy medium resistor value and fix it on the PCB. Will be part of my testing process when I get the MC in.
I've only bought Serial Displays from Parallax and the Parallel one's may have come from ebay, don't remember. Eight (8) of the 10 are still in their original packing. (china marking)
Thanks
added smt pot to pcb
Howard
Found some 1 x 16 connectors and/or cables...None in the US of course, all from overseas supplier's with min. order. Have laid out the PCB with the 1 x 16 and switching Transistor. Will do another with the 2 x 8 and then figure out which will work the best.
You might also want to check out moderendevice.com, they sell a serial LCD interface, LCD117 SMD, with a PIC onboard that really, really makes it easy to connect to an LCD with a single signal wire ( and 2 power). It has both 1x16 and 2x8 connectors to connect to the LCD and takes care of initializing and sending data to the LCD. It also gives you PWM control for the backlight via software.
Thanks Chris for helping me on the phone at Parallax Tech. Support. My head was really swirling about the Parallel Display. It took about another hour before the light bulb came on about the switching of the AUXI I/O pins. Its been about three years since I did any programming with it and that was only 2 LED's ON or OFF and 1 PZO. One thing that I'm still not sure of, can the Parallel Display be connected to the AUX Pins or does it have to be to the MAIN I/O? You may have said, but like I said my head was swirling (still is).
Also, MUCH MUCH thanks to Hal for breaking down how it's laid out, that has really reduced my learning curve. I laid it out and then stepped away for 2 days (family stuff) and came back an caught some errors and added the Contrast circuit. Had to move the 1 x 16 to the middle of the PCB and that took, lots of re-arranging. This is all a big learning curve for me. I'm coming off AUX I/O Pin 1 and now I'm not sure if I can do that, it may have to be the MAIN I/O pins. Could not find a clear answer with the online .PDF page (249), may have just missed it.
Also, I added a Temporary connection for the Serial LCD...that I know how to connect. (easy hook up for now)
Questions:
1) Can the Parallel Display operate from the AUX I/O Pins on the PBASIC48W/P40? Please Please Please say "YES", PCB already laid out
2) I'm actually starting from Pin 1, will there be any known problems with this setup? (temporary)
3) The Chip should be able to drive BOTH (Serial and Parallel) Displays? (I may have to bump VR1 to 2 amp)
Thanks again
2) You can use P0 or P1 as the starting pin, however all 8 I/O from that group are consumed for the display. You cannot use P0 for something else even though you started at P1.
3) Yes. The displays only consume a lot of current if they have a backlight on.
1) Great Great Great
2) Darn.....Will have to move that 3 pin header back to the middle of the PCB... Easy Fix.
3) Great Great Great...
Thanks for the reply.
One more question about the Input Communication Circuit. This is PCB 4 of a (family) of 5 or 6 PCB's that I'm doing. My first spin of this (48 Pin) PCB 3,4,5 years ago worked, right out the shoot. (Great) The second spin did not. (DOA) Never could get it up and running and by the time I got done trying to jump start it, I just gave up and went back working on the original PCB's (1 - 3). Now that I'm back on the (48 pin version), is there a certain amount of the (SMT) circuitry that I can install (myself) to be confident that my layout is working? I NOT gonna try and do the 48 pin Chip myself (those days are long pass), but I would like to be able to test the front end before I have the 48 Pin Chip installed. I think on the BS2e DIP version, the Editor reported back that my EEPROM was missing, and I think that I had the wrong part or bent pin (something). If the Loop Back is missing, I know the software will halt also.
I'm trying to do a systematic approach to this design.
ex: Input Caps (2), Dual NPN, Single PNP, Quad Res. , EEPROM, that may give some kind of standard error.(these parts I can do)
went back an added the 10k's to LCD pins 7 - 10.
Thanks again for the feedback and any insight on this issue.
Well I got my PBASIC 48/40 pin OEM PCB in and 3 jumper wires ,2 trace cuts and 3 parts that did not match up later, the PCB is up and running. Old software (6 RAM Slots) being converted over using the Parallax Serial Video Connection that I kept as an after thought and may keep (2 Displays) is up and limping along. Fixing and upgrading old code. Current software (Slot 4) has a lot of code so its been tough trying to re-arrange code with 2 displays, will have to split the code and bounce back to the correct location. Seems to work in my "HEAD", now lets see if I can get it to actually function. We well see if I can make it work. Any way.
Help:
The Parallel Display did run up the 1st time...YAAAA!!! (Back Light, Contrast,1st line of text). Some Commands were in Dec. instead of Hex. and the second line would not show. Took about 45 min. before I spotted the OOPs in the Constants setup. Now on to the Display itself. I hate it. Does not look good (gray on blue) ( probably should be WHITE on BLUE) and I can adjust the contrast but does not seem to help. It just seems to dim over all. Took a picture but it turned out better then what the actual viewing really looks like.
1) Serial display looks the same when on my other OEM boards. (GOOD)
2) Parallel Display looks very dim.
3) Contrast (10 K) appears to be working
4) Backlight works thru a 220 Ohm on I/O pin to PNP base with 10k ohm on a Collector to gnd.
Have more displays to add connector and test out.
any thoughts thanks
I'm not clear on what you're looking for feedback on. Did you have some specific questions? The only thing that stood out at me was the dim parallel display. I once had some displays that were like that even though I hooked them up exactly as the previous ones. It turns out that they were designed to use a negative voltage for the contrast pin and I hadn't noticed that when I ordered them. Not sure if that's the issue here, but I thought I would mention it.
Just got back in.
Yes, my current problem is that the Display is to (DIM). I was kind of hoping that you knew of some ONE (1) resistor (on most displays) that would effect the Dim video other then the contrast resistor. I will build up another one and test it out, but the view quality is nothing like what I expected. All of the (7) Serial Displays that I've ever used from Parallax have been great viewing quality from any angle. May have to try and find some newer Parallel displays with Black on Yellow and a Data sheet. Bought these some years ago from overseas for cheap ($3 or 4) apiece and I can not find a Data sheet or anything on the boards about negative voltage.
Thanks for the feedback
PS: Managing two (2) Displays will be trick...OH well, on wards and up wards.