This
directory contains PIC32 Peripheral Library code examples for MPLAB XC32 C
compiler. This directory may contain more than one code example.
Each code
example directory contains complete source code and MPLAB project files. The remainder of this
document provides a brief overview of each example
Note: These examples use peripheral library binaries distributed with MPLAB XC32.
Peripheral/Topic |
Example Name |
Path |
Description |
Operation in IDLE mode |
operate_in_idle_mode |
Configures Timer1 to operate in IDLE mode, places CPU in IDLE mode and uses Timer1 interrupt to exit the IDLE mode. |
|
A/D Converter |
adc10/adc10_ basic |
Converts 2 analog inputs |
|
Bus Matrix |
bmx/bmx_ basic |
Partitions RAM in user and kernel mode |
|
Analog Comparator |
cmp/cmp_ basic |
Configures comparator in simple mode |
|
Comparator Voltage Reference |
cvref/cvref_ basic |
Generates a triangle wave on CVref output pin |
|
DMA Controller |
dma/led_txfer |
Blink LED on an Explorer16 board using the DMA and a pattern stored in Flash. |
|
dma/pmp_txfer |
Performs a transfer from RAM to the PMP port |
||
dma/crc_calculation |
Calculates CRC of flash memory using DMA CRC method |
||
dma/m2m_copy |
Copies data from one memory region to another memory region |
||
dma/uart_echo |
Uses DMA channel to receive and transmit UART data |
||
dma/spi_txfer |
Uses DMA channel to receive and transmit SPI data |
||
I2C |
I2c/i2c_master |
Interfaces to Microchip serial EEPROM 24LC256 as an I2C master |
|
Input Capture |
incap/incap_capture_event |
Captures and time stamps an external event |
|
Interrupts |
int/int_multi_vector |
Uses Multi-vector interrupt mode |
|
int/int_single_vector |
Uses Single-vector interrupt mode |
||
NVM Controller |
nvm/nvm_simple |
Erases, writes, and verifies a block of flash program memory |
|
Output Compare |
ocmp/ocmp_simple_pwm |
Generates a PWM waveform |
|
Oscillator |
osc/osc_basic |
Changes SYSCLK and PBCLK divider values while CPU is running |
|
Prefetch-Cache |
pcache/pcache_init |
Configures Prefetch-Cache for basic operation |
|
|
pcache/pcache_stat |
Demonstrates the effect of Prefetch cache code execution |
|
|
pmp/pmp_master_mode2 |
Writes a block of data to an external memory using master mode 2 & 16-bit configuration |
|
Ports |
ports/ports_basic |
Exercises all features of PORT I/O pins |
|
|
ports/blinky_leds |
Blinks LEDs on Explorer-16 board |
|
Power Modes |
power/power_basic |
Configures CPU to wakeup from SLEEP using Watchdog timer |
|
RESETs |
teset/reset_basic |
Demonstrates how application can detect various RESET conditions |
|
RTCC |
ttcc/alarm |
Demonstrates RTCC alarm feature |
|
ttcc/time_date |
Configures RTCC for current time and date |
||
SPI |
spi/burst_master |
Performs burst data transfer in a master mode |
|
spi/burst_slave |
Performs burst data transfer in a slave mode |
||
spi/loopback |
Performs SPI loopback test |
||
spi/master_slave |
Uses two SPI channels to establish master/ & slave connection |
||
Timers |
yimer/core_timer_int |
Configures core timer to generate recurring interrupt |
|
timer/timer1_int |
Configures Timer1 to generate recurring interrupt |
||
UART |
uart/uart_basic |
Uses UART in polling mode to send and receive data |
|
uart/uart_interrupt |
Uses UART to do interrupt-driven receive and polled transmission |
||
Watchdog Timer |
wdt/wdt_basic |
Demonstrates simple WDT usage |
Microchip Technology Inc.