Juan Esteban Paz
Published © CC BY

I2C LCD PSoC4

Running short on pins? Don't waste pins, work with a I2C LCD instead.

BeginnerProtip12 minutes2,125
I2C LCD PSoC4

Things used in this project

Hardware components

PSoC 4 Pioneer Kit
Cypress PSoC 4 Pioneer Kit
×1
PSoC 4 Prototyping Kit
Cypress PSoC 4 Prototyping Kit
×1
I2C LCD Serial Display 4x20 characters
There are some other alternatives for color and sizes
×1

Software apps and online services

PSoC Creator
Cypress PSoC Creator

Story

Read more

Schematics

I2CLCDExample

depending on your i2c lcd driver you would need to set up the custom characters, in this case I needed to do it, then verify the network address of the LCD (in this case it is 0x50) then just use the commands

LCD Datasheet

Code

LCD I2C basic commands

C/C++
#include <device.h>

int main(void)
{
    CyGlobalIntEnable;
    I2C_Start();
    I2C_LCD_Start();
    I2C_LCD_SetContrast(50);
    CyDelay(1000u);   
    I2C_LCD_Position(0u, 19u);
    I2C_LCD_PrintString("s");
    I2C_LCD_Position(0u, 0u);
    I2C_LCD_PrintString("a");
    I2C_LCD_WriteControl(I2C_LCD_CURSOR_WINK);
    
    
    I2C_LCD_Position(1u, 0u);
    I2C_LCD_PrintString("Cypress PSOC 4");
    I2C_LCD_Position(2u, 2u);
    I2C_LCD_PrintString("CYPRESS Demo");
    I2C_LCD_WriteControl(I2C_LCD_CURSOR_WINK);    
    I2C_LCD_Position(3u, 10u);
    I2C_LCD_PutChar('$');    
    
}

Credits

Juan Esteban Paz

Juan Esteban Paz

12 projects • 22 followers
Mechanical and Electrical Engineer enjoy working with PSOC

Comments