Using dsPIC33F and PIC24H/24F Devices
©
2006 Microchip Technology Inc.
DS70099D-page 59
4.8
ADDITIONAL CODE EXAMPLES
The dsPICDEM™ 1.1 Plus Development Board Kit CD contains additional code
examples that exercise various features and peripherals of the dsPIC33F device:
CE111 – External Interrupt Pins:
Microchip's 16-bit dsPIC Digital Signal Controllers feature up to 5 external interrupt
pins: INT0 through INT4. These pins may be configured to interrupt on either a rising
or a falling edge of a signal.
This code example, written in C, demonstrates how the external interrupt pins can be
configured to interrupt the CPU. Both initialization and interrupt service routines have
been provided.
CE113 – Timer1 Used in Real-Time Clock Applications:
dsPIC Digital Signal Controllers feature several on-chip general purpose timers. Of
these, the Timer1 module has the capability to be clocked by an external asynchronous
32 kHz crystal connected to the device via the SOSCI and SOSCO pins. The attached
code example demonstrates how Timer1 may be configured to use the 32 kHz
secondary oscillator for a real-time clock (RTC) application.
Configuring Timer1 for the real-time clock application is a two step process. In the first
step, the code demonstrates how the secondary oscillator can be enabled via a special
write sequence to the OSCCON register. In the second step, the code demonstrates
how the Timer1 is configured to use an external asynchronous clock. In addition to
these steps, the code also demonstrates Timer1 interrupt operation.
CE114 – UART Loopback:
In this code examples, 256 byte transmit buffer is transmitted using UART and received
back in the receive buffer. This operation happens continuously.
CE121 – ADC Channel Scanning:
In this example, Timer 3 is set up to time-out every 125 microseconds (8 kHz rate). As
a result, the module stops sampling and triggers an A/D conversion on every Timer3
time-out (i.e., Ts=125µs).
ADC is configured in 10-bit mode to sequentially scan AIN0, AIN1, AIN2, AIN3, AIN4
and AIN5 on Timer 3 interrupt. It takes six Timer3 time-out periods to scan through all
the six analog inputs.
Содержание dsPICDEM 1.1 Plus
Страница 1: ...2006 Microchip Technology Inc DS70099D dsPICDEM 1 1 Plus Development Board User s Guide...
Страница 12: ...dsPICDEM 1 1 Plus Development Board User s Guide DS70099D page 8 2006 Microchip Technology Inc NOTES...
Страница 64: ...dsPICDEM 1 1 Plus Development Board User s Guide DS70099D page 60 2006 Microchip Technology Inc NOTES...
Страница 78: ...dsPICDEM 1 1 Plus Development Board User s Guide DS70099D page 74 2006 Microchip Technology Inc NOTES...
Страница 88: ...dsPICDEM 1 1 Plus Development Board User s Guide DS70099D page 84 2006 Microchip Technology Inc NOTES...
Страница 91: ...Index 2006 Microchip Technology Inc DS70099D page 87 NOTES...