Introduction: LCD Control With LabVIEW
For this project, I used LabVIEW, MakerHub LINX, and chipKIT WF32 to control the PmodCLP, an LCD screen peripheral module. In LabVIEW, you write a string constant and this is then displayed on the LCD screen.
Check out this Instructable to see how to set up the WF32 in LabVIEW. If you have a similar board, this will also be a helpful guide. Check labviewmakerhub.com to see if your board is supported by LINX.
Since the PmodCLP communicates via parallel data interface, the custom command functionality of LINX was utilized in order to interface with it (more on this later).
Step 1: Materials
Step 2: Wiring
From the reference sheet on the Digilent page, we get the table above that shows each pin and its function. Pins 1.5, 1.11, and 2.5 are signal ground and pins 1.6, 1.12, 2.6 are power supply (3.3V). The rest of the pins (besides 2.4 which is not connected) are digital output lines. Refer to the excel table above for the correct connections between pin number and digital channel.
Step 3: Code MPIDE (Custom Commands)
For MPIDE setup and basics, check out this learn module from Digilent.
Since parallel data interface is not directly supported (yet) by LINX, the custom command functionality must be used. Custom commands work by adding a custom function to the device firmware and then calling that function from LabVIEW.
Check out this link to get a tutorial on how to use the custom commands. Follow this guide until step 7 of the procedure, but feel free to continue reading to get a feel for how custom commands work.
From here, download the .pde file attached below. This file is the custom firmware file that I made for the PmodCLP using the data sheet for the LCD screen. NOTE - this custom firmware file only works for the chipKIT WF32. If you have a different chipKIT device, check out the custom command link above to LabVIEW MakerHub. Just take my custom function from the .pde file and include the forward declaration and the attach custom command function described in the guide.
Now all you need to do is upload this file to the WF32 or whatever board you have and you'll be ready to use the LabVIEW code.
Step 4: LabVIEW Code
Now for the easy part!
Download the LabVIEW code below and open it. Select your COM port for the WF32 (if you're not sure which COM port this is, check out my instructable linked in the introduction).
Enter what you would like in the string constant on the block diagram and you're ready to go! Click the run arrow and your string constant entry will appear on the LCD screen.
The max string length is set to 16 since that is the length of the first line. You can add the second line yourself by checking the data sheet and altering the custom firmware code in MPIDE.
Let me know if you have any questions!
We have a be nice policy.
Please be positive and constructive.