Objective

MPLAB® Harmony is a flexible firmware development platform for PIC32 microcontrollers. This integrated software framework provides driver libraries and APIs that make it easier for you to use PIC32 peripherals (Timers, GPIO, UART, I2C, SPI, etc.). It also includes middleware libraries for USB (Host and Device), TCP/IP (Ethernet and WiFi®), Graphics, Bluetooth, and others.

Materials

Hardware Tools

It is not necessary to have an MPLAB Real ICE™ to program/debug the code. The PIC32MZ EF Starter Kit includes a PICkit™ on-board (PKOB) debugger. The PKOB debugger can be connected to a host PC through the USB mini-B connector on the PIC32MZ EF Starter Kit for programming/debugging (See the Red Cable in the Hardware Setup).

In addition to the hardware shown above, you'll also need an Ethernet cable and two USB (mini-B) cables.

Software Tools

​

This project has been verified to work with the following versions of software tools:
MPLAB® X IDE v3.40, MPLAB® XC32 Compiler v1.42, MPLAB® Harmony v2.01b

Because we regularly update our tools, occasionally you may discover an issue while using newer versions. If you suspect that to be the case, we recommend that you double check using the same versions that the project was tested with.

Archived versions of our tools can be found on the following Microchip websites:MPLAB Harmony (see "Archived Downloads" tab)MPLAB X IDE and XC32 Compiler (see "Downloads Archive" tab)
Note that multiple versions of all these tools can co-exist on the same computer.

Overview

This lab application allows capturing an image using the camera module on the MEB-II board. The captured image is stored on an external SD Card. The external SD Card hosts a FAT32 file system. The captured image stored on the SD Card can be viewed as a slideshow on a web page hosted by the web server running on the development board.

The application runs a DHCP client on the target. The target board receives its IP address from the DHCP server which runs on the router to which the target is connected. The image format supported is BMP. The application also supports the plug and play feature for SD Card media.

APP_Tasks()

The live photo frame application runs as a single application task in the App_Tasks() function.

Click image to enlarge.

Click image to enlarge.

Application States

APP_Tasks handles the application related states and events.
The tasks sequentially progress through the following steps.

Register an application callback with the filesystem service.

Wait for the SD Card to be mounted.

The application state moves to TCP/IP stack initialization once the SD Card is mounted.

The application initializes the TCP/IP stack. Once the TCP/IP stack is ready, the application moves to the next state.

Initialize and start the camera module.

Check periodically for any change in the network. The application remains in this state unless

There is a removal of the SD Card or

The application switch is pressed to capture the image on the camera module.

Capture image on camera module to SD Card on a "button press" event and get back to step 6.

Click image to enlarge.

Click image to enlarge.

Lab Source Files and Solutions:

This ZIP file contains the completed solution project for this lab. It also contains the source files needed to perform the labs, as per the following step-by-step instructions (see the "Procedure" section on this page).

Results

You should be able to view the images that you captured using the camera module on your computer's screen using a web browser.

Some Troubleshooting tips:

If the web page is not loading for the acquired IP address, verify that your PC is connected to the same router as the MEB II Board.

Analysis

In this tutorial, you developed a WEB enabled live photo frame that captured and stored the image on the camera module to an SD Card connected over an SPI interface. You used the MPLAB Harmony Configurator (MHC) to select the appropriate Board Support Package (BSP) and configured the clock system, TCP/IP stack, timer driver, camera driver, output compare driver, and file system. You configured an application switch to capture an image on a button press event.

Conclusions

With this tutorial, we demonstrated how easy it is to add a web server and image capture functionality to your application. The lab shows how you can create complex applications that integrate various peripheral drivers, device drivers for Display, TCP/IP, File System etc., through the use of the MPLAB Harmony Configurator (MHC).

Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.

Click here to edit contents of this page.

Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.

Append content without editing the whole page source.

Check out how this page has evolved in the past.

If you want to discuss contents of this page - this is the easiest way to do it.

View and manage file attachments for this page.

A few useful tools to manage this Site.

See pages that link to and include this page.

Change the name (also URL address, possibly the category) of the page.