This page is about interfacing a Newhaven Display International QVGA 3.5" color LCD display touch panel to a Microchip Technology PIC32.
The Microchip PIC32 has the bandwidth to drive QVGA (320x240) or WQVGA (up to 480x272) color LCD display touch panels that are controllerless - all LCD drive requirements are met by the PIC32. Example hardware and software has been developed by Microchip to demonstrate the PIC32s graphics capability. The PIC32 used in the starter kits have sufficient internal RAM (128Kbytes) to support graphics with 8 BPP (bit per pixel) color depth and with an external RAM device 16 BPP is possible. With relatively minor source code revisions and a custom interface board, this project leverages the Microchip developed hardware and software to interface a Newhaven Display International 3.5" QVGA color LCD display touch panel to a PIC32.
Newhaven Display International offers a readily available 3.5" color LCD with touch screen, sans controller. A combination of existing Microchip demonstration boards, the Newhaven LCD and a custom interface board constitute a complete display demonstration project.
The demonstration software shows the capabilities of the PIC32 driving a Newhaven Display International controllerless LCD graphics board. The start up splash screen is a bitmap image. The subsequent screens demonstrate the widgets of the Microchip Graphics Library to show various application screens that can be easily made with Microchip's Graphics Library. The LCC (Low-Cost Controllerless) Daughterboard can support QVGA, WQVGA, and VGA (with the addition of larger external SRAM) resolutions and anything lower. Also, Microchip makes available a visual design tool to create your own graphical user interface screens for Microchip microcontrollers, the Graphics Display Designer (GDD).
Various hardware combinations can be used to drive the LCD display. At minimum, a PIC32USB Starter Kit II or PIC32 Ethernet Starter Kit (note limitations below) is required, along with an LCC Graphics PICtail(TM) Daughter Board, a Newhaven display, and the custom interface board (figure 1, below). Optionally, for I/O accessibility, a PIC32 I/O Expansion Board can be connected to the Graphics PICtail(TM) Plus Daughter Board (figure 2, below).
PIC32 USB Starter Kit II, DM320003-2-ND, PIC32MX795F512L (capable of color depth 8 BPP (Bits Per Pixel) internal or 16 BPP external memory with example software).
PIC32 Ethernet Starter Kit, DM320004-ND, PIC32MX795F512L (capable of color depth 8 BPP internal memory with example software, the ethernet starter kit does not support 16 BPP - this is a starter kit limitation, not a device limitation ).
Low-Cost Controllerless (LCC) Graphics PICtail(TM) Plus Daughter Board, AC164144-ND.
Newhaven NHD-3.5-320240MF-ATXL#-T-1-ND, 320x240 resolution, 24-bit RGB, controllerless, w/touch.
NHD-3.5-320240MF-PICADAPTER-ND, (interface adapter board between Low-Cost Controllerless (LCC) Graphics PICtail(TM) Plus Daughter Board and the Newhaven display).
Now available at Digi-Key
DKSB1014B-ND is now available from Digi-Key, uniting display NHD-3.5-320240MF-ATXL#-T-1-ND with interface adapter board NHD-3.5-320240MF-PICADAPTER-ND.
PIC32 I/O Expansion Board, DM320002-ND.
The PICtail Plus board provides a row of header pins with jumpers (schematic in AN1387). The jumpers are positioned to use internal memory (memory residing in the PIC32 device) or external memory residing on the PICtail Plus Daughter board, and the color depth 8 BPP or 16 BPP. The desired memory use and color depth in software and hardware must match. If there is a mismatch between the software selection and hardware selection images will not display properly.
To use internal memory and 8 BPP color depth all jumpers on the LCC Graphics PICtail Plus Daughterboard must be installed across rows 1 and 2 (Figure 3) and for external memory and 16 BPP install all jumpers across rows 2 and 3 (Figure 4). Associated code changes (reference Software Requirements, Source file and code changes) are noted next to the jumper settings in Figures 3 and 4.
By default the Microchip PIC32 LCC - Object Layer Demo software drives the Powertip 4.3" WVGA display and by commenting/uncommenting select lines of source code the software will drive the Truly 3.2" QVGA display. Several new and revised source files are required to successfully drive the Newhaven 3.5" QVGA display. The software is meant to be used with the Microchip Graphics Library version 3.00.
Revised source files supporting Newhaven 3.5" display are: MainDemo.c, HardwareProfile.h, mchpGfxLCC.c, and Pictures C32.c
New source files supporting Newhaven 3.5" display are: HWP_LCC_PIC_SK_NHD_EXT_QVGAv1.h and HWP_LCC_PIC_SK_NHD_INT_QVGAv1.h
Source file and code changes:
Select hardware header file appropriate for glass and internal or external memory - "...NHD_INT...h" for internal memory, "...NHD_EXT...h" for external memory. The code snippet below will include the header file that defines the use of the Newhaven display and external non-volatile memory.
Define the use of external memory and the Newhaven LCD panel
Define the use of internal memory and the Newhaven LCD panel.
Code common to both files, HWP_LCC_PIC_SK_NHD_EXT_QVGAv1.h and HWP_LCC_PIC_SK_NHD_INT_QVGAv1.h. Define parameters are described in the source file.
Define the LCD glass characteristics.
Define the backlight control logic.
Define the touchscreen characteristics.
MainDemo.c (Logo image available 8BPP or 16 BPP comment/uncomment at build time.
Splash screen image, 8 BPP or 16 BPP.
Select splash screen image to render.
This variant of the Microchip embedded software doesn't use the Microchip splash screen image or screen color.
Revised backlight control for Newhaven LCD.
Support for PutPixel and Line position.
Support for the Bar function
Bit map file now includes the new 8 bit and 16 bit splash screen.
For reference, the file folders "...\LCC - NHD Object Layer Demo_072211\Newhaven_files\8_BPP" and "..\LCC - NHD Object Layer Demo_072211\Newhaven_files\16_BPP" is provided with modified source files for 8 BPP or 16 BPP color. Code is uncommented/commented as needed to support 8 or 16BPP color depth.
Project Build and Load
Expand/copy zip file LCC - NHD Object Layer Demo_072211.zip to desired system location. Open MPLAB X IDE, connect the hardware to your computer, and open project "GOLDemo PIC32 NHD". Open the project properties to verify hardware and software tool selection matches your installation. Make and Program device.
Hex files are available in folder "...\LCC - NHD Object Layer Demo_072211\hex_folder" for 8 BPP and 16 BPP color.
OrCAD 16.3 Capture and PCB Editor Project Files
AN1387 "Using PIC32 MCU's to Develop Low-Cost Controllerless (LCC) Graphics Solutions".
AN1368 "Developing Embedded Graphics Applications using PIC(r) Microcontrollers with Integrated Graphics Controller". This application note delves into using PIC devices with an integrated graphics controller, but it also provides background information on basic color science, display terminology, display power sequencing, and resistive touch screens.
This webpage is a project started and maintained by the applications engineering staff at Digi-Key. It is one way we provide complementary support to engineers, hobbyists, entrepreneurs, and other tech minded folks to assist you with your work. In many ways adding content to this website is the best part of our job, but it isn't our only job. We want to continue to develop and expand the eewiki, and you can help us justify our efforts by letting us know if you have used any of our content to help you use or select Digi-Key products. Additionally, we welcome comments, feedback, suggestions, and questions. Just send an email to firstname.lastname@example.org. To address any questions or comments to a specific author, mention the author in the subject line.
Also, if the product you are designing meets certain criteria, we may be able to send you engineering samples.
Budgetary Pricing Request
P/N to Quote:
EAU (Estimated Annual Units):
Estimated Production Date:
Contract Manufacturer (if any):
Thank you for requesting a quote, please expect our call.