I2C on LCD and Picaxe

JPU

Senior Member
Hi All

Is it possible to use a 14M2 to control output to a LCD screen with I2C interface. This is the LCD being considered

If so, please can you direct me to any resources that may be available so I can understand the easiest way to get some basic alpha numeric text output to the LCD from a 14M2.

Thank you for your help.

JPU
 

inglewoodpete

Senior Member
A 14M2 can certainly use its i2c interface to control external devices. I have used i2c extensively but never on an alphanumeric LCD. There are threads on the trials and tribulations of several forum members to be found here. Designing the software from scratch is not the simplest task around but you can reap the rewards from the pain of others who have gone before you!

I had a look at the Farnell/Element14 website and neither the webpage nor document appear to show the i2c address of the Midas device (that I can see). Edit: I found the address on an A****** forum. They use an i2c address of 78h, which translates to $F0 for PICAXE hosts.
 
Last edited:

JPU

Senior Member
Thank you both for you help with this. I am waiting for the midas LCDs to arrive and will Attempt to connect the pic and the boards.

Please can someone let me know what the purpose of an
"EXPANDER FOR I2C BUS" is?

I have seen it mentioned many times when reading about connecting some pics with LCDs and don't quite understand what it does. Is it not possible to connect the Picaxe directly to the LCD via the I2c port?
 

Aries

New Member
Is it not possible to connect the Picaxe directly to the LCD via the I2c port?
Yes it is. The expander creates a (normally 8-bit) set of parallel ports (think of B0-B7 on a Picaxe) which the PIC drives with I2C, but the destination sees as parallel ports. Useful where your LCD does not have I2C capability.
 

AllyCat

Senior Member
Hi,
Please can someone let me know what the purpose of an
"EXPANDER FOR I2C BUS" is?
IF the display has a "Serial" interface, such as I2C, RS232 or SPI, etc. then an expander is not required.

BUT many displays have a "Parallel" interface, with separate pins/connections, typically for 8 Data lines (to define an ASCII character byte for example), a "Clock" or Strobe pulse, "Enable" or Command mode, Read/Write and perhaps a Backlight on/off. The most popular I2C expander has (only) 8 parallel interface pins, so a typical arrangement allocates 4 pins for "Control" (e.g. Strobe, Command, R/W and Backlight) and then writes the data as two separate "nibbles" of 4 bits, i.e. D4 - D7 and D0 - D3 in sequence. That's why they are considered rather more "difficult" to use than a simple serial display.

Cheers, Alan.
 

JPU

Senior Member
Hi Alan

Thanks for you help.

We have had a look at trying to connect a Picaxe to a LCD we have here and it has an I2C port. So far we havent been able to get anything to display and I can not find much information relating to it all. What I have seen was a long list of code that was needed to display even a simple "hello world" text string, and everything else I have found on line relates to Arduino and using expanders so not much help there . Am I right in thinking we will have to create some sort of library to output text to the I2C Midas display when using a PICAXE, or am I over complicating this? I have tried to search the Forum but the forum search engine doesn't like my search string of "I2C LED".

If anyone has a link to a thread that deals with this, then I would be grateful for a pointer.

Thank you and as always, any help is very much appreciated.

JPU
 

lbenson

Senior Member
Picaxe to the typical "I2C IIC arduino" LCD modules is non-trivial, because you have to write commands and data as 4-bit "nybbles"--but it has been done many times. Searching for terms of fewer than 4 characters on the picaxe forum can be done with a google search like this:

Code:
i2c lcd site:picaxeforum.co.uk
In this thread, post 28, hippy has some code for a 4x20 i2c LCD:
 

AllyCat

Senior Member
Hi,

Most of the required information appears to be in the manufacturer's .PDF linked by Aries in #3. First you need the I2C Slave address which I did see somewhere in the data, but inglewoodpete has quoted it above as $F0 (full 8-bit address for PICaxe).

Most displays need to be "initialised", but the commands listed on page 17 of the .PDF look very similar to the "normal" parallel interfaces. The PICaxe AXE 133 and 134 products use a parallel LCD or OLED display with a resident 18M2 to convert from RS232 (serial) to the required parallel data. The firmware used in the AXE133 / 4 is available on their product pages, so take a look at that. The initialisation sequence is shown towards the end of the firmware and you may not need to change it much except replacing commands like let pinsB = %00001100 with a corresponding hi2cout, register,(%00001100) , after the bus has been set up with a suitable hi2csetup hi2cmaster , $F0 , ..... command.

Details of using the Midas display in I2C mode appear to start at about page 29 in the .PDF.

Cheers, Alan.
 
Last edited:

eDev

New Member
...We have had a look at trying to connect a Picaxe to a LCD we have here and it has an I2C port. So far we havent been able to get anything to display and I can not find much information relating to it all...
Hi, JPU:

I had a similar experience, so I posted my version of a "how to" which deals with an inexpensive LCD using i2c (PCF8475A/HD44780) interfaced to an 18M2 chip. The thread describes the project and the uploaded program is self-documenting.

Hope it helps!

URL: https://picaxeforum.co.uk/threads/picaxe-18m2-i2c-to-pcf8475a-hd44780-based-2x16-lcd-project.31249/

eDev
 
Last edited:
Top