Step 4.1 - Enable and Configure Camera Driver
In the MPLAB® Harmony Configurator (MHC) Options tab, expand the Harmony Framework Configuration > Drivers > Camera selection tree. Check the Use Camera Driver? box.
Step 4.2 - Enable and Configure OC Driver
In the MHC Options tab, expand the Harmony Framework Configuration > Drivers > OC selection tree. Check the Use OC Driver? box.
Configure the OC driver as shown:
Configure OC5 in the Pin Manager as shown in the following graphic.
Step 4.3 - Configure I²C driver
The Camera module is connected to one of the PIC32's I²C ports (I2C3). Configure the I²C driver used by the Camera module.
In the MHC Options tab, expand the Harmony Framework Configuration > Drivers > I2C selection tree. Note when you checked the box beside the Use Camera Driver? selection, MHC automatically checked the Use I2C Driver? box for you. Configure the I²C driver as shown in the following graphic.
Verify and Configure the I/O Pins used by the I²C module using the Graphical Pin Manager. Select the Pin Table tab in the Output pane and configure the I²C pins as shown in the following graphic.
Expand the following section to see descriptions of all I²C driver configuration options.
Step 4.4 - Configure Change Notifications for the Camera module
For the functioning of the camera, Change Notifications has to be enabled for the HREF and VSYNC pins. Also, make sure that the pins connected to the camera are configured as digital pins.
Step 4.5 - Configure the pins used by the Camera module
The Board Support Package (BSP) for pic32mz_ef_sk_meb2 will assign some of the pins for accessing the on-board SRAM device. SRAM will be used by the Low-Cost Controllerless (LCC) driver if you configure it to use external memory. In this demo, you will configure the LCC driver to use internal memory.
The pins which are mapped to SRAM are shared with the data lines of the Camera module. So you need to modify the pin mapping to use these pins for the Camera module. If these are not properly mapped, then the Camera module will not work properly. Follow the diagram to map the pins to the Camera module.
Step 4.6 - Timer Driver configuration for the Camera driver
A timer is required for the functioning of the Camera module. Since you already have used the Timer Driver Instance 0 for Timer System Service, you will be using Timer Driver Instance 1 for the Camera module. For Timer Driver Instance 1, you are using Timer module ID 2. Configure the prescale value of the timer to TMR_PRESCALE_VALUE_1.
In the MHC Options tab, expand the Harmony Framework Configuration > Drivers > Timer selection tree. Configure the Timer driver as shown in the following graphic.
Step 4.7 - Configure the peripheral clock for the Camera module
The Camera module uses external interrupt INT2 as its peripheral clock. So, you need to enable the External Interrupt System Service and do the pin mapping for the same in the pin manager.
Step 4.8 - Configure the priorities for Direct Memory Access (DMA) and Change Notification
You need to increase the priorities for the DMA and Change Notifications.
Table of Contents
|