13 Replies Latest reply on May 17, 2013 4:04 PM by user_78878863

    Character LCD

              Can I use a 4x20 LCD with Character LCD on PSoC 5LP? Thank you   
        • 1. Re: Character LCD
          • 2. Re: Character LCD
                    Long answer: I see no mentioning in the 'Character LCD' component data sheet limiting the number of rows or columns. So you can just give it a go and see whether you can access the rows 2 and 3. If this doesn't work properly, you can always set the cursor address manually by using the LCD_Char_WriteControl() call.   
            • 3. Re: Character LCD

              One of my customers used a 4x20 char LCD and experienced some strange behaveour concerning the LCD_Position() to tell the device where a line starts. Could be overcome easily.





              • 4. Re: Character LCD

                We use it for a 2 * 40 display, just need some change to the libarary. It is doable.

                • 5. Re: Character LCD
                          Why not. Actually I'm using a 4x20 LCD with PSoC5. The routine LCD_Position( row, col ); is working properly.   
                  • 6. Re: Character LCD
                            Depending on the actual controller, the displays behave a little bit different when it comes to addressing the additional lines (IIRC the memory location used for them might be different). Its best to look up the datasheet and compare with the library implementation. @Cypress: would it be possible to include that functionality in the official component?   
                    • 7. Re: Character LCD
                              Here is generated API, sorry for the layout, Forum SW as usual doing its worst - 176:.\Generated_Source\PSoC5/LCD1.c **** /******************************************************************************* 177:.\Generated_Source\PSoC5/LCD1.c **** * Function Name: LCD1_Position 178:.\Generated_Source\PSoC5/LCD1.c **** ******************************************************************************** 179:.\Generated_Source\PSoC5/LCD1.c **** * 180:.\Generated_Source\PSoC5/LCD1.c **** * Summary: 181:.\Generated_Source\PSoC5/LCD1.c **** * Moves active cursor location to a point specified by the input arguments 182:.\Generated_Source\PSoC5/LCD1.c **** * 183:.\Generated_Source\PSoC5/LCD1.c **** * Parameters: 184:.\Generated_Source\PSoC5/LCD1.c **** * row: Specific row of LCD module to be written 185:.\Generated_Source\PSoC5/LCD1.c **** * column: Column of LCD module to be written 186:.\Generated_Source\PSoC5/LCD1.c **** * 187:.\Generated_Source\PSoC5/LCD1.c **** * Return: 188:.\Generated_Source\PSoC5/LCD1.c **** * None. 189:.\Generated_Source\PSoC5/LCD1.c **** * 190:.\Generated_Source\PSoC5/LCD1.c **** * Note: 191:.\Generated_Source\PSoC5/LCD1.c **** * This only applies for LCD displays which use the 2X40 address mode. 192:.\Generated_Source\PSoC5/LCD1.c **** * This results in Row 2 offset from row one by 0x28. 193:.\Generated_Source\PSoC5/LCD1.c **** * When there are more than 2 rows, each row must be fewer than 20 characters.   
                      • 8. Re: Character LCD

                        Actually 20 characters per line should be OK. Depending on the actual controller the 3rd line starts at address 0x14 (which allows 20 characters in the first line) or on 0x20.

                        • 9. Re: Character LCD

                          The API code seems clear it will not support 4 X 20 with this comment in


                          code generated -




                          When there are more than 2 rows, each row must be fewer than 20 characters




                          Odd, given the Hitachi/Renesas controller, 44780,  is inherently 80 character device, for which


                          the module is fashioned after,.




                          In PSOC 1 it does support 4 X 20, I use one in a design.




                          Regards, Dana.

                          • 10. Re: Character LCD

                            But 4*20 is 80...

                            • 11. Re: Character LCD

                              @dana: did you look at this code?


                              First, the comment says "This only applies for LCD displays which use the 2X40 address mode".


                              Second, even then it specifies that the offset between the rows is 0x28, so clearly there can be 20 rows with 20 characters each in this space.


                              Third, the code actually handles 4 rows, and it knows about the starting position for each of the four lines (see the LCD_Char_1_ROW_x_START constants).


                              So the answer should be: "yes, the LCD_Char component can handle 4x20 displays, but you might need to set the cursor on your own when the memory layout of the LCD module in question is different".

                              • 12. Re: Character LCD

                                No, I did not look at API code in depth.




                                The qualifier comes right out of 44780 DS -




                                •  2-line display (N = 1) (Figure 4)


                                 Case 1: When the number of display characters is less than 40 ×2 lines, the two lines are displayed
                                from the head. Note that the first line end address and the second line start address are not
                                consecutive. For example, when just the HD44780 is used, 8 characters ×2 lines are displayed. See
                                Figure 5.




                                But you are correct, I did misinterpret that qualifier.




                                Your comment, 20 rows each with 20 chars,  the 44780 standard is 80 chars total


                                display memory, or am I misinterpreting what you said ?




                                The short answer to original post is if module is 44780 compatible, it should handle


                                a 4 x 20 display, like it does in the PSOC 1 implementation.




                                Regards, Dana.

                                • 13. Re: Character LCD

                                  Now I miss the edit-button too :) That should have been "4 rows with 20 characters"...