3.2.2 Web Photo Frame Application on PIC32MZ DA Curiosity Development Kit
Description
This application shows how to create a web-enabled digital photo frame using Harmony under MPLAB Code Configurator (MCC).
The application uses:
- Legato Graphics library to display images from an SD Card to a WQVGA display
- TCP/IP Stack to enable a Web Server to show images into a Web Browser.
Modules/Technology Used
- Board Support Package (BSP)
- PIC32MZ DA Curosity BSP
- Peripheral Modules
- UART
- I2C
- DDR
- NVM
- SDHC
- Core Timer
- Driver Modules
- SDMMC Driver
- I2C Driver
- Display Drivers
- LE GLCD Display Controller
- Max Touch Controller
- PDA TM4301B Display Driver
- GFX Core LE
- LE 2DGPU
- System Services
- Time
- File System
- Debug
- Command
- Console
- Harmony Libraries
- TCP/IP Stack
- Legato Graphics Library
- Cryptographic Library
- Third Party Libraries
- FreeRTOS
- WolfCrypt Library
- Display Template
- Legato Graphics w/ PDA TM4301B Display
The following figure shows the MCC Harmony project graph with all the components.
Hardware Used
Software/Tools Used
This project has been verified to work with the following versions of software tools:
- Refer Project Manifest present in mcc-manifest-generated-success.yml under the project folder ./firmware/src/config/pic32mzda_curiosity.
Development Tools
- MPLAB® X IDE v6.20
- MPLAB® XC32 C/C++ Compiler v4.45
- MPLAB X IDE plug-ins:
Because Microchip regularly updates tools, occasionally issue(s) could be discovered while using the newer versions of the tools. If the project does not seem to work and version incompatibility is suspected. It is recommended to double-check and use the same versions that the project was tested with. To download original version of MPLAB Harmony v3 packages, refer to document How to Use the MPLAB Harmony v3 Project Manifest Feature (DS90003305).
Setup
- Mount the LAN8720A PHY Ethernet Daughter Board to Ethernet PHY Module connector.
- Connect the 24-Bit pass through Graphics Card to the Graphics Interface (J502) of PIC32MZ DA Curiosity Development Kit.
- Connect the WQVGA LCD Display Module ribbon to the connector(J2) of the 24-Bit pass through Graphics Card.
- Connect the Micro USB cable to the Debug USB of the Curiosity PIC32MZ DA Curiosity Development Kit.
- Connect and Ethernet Cable between the
LAN8720A PHY Ethernet Daughter Board and the Router / PC.
Programming hex file
The pre-built hex file can be programmed by following the below steps.
Steps to program the hex file- Open MPLAB X IDE
- Close all existing projects in IDE, if any project is opened
- Go to File -> Import -> Hex/ELF File.
- In the Import Image File window,
- Create Prebuilt Project,
- Click the Browse button to select the prebuilt hex file from pic32mzda_web_photo_frame/hex folder and load the hex file available.
- Select Device as PIC32MZ2064DAR176.
- Ensure the proper tool is selected under Hardware Tool and click on Next button.
- Select Project Name and Folder,
- Select appropriate project name and folder and click on Finish button
- Create Prebuilt Project,
- In MPLAB X IDE, click on Make and Program Device button to program the device.
- Follow the steps in Running the Demo section below.
Programming/Debugging Application Project
- Open the project (pic32mzda_web_photo_frame/firmware/pic32mz_da_curiosity.X) in MPLAB X IDE.
- Ensure Curiosity/Starter Kits (PKOB4) is selected as hardware tool to program/debug the application.
- Build the code and program the device by clicking on the Make and Program Device button in MPLAB X IDE tool bar.
- Follow the steps in Running the Demo section below.
Running the Demo
- Take a micro SD Card and copy the resource files and folders provided into the pic32mzda_web_photo_frame/sdcard_files to the SD Card.
- Plug the SD Card into the Micrco SD card socket (J500) of PIC32MZ DA Curiosity Development Kit.
- Plug an Ethernet Cable into the Ethernet Adapter and a Router in the same network with the PC, or directly to the PC. If plugged directly to the PC, the Ethernet Adapter on the PC should be configured for Static IP with the IP address 192.168.100.2 and Net Mask 255.255.255.0.
- Open a terminal, such as Tera Term and connect it to the COM port assigned to the Debug USB. Select the baud rate of 115200 for the COM port.
- Reset the board to start by pressing the reset button on the PIC32MZ DA Curiosity Development Kit.
- After the device reset, wait for the
initialization of the file system, IP address generation for the Web Browser.
- After the board powers up, a splash screen should appear on the graphics display.
- Wait for the text to say Touch
Screen To Start.
- Touch the screen, the images should load one after the other at about 3-5 seconds interval.
- Observe the serial terminal, it will
show the loaded image directory.
- In the terminal, an IP address should be provided in the case the Ethernet Cable is plugged, see above screenshot.
- Open a browser on the PC and browse to the provided IP address in the Terminal.
- The following Web Page should
load.
- Use the provided buttons to navigate the images.
- Observe the terminal, it will output
what file will be displayed.Note: The loaded image is not synchronized between Graphics Display and HTTP application (webserver). Both tasks are running independently.
Comments
- This application demo builds and works
out of box by following the instructions above in Running the Demo section. If
the user needs to enhance/customize this application demo, should use the MPLAB Harmony
v3 Software framework. Refer links below to setup and build the applications using MPLAB
Harmony.
- How to Setup MPLAB Harmony v3 Software Development Framework (DS90003232).
- How to Build an Application by Adding a New PLIB, Driver, or Middleware to an Existing MPLAB Harmony v3 Project (DS90003253).
- How to Set up the Tools Required to Get Started with MPLAB® Harmony v3 and MCC
- Create a new MPLAB Harmony v3 project using MCC
- Update and Configure an Existing MHC-based MPLAB Harmony v3 Project to MCC-based Project