PSoC 4 with Character LCD

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello,

   

I am working with psoc 4. I am Interfacing LCD with PSOC 4. I tried with the example project given in Creator. But I am getting error. I am attaching my workspace 

   

anyone can tell me why I am getting error ?

0 Likes
31 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

What is the part number of the display, and a schematic of your

   

connections to power, contrast,ground, PSOC.

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Rename your "LCD_Char_1" to "LCD" and compilation will have less errors.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Of course you know you can replace this -

   

 

   

  LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_0);        /* Puts "C" at 2nd column on first row */
  pos += 2u;

  LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_1);        /* Puts "Y" at 4th column on first row */
  pos += 2u;
       
  LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_2);        /* Puts "P" at 6th column on first row */
  pos += 2u;

  LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_3);        /* Puts "R" at 8th column on first row */
  pos += 2u;    
 
  LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_4);        /* Puts "E" at 10th column on first row */
  pos += 2u;
       
  LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_5);        /* Puts "S" at 12th column on first row */
  pos += 2u;
       
  LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_6);        /* Puts "S" at 14th column on first row */
  pos += 2u;
 

   

with this -

   

 

   

  LCD_Position( row, pos );
  LCD_PrintString(  "Cypress" );                               // Print out string

   

 

   

or -

   

 

   

     strbuff[ 17 ] = "Cypress";                                    // LCD 16 char + 1 for nul character

   

    LCD_Position( row, pos );
    LCD_PrintString(  &strbuff[ 0 ] );                           // Print out string

   

 

   

Regards, Dana.

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is an LCD program that you can use on any pin on the PSOC unlike the original library that has to start at Port 0 and then increase from there.  Such as P1(0) or P2(0) or P3(0). This is an easier part to use if you design has a lot of resources. Also in your LCD component you did not click the User defined setting that would have been necessary in your design. The example I am sending is a bar graph but you can convert it to ASCII characters.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I did not see any attachment in your post

   

 when I write   LCD_start(); function   I am getting 2  Error. I don't understand why I am getting error 

   

 

   

