I came across this on the Cypress Forums. It is a great tool for reducing pins usage. The original example was made for PSoC 5 and 3. I tried it on PSoC 4 and it worked perfectly.
This design requires a custom component block in order to work. For reference, the schematic wiring is included. When opening the program, you will be prompted about this custom component. Just say: YES.
Pin ConnectionsNotice that the only pins that are wired from pins are RS, E, D4 - D7.
To add this custom component to a new project, go to the components tab in the Workspace Explorer.
Right click on the Project item and choose Import Component.
You can import the component from a project or an archive.
Just look for the file and select the desired component (you will find them in the project folder of the attached workspace).
For the example, I added the External LCD and the CharLCDmp v1.1, but you only need the CharLCD for this to work.
Then you will find it here:
And just use it like any other block.
The code is the same as in any other LCD block:
#include <device.h>
#define clr() LCD_ClearDisplay();
int main(){
CyGlobalIntEnable;
clr();
LCD_Start(); clr();
LCD_Position(0u, 0u); LCD_PrintString("LCD with 4bits");
LCD_Position(1u, 0u);LCD_PrintString("Cypress PSOC 4");
for(;;){
}
}
Comments
Please log in or sign up to comment.