PDA

View Full Version : how? 2 wire lcd with pbp?



nimonia
- 14th May 2005, 09:30
is it possible to use shiftout with 2 wire lcd configuration? or do we have to shift the datas and strobe the data and clock pins manually

mister_e
- 14th May 2005, 12:16
i'm not sure of your of your actual LCD but more than often they use simple serial communication @2400/4800/9600 bauds. Use Hserout or Serout statement.

P.S.: for all your future post, please include more details.. part #, web link, provider or any info you have. That help us to give you the right answer.

nimonia
- 15th May 2005, 05:35
thnx for replying mister e. sorry for the lack of information... wat i eamnt was a 2 wire lcd using a using a shift register 74ls174 wic uses a datapin and a clockpin... http://www.rentron.com/Myke1.htm i think predko did it. i've seen melanie showing a same example too but wondering if someone could show me is it possible to use shiftout with this circuit and sending a LCDOUT string.

Acetronics2
- 15th May 2005, 08:26
HI,

Another solution is using an I2C device like the PCF 8574 ...that allows bus sharing.

Alain

Luciano
- 15th May 2005, 09:18
I think the questions are:

Can I redirect the output of the PicBasic LCDOUT command to my 2-Wire LCD Interface?
(I am using an LCD module with a Hitachi 44780 controller or equivalent).

Would I have to write my own LCD routines in order to use my 2-Wire LCD Interface?
(I am using an LCD module with a Hitachi 44780 controller or equivalent).

Luciano

Melanie
- 15th May 2005, 10:47
I do recall posting this a couple of years back... you will have to use SHIFTOUT or similar commands to drive it.

darkman
- 16th May 2005, 17:29
@Melanie please update here an example code for your circuit
thanks..

Melanie
- 18th May 2005, 16:56
Aw, c'mon... build it and try it... if I told you all the answers it takes all the fun out of playing... pretty obvious if you did a truth-table for the configuration of the 74LS174.

Dwayne
- 18th May 2005, 17:15
Hello Melanie,

Melanie>>if I told you all the answers it takes all the fun out of playing...<<

You have touched on a very important point. How is one to learn, if they don't play a little? Get their feet wet? At least TRY to some degree.

I have been wondering if college students bring their assignments here the day before they are due, and ask for the answers...yet has no code to show for their own... OH well...

Take care... Keep up the great work.

Dwayne

Melanie
- 18th May 2005, 19:18
>> I have been wondering if college students bring their assignments here...

Now you've hit it... either that or somewhere out in the world is a money-spinning application for dimming three LED's that I can't figure...

nimonia
- 19th May 2005, 05:28
referring to myke's page at rentron.com... we haf to shift out 6 bits... bit 6 is a dont care i guess. while bit 5 is the rs bit and the bottom four are the data bits.. havent tried shifting out yet coz searching for my 74ls174 wic i misplaced somewer... once tested and running i'll post it..

darkman
- 19th May 2005, 08:53
I'm delete my account in this forum because not support
I'm not use now pic basic pro I'm delete pbp directory in my pc
I'm using now C languege with full support

@mel
please delete my account in this forum thanks...

Melanie
- 19th May 2005, 09:59
The definition of "Support" is where there is a problem with the product that needs addressing. I think everyone will agree that this forum goes way beyond that... Ultimately, people need to be nudged into thinking for themselves (even if it is as simple as reading the Datasheet, or Manual, or Searching the Forum or MeLabs Archives) - because always asking for an answer and expecting it to be handed to you "ready-packaged, debugged and royalty-free" on a plate is not the way to learn. This will apply to whatever compiler you chose to use.

nimonia
- 20th May 2005, 04:29
darkman stop being a loser... anyway for the rest who are viewing i've tried and its impossible with shiftout.. referring to myke's site on the 2 wire lcd the way the datapin and clockpin toggles are different frm ****out? anyway i've tried the shiftout command and doesnt work... tried manual subroutines still aint working... any clues melanie? u dnt haf to giv the answer just clues...

Melanie
- 20th May 2005, 09:01
I assume you successfully initialised your LCD to work in 4-bit mode before throwing data at it?

nimonia
- 20th May 2005, 10:04
do i haf to always shift out 6 "0"s b4 sending every instruction set? how long do i ahf to pause b4 sending the next instruction?

Luciano
- 20th May 2005, 10:21
Hi,

What about I2C?

* * *

Nuts & Volts Column #109 May 2004 by Jon Williams:

Easy IO – Easy LCD Terminal
(I2C to LCD + Pushbuttons).

http://www.parallax.com/dl/docs/cols/nv/vol5/col/nv109.pdf
http://www.parallax.com/dl/docs/cols/nv/vol5/code/nv109.zip

Microchip MCP23016 16-Bit I2C™ I/O Expander
http://ww1.microchip.com/downloads/en/DeviceDoc/20090b.pdf

Luciano

Melanie
- 20th May 2005, 10:42
Actually I just LOVE the MCP23008 from Microchip... you could do it with that too (using LCD 4-bit mode)...

I find that the skinny DIP (16F876/P type) is a nice economic package... but sometimes you just plain run out of I/O's... the 40-pin plastic package (16F877/P) takes up far too much real-estate and additional expense, so adding I/O's with the MCP23008 or 20016 is a very easy and neat solution - and they've got weak pull-up's too! Just perfect for remote Keypad/Display interface applications.

There's a lot of ways you can do LCD down two wires... (the obvious is to put a PIC at the LCD end), but at only a few cents for the package, the 74LS174 method (strictly it's 3-wires if you count Ground) has to be the rock-bottom cheapest.

PS... nimonia... use the same timing as PBP's LCD defines.

Acetronics2
- 21st May 2005, 13:25
Hi, nimonia

Devantech sells a ready to use I2C LCD ...

Here, for example :
http://www.robopolis.com/produit/1567/85/Divers/Afficheur-LCD-a-commande-I2C--serie.php

or Here : http://www.robot-electronics.co.uk/shop/I2C_Serial_Display_LCD022058.htm

sooooooo easy.

Alain

Demon
- 26th September 2005, 01:47
"adding I/O's with the MCP23008 or 20016 is a very easy and neat solution"

Melanie is referring to the MCP23016, in case anyone is trying to find a 20016.

I agree, I'm in love with the MCP23008/16 chip (8 and 16 I/O pins). It's an awesome way to increase I/O pins on older chips like the 16F628 (a good strong and proven workhorse if you ask me).

The 16F877 is better, but at a cost. If you don't need more I/O pins AND extra memory, then it's overkill in a lot of applications.

Robert
:)

sougata
- 26th September 2005, 13:41
Hi,

This is a serial LCD using a PIC. It takes commands in the LCDOUT style, hence is easy to incorporate.

Regards

Sougata

Demon
- 19th October 2005, 20:57
One note to those having problems with these I/O expanders, remember to scroll all the way down the PDF and check out the timing requirements.

MCP23008: top of page 23.

Robert
:)

Demon
- 19th October 2005, 20:59
Sougata,

I checked your attachment and I noticed something odd. The LCD is parallel, it's the communication to the PIC that is serial.

Or am I more confused than I think I am?

Robert
:)

sougata
- 20th October 2005, 07:41
Hi there,

Parallel LCDs are easily available and cheaper (at least here in India). The SELD is a dedicated PIC programmed with PBP that drives a normal parallel LCD. The PIC takes its command via a serial input thus freeing up resources on the main controller.

I personally use a PIC18F452 based circuit that uses interrupt based serial routine handling and gives me the freedom to use buttons and indicators at the same time. A complete user interface module you can say. This reduces wiring in my panel from the main coontroller and leaves the controller more useful for other sensing and control tasks.

Regards

Sougata