How drive LCD with I2C?

100317

New Member
To save output pins on my Picaxe's, I consider to drive LC Displays with I2C. Has anyone done this in the past? Is there a schematic and/or program sample?

Thanks.
 

wllshaw

Member
Check out the following link http://www.rev-ed.co.uk/docs/axe033.pdf
If that doesn't work then at the top of this page go to Datasheets then click on all picaxe data sheets. From the list that appears click on axe033 and download it. It will only take a few minutes. Read the whole sheet, it is pretty good. On pages 6 and 7 in section 2 it describes how to use the i2c mode.
Will
 

100317

New Member
HD44780 and compatible

Hi Will,
It was my mistake. I want to drive HD44780* and compatible LCD's, and not the axe033.

I have a couple laying around.

Thank's for your suggestions.

Hans
 

westaust55

Moderator
Hans,

when you say that you want to save pins. . . . . can you be more specific . . .

Do you already have an LDC dispay?
Are you already using it?
If so, how are you driving/writing to it? Parallel or Serial?

If say you have a PICAXE 18X and the LCD will be the only i2c device then the i2c will use 2 of the 8 available outputs.

By comparison, a serial interface only needs one output.

So if you are going to add other i2c devices like EEPROM, DS18B20 temp sensor, DS1397 real time clock etc later then the i2C comms method will ultimately save pins.

The AXE033 can include a RTC which needs i2C to read the time into the PICAXE. The AXE033 can also be written to for LCD purposes in serial comms mode.

If you already have a parallel type 2 line LCD display and dont want to buy another AND you have electronics assembly experience, then Revolution/PICAXE have an IC called the FRM010 which can be used to give a serial input to a 1 or 2 line LCD display.

The datasheet is not amongst the main collection of PICAXE datsheets but I have attached it here.

EDIT: okay saw you second post added while I was typing this. Rules out AXE033 but the FRM010 may still be useful
 

Attachments

Last edited:

100317

New Member
Hi westaust55,

I have some experience with I2C and I want to use EEprom, RTC, and some other useful I2C devices. I have electronic experience, so I want to build a PCB for my own use. The FRM010 sounds good, but I have different LCD modules (1,2 and 4 lines) so I consider to use PCF8587 devices.
The PCF8574 is a multifunctional chip and I used it in one Project.

Thanks for your suggestions.
Hans

P.S. I mostly use 28X* and 40X* devices.
 

beny1949

Senior Member
Hans,

The way I see it you will still need to have 5 pins which will be the 4 data lines (using nibble mode) and the W/R pin.


Then for each of the displays you simply use a different pin connected to the E pin (pin 6 on most LCD's), so you would effectively choose which LCD you are sending a command to by pulsing the appropriate pin on the PICAXE.


This method will always require at least 6 outputs then one more for each display. This may not be what you are looking for, but if you already have some displays its the cheapest way to go.

you could also try other forms of multiplexing with a shift register, which could enable you to use 3 pins total.

Ben
 

100317

New Member
Ben,

I know this technique, but i need the output pins for relays and motors and the I/O pins for sensors. The cheapest way for me is, to use I2C.

Many Thanks.

Hans
 

beny1949

Senior Member
Right i see, sorry about that.

Well there are a few i2c io expanders you could use, although from a quick look it seems that you will be pushed to get anything in PDIP...

something like the PCF8574 looks good.

Ben
 

100317

New Member
Tarzan,

excellent, but it pains me, to use a 28X1 as slave for a LCD (I am very sparingly and stingy).
I am always searching for a simple and low cost solution.

If there is no other solution, I must sacrifice one.

Do you have a drawing, how to connect a Hd44780 or compatible LCD to the 28X1?

Thanks.

Hans
 

westaust55

Moderator
Schematic for PICAXE parallel driven LCD

As an extension of what Tarzan mentioned.

See the attached modified and corrected schematic.

Depending upon exactly which PICAXE you use the pins are (straight from PICAXE manual 1 page 6) as follows:

PICAXE PIN/LEG No
OUTPUT 18X____20M____28X
0 =_____6______18______21
1 =_____7______17______22
2 =_____8______16______23
3 =_____9______15______24
4 =____10______14______25
5 =____11______13______26
6 =____12______12______27
7 =____13______11______28


A slave PICAXE could also handle other functions as well in the future.
But if an LCD is all you want then the links given by lxnederlandx are very good.
 

Attachments

Last edited:

100317

New Member
Hi, Thank you all for your quick and useful informations.

Now I have to reflect, which solution I use in the future.

Thanks.
 

peter howarth

New Member
To save output pins on my Picaxe's, I consider to drive LC Displays with I2C. Has anyone done this in the past? Is there a schematic and/or program sample?

Thanks.
its not really about saving output pins, and it doesnt matter about which picaxe to use, i am just looking for a picaxe circuit, no matter which device works, that i can connect to any very common off the shelf 16 x 2 , or 20 x 4 character lcd module, and once i can get a message displayed, then i can refine the code that shows different messages for different input events.. much rather use parallel then serial interface, despite more pins required.
 

lbenson

Senior Member
i am just looking for a picaxe circuit
What about the answers in this thread you started yesterday did you find unsatisfactory?
 

westaust55

Moderator
its not really about saving output pins, and it doesnt matter about which picaxe to use, i am just looking for a picaxe circuit, no matter which device works, that i can connect to.....
As lbenson suggests/asks did you not obtain a suitable answer to you own thread?

Here you are making a statement without a specific question to a 12 year old thread.

If you were expecting input/response from those who had posted here then I suggest that is unlikely - a check shows most have not been active since 2008/2010/2011 so around 10 years ago.

I suggest it is far better to ask your further questions In the thread you have started yourself rather than append to old threads.

Hoping you do receive the clarification you seek.
 
Top