Build error: undefined reference to `LCD_start'

   

Address the error(s) specified in this message and rebuild the project.

   

 

   

 

   

/* ========================================
 *
 * Copyright YOUR COMPANY, THE YEAR
 * All Rights Reserved
 * UNPUBLISHED, LICENSED SOFTWARE.
 *
 * CONFIDENTIAL AND PROPRIETARY INFORMATION
 * WHICH IS THE PROPERTY OF your company.
 *
 * ========================================
*/
#include <project.h>

int main()
{
    LCD_start();
    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    /* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */
    for(;;)
    {
        /* Place your application code here. */
    }
}

/* [] END OF FILE */

   

 

   

look at this two statement

   

    

   

          LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_0);        /* Puts "C" at 2nd column on first row */
  pos += 2u;

 

   

which is column 2nd clumn and  first row ?    

   

    

   

          

   


  LCD_Position(row, pos);
  LCD_PutChar(LCD_CUSTOM_1);        /* Puts "Y" at 4th column on first row */
  pos += 2u;

   

   

    

   

          

   


which is column 4th  clumn and  first row ?

   

   

         

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

This LCD_start( ); should be typed as LCD_Start( );

   

 

   

Regards, Dana

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

From the LCD datasheet -

   

 

   

   

 

   

 

   

Vee is a contrast adjustment, from LCD datasheet -

   

 

   

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Sorry about the down load here it is!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@bobgoar

   

...everyone has got three tries ....  ;-))

   

 

   

Bob

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

I do not know what is wrong with my file attachments I tried yesterday and today and it is not posted.  I am going to move the fike to another computer and try it again.

0 Likes
Anonymous
Not applicable

 What happen with reward store??

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@vead

   

You can name a port as you like. For your better understanding it was named "LCDPort" from which - as you can see - 7 pins are needed. The usual writing is "portmame" an underscore "_" and the pin number, so

   

LCDPort_3 is talking about pin 3 of the LCDPort. Remember that pin counting always start with zero (0). Stick to the connection tables Dana posted. On the LCD-module the pins for DB0 to DB3 are not connected and left floating.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

There we go one more time for the download.

0 Likes
Anonymous
Not applicable

Which pin is enable pin of MCU (psoc 4 kit )?

   

Which pin is RS pin of MCU (psoc 4 kit )?

   

Which pin is R/W pin of MCU (psoc 4 kit )?

   

 

   

Pin 1 should be connecte with ground

   

Pin 2 should be connected with VDD

   

Pin 3 should be connecte

   

Pin 4 should be connecte

   

Pin 5 should be connecte

   

Pin 6 should be connecte

   

Pin 7 should be connecte with data pin of microcontroller

   

Pin 8 should be connecte with data pin of microcontroller

   

Pin 9 should be connecte with data pin of microcontroller

   

Pin 10 should be connecte with data pin of microcontroller

   

Pin 11 should be connecte with data pin of microcontroller

   

Pin 12 should be connecte with data pin of microcontroller

   

Pin 13 should be connecte with data pin of microcontroller

   

Pin 14 should be connecte with data pin of microcontroller

   

Pin 15 X

   

Pin 16 X

   

 I tried to open your workspace. But when I try I get error

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

It is in PSOC Creator  3.1 SP2 (3.1.0.2177).  you need to unzip the program to a working Dir before you can load it into your PSOC program.  Also what LCD module are you using?   Check the CDWR file in the PSOC program to seen the ports and wiring information.
I have checked the file I uploaded to Cypress by downloading it on my system and it worked with out errors.
 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I could successfully download, unzip and open the workspace, check what you did and tell us the errormessage.

   

 

   

Bob

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

If you get a solderless breadboard and a Arduino proto board such as

   

Arduino ProtoShield Prototype Kit Shield Prototyping with 170 Mini Breadboard

   

At Amazon BI00170 for $5.03  then you can interface the LCD to the PSOC 4 board.  I think you are using a  PSOC 4200 board.  you would need some jumpers to attach it to your board.  I am using a PSOC pioneer kit and it interfaces to ARDUINO shields just by plugging it  in. I was getting a warning in the LCD.h section of the program but it doesn't affect the program.  Item was defined by default.

0 Likes
Anonymous
Not applicable

I can open project that you gave me in your post

   

I am using  jhd162a 16x2 lcd

   

I looked pin configuration But I don't understand which are E , RS, and R/W of  MCU. If you look my last three post I am asking about following questions

   

Which pin is enable pin of MCU (psoc 4 kit )?

   

Which pin is RS pin of MCU (psoc 4 kit )?

   

Which pin is R/W pin of MCU (psoc 4 kit )?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Which pin is enable pin of MCU (psoc 4 kit )?   LCDPort Pin 4

   

Which pin is RS pin of MCU (psoc 4 kit )? LCDPort Pin 5

   

Which pin is R/W pin of MCU (psoc 4 kit )? LCDPort Pin 6

   

 

   

Bob

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

In my design the Enable pin is Port 3 pin 4 of your 4200 board. RS pin goes to Port 2 pin 6. RW pin of the LCD goes to system ground.  The great thing about PSOC is that you can assign external ports to any pin that is not used the PSOC will re route the signal to any external pin as long as you asign it in cydwr file. and it is not constrained by the 4200 board design. Also there is no degisnatior for MCU.  MCU=PSOC4. Also I am not sure that your LCD will work with a Hitachi HD44780 LCD display
driver which this software is designed for.  It may but I am not sure.  You can try it and see what happens.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

From the LCD datasheet -

   

 

   

   

 

   

So LCDPort_0 in the above, if you are using port 2 on PSOC is pin 0 port 2 psoc.

   

So LCDPort_1 in the above, if you are using port 2 on PSOC is pin 1 port 2 psoc.

   

 

   

Vee is a pin on display, commonly called contrast pin. Basically you adjust that pin

   

wiuth a pot and adjust for best display appearance, it ranges from 0V to Vdd of the

   

display. Which is normally also Vdd of PSOC.

   

 

   

Regards, Dana.

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Dana you are right if you are using the standard Component I am using the multiport component.and it can use any pin of the PSOC you are not ried to port x pin 0.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I had thought poster was using a single port, the multiport component

   

is a good component, especially for PSOC 4 because of more constrained

   

routing inherent in it.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

My LCD is  ON. but LCD not showing text 

   

there are three section

   

1. design (pin configuration )

   

2. program

   

3. hardware connection ( LCD with kit )

   

 

   

I have already posted  my pin diagram and program.  I have  design and program with no error. I have connected LCD with Kit .

   

how to sortout problem step by step ? which section is wrong ? where I am doing mistake ? please tell me

   

 

   

pin connection

   

    

   

          

   

 LCD Pin 1  connected with ground

   

LCD Pin 2  connected with VDD

   

LCD Pin 3  connected with  ground 

   

LCD Pin 4 [RS]  connecte with  pin P3[4]

   

LCDPin 5 (R/W) should be connected with  P3[5]

   

LCD Pin 6 (E) should be connecte with p3 [6]

   

Pin 7 should be connecte with data pin P2[0]

   

LCD Pin 8  connected with data pin  P2[1]

   

LCD Pin 9  connected  with data pin P2[2]

   

LCD Pin 10  connected with data pin P2[3]

   

LCD Pin 11 connected  with data pin P2[4]

   

LCD Pin 12  connected with data pin P2[5]

   

Pin 13 should be connecte with data pin P2[6]

   

Pin 14 should be connecte with data pin P2[7]

   

Pin 15 X [ not in use ]

   

Pin 16 X [ not in use ]

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

   

 

   

   

 

   

Pin 1 should be connecte with ground

   

Pin 2 should be connected with VDD (Vcc in above diagram)

   

Pin 3 should be connecte pot as show above

   

Pin 4 should be connecte pin 5 in the PSOC port

   

Pin 5 should be connecte pin 6 in PSOC port

   

Pin 6 should be connecte pin 4 in PSOC port

   

Pin 7 No Connection

   

Pin 8 No Connection

   

Pin 9 No Connection

   

Pin 10 No Connection

   

Pin 11 Pin 0 in PSOC port

   

Pin 12 Pin 1 in PSOC port

   

Pin 13 Pin 2 in PSOC port

   

Pin 14 Pin 3 in PSOC port

   

Pin 15 X (connect if display has a backlight to Vdd if display has a current limiting R, if

   

not connect a series R to LCD pin then other side R to Vdd

   

Pin 16 Connect to Vss

0 Likes
Anonymous
Not applicable

why there is no connection for Pin 7,8 and pin 9 ? I am using jhd 16 2A LCD

   

please look at this table . datasheet

   

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Because the controller in the LCD can operate in byte or nibble mode, and

   

the PSOC component uses the latter, so just needs 4 pins for data.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

ok , how to sort out problems. where I am doing mistake. I want to fix problem step by step. someone tell me some common mistakes.     

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Any symptoms ? Do you see anything on display ?

   

 

   

Vee should be ~ 2.5 volts for starters before you do further adjustments

   

to optimize contrast.

   

 

   

Post your project and a schematic of your current hookup.

   

 

   

I noticed in LCD Display Datasheet they only show a single R to ground on Vee. Thats

   

unusual unless they place a R to Vdd (Vcc) on the module so user does not have to

   

use a POT, just a R to Vss to set Vee voltage (contrast adjust). See if you can trace wether

   

Vee goes to a R on module or right into display chip. If later then use a pot, former just a R to

   

Vss.

   

 

   

The dataheet only shows an 8 bit interface, but does state KS0066 compatible

   

chip. That chip is compatible with the LCD PSOC component which is compatible

   

to 44780 Hitachi/Renesas LCD controller chip. Could it be you have a non compatible

   

controller on module ?

   

 

   

Look at R/W and Enable and RS and data pins with scope, yous ee activity on them

   

all ?

   

 

   

Regards, Dana.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Typical errors (probably in that order):

   
        
  • not setting the contrast properly (try to change the potentiomenter)
  •     
  • wrong connections, missing connections, connections that are flaky, sometimes connections are grounded by mistake
  •     
  • wrong API usage
  •    
0 Likes
Anonymous
Not applicable

Hi vead, it seems the question has been answered by danaaknight but i have a suggestion for you. It is better for you if try to open datasheet by right click the component on the canvas and click the "Open Datasheet", PDF reader will open automatically.

0 Likes