DSPIC33FJ16MC304-H/ML Microchip Technology, DSPIC33FJ16MC304-H/ML Datasheet - Page 7

16-bit DSC, 16KB Flash,40 MIPS,nanoWatt 44 QFN 8x8x0.9mm TUBE

DSPIC33FJ16MC304-H/ML

Manufacturer Part Number
DSPIC33FJ16MC304-H/ML
Description
16-bit DSC, 16KB Flash,40 MIPS,nanoWatt 44 QFN 8x8x0.9mm TUBE
Manufacturer
Microchip Technology
Series
dsPIC™ 33Fr

Specifications of DSPIC33FJ16MC304-H/ML

Core Processor
dsPIC
Core Size
16-Bit
Speed
20 MIPS
Connectivity
I²C, IrDA, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, DMA, Motor Control PWM, QEI, POR, PWM, WDT
Number Of I /o
35
Program Memory Size
16KB (16K x 8)
Program Memory Type
FLASH
Ram Size
2K x 8
Voltage - Supply (vcc/vdd)
3 V ~ 3.6 V
Data Converters
A/D 9x10b/12b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 140°C
Package / Case
44-QFN
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DSPIC33FJ16MC304-H/ML
Manufacturer:
MICROCHIP
Quantity:
12 000
23. Module: QEI – Interrupt Generation
EXAMPLE 3:
© 2008 Microchip Technology Inc.
unsigned int POSCNT_b15 = 0;
unsigned int Motor_Position = 0;
int main(void)
{
}
void __attribute__((__interrupt__)) _QEIInterrupt(void)
{
}
The Quadrature Encoder Interface module does
not generate an interrupt when MAXCNT is set to
0xFFFF and the following events occur:
1. POSCNT underflows from 0x0000 to 0xFFFF.
2. POSCNT stops.
3. POSCNT overflows from 0xFFFF to 0x0000.
This sequence of events occurs when a motor,
which is running in one direction, making POSCNT
underflow to 0xFFFF, stops in that position, and
starts running in the opposite direction, generating
an overflow from 0xFFFF to 0x0000. The QEI
module does not generate an interrupt when this
occurs.
// ... User's code
MAXCNT = 0x7FFF;// Instead of 0xFFFF
Motor_Position = POSCNT_b15 + POSCNT;
// ... User's code
IFSxbits.QEIIF = 0;
POSCNT_b15 ^= 0x8000;// Overflow or Underflow
// x=2 for dsPIC30F
// x=3 for dsPIC33F
// Clear QEI interrupt flag
Work around
The MAXCNT register should be set to 0x7FFF, so
that an interrupt is generated by the QEI module,
should this condition occur. In addition, a global
variable is needed to keep track of bit 15, so that if
there is an overflow or underflow condition on the
POSCNT register, this variable would toggle bit 15.
Code for achieving the work around is provided in
Example 3.
DS80338D-page 7

Related parts for DSPIC33FJ16MC304-H/ML