pic32mx320f064h Microchip Technology Inc., pic32mx320f064h Datasheet - Page 315

no-image

pic32mx320f064h

Manufacturer Part Number
pic32mx320f064h
Description
64/100-pin General Purpose, 32-bit Flash Microcontrollers
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
pic32mx320f064h-40V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064hT-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
EXAMPLE 16-3:
© 2007 Microchip Technology Inc.
//
//
//
//
//
// Example code for Output Compare 1 ISR:
#pragma interupt OC1IntHandler ipl4 vector 36
void OC1IntHandler(void)
{
}
The following code example will set the Output Compare 1 module
for PWM mode with FAULT pin disabled, a 50% duty cycle and a
PWM frequency of 52.08 kHz at F
the clock for the PWM time base and Output Compare 1 interrupts
are enabled.
OC1CON = 0x0000;
OC1R = 0x00600000;
OC1RS = 0x00600000;
OC1CON = 0x0006;
PR2 = 0x00600000;
IFS0 &= ~0x00000080;
IEC0 |= 0x00000080;
IPC1 |= 0x001C0000;
IPC1 |= 0x00000003;
T2CON |= 0x8000;
OC1CON |= 0x8000;
// insert user code here
PWM MODE PULSE SETUP AND INTERRUPT SERVICING (32-BIT MODE)
IFS0CLR = 0x00000080; // Clear the interrupt flag
// Turn off OC1 while doing setup.
// Initialize primary Compare Register
// Initialize secondary Compare Register
// Configure for PWM mode, Fault pin Disabled
// Set period
// configure int
// Clear the OC1 interrupt flag
// Enable OC1 interrupt
// Set OC1 interrupt priority to 7,
// the highest level
// Set subpriority to 3, maximum
// Enable timer2
// turn on OC1 module
Advance Information
PB
= 40 MHz. Timer2 is selected as
PIC32MX FAMILY
DS61143A-page 313

Related parts for pic32mx320f064h