dsPICDEM™ 1.1 Plus Development Board User’s Guide
DS70099D-page 38
©
2006 Microchip Technology Inc.
3.4.3
Interrupts Used in the Demo
3.4.3.1
EXTERNAL INTERRUPTS TO MAIN ROUTINE
External interrupts INT1-INT4 are controlled by switches SW1-SW4.
These switches provide selection capabilities for the demo program. The most recent
switch presses are recorded in a variable within the interrupt routines. In the main
routine, the variable is analyzed to determine what action is requested by the recent
switch event.
3.4.3.2
DCI INTERRUPTS AND DTMF
The DCI module interrupts the CPU when all four TXBUF registers have been
transmitted. The DCI is used to send out DTMF tones to the Codec. The tonal
components are stored as sinusoid tables in program memory and accessed using
Program Space Visibility (PSV).
The DCI ISR keeps track of the number of samples sent. The DTMF tones are
transmitted by adhering to International Telecommunication Union (ITU-T)
specifications. For example, the ON time for tones is greater than 40 mS and the OFF
time is less than 23 mS. The actual values are 100 mS of ON time and 15 mS of OFF
time. When playing a pre-recorded sequence of tones, a PAUSE time is added
between successive tones. This time is equal to the ON time of the tone. Also, the high
and low frequency of the DTMF tone are separated by 8 dB. The high frequencies are
reduced in magnitude relative to the low frequencies by 8 dB.
3.4.3.3
UART RECEIVE INTERRUPTS
Single DTMF tones may also be played by entering numeric characters (0-9) on the PC
keyboard during the HyperTerminal session. The UART receives this keyboard
character, and a receiver interrupt communicates this data to the DCI to start a tone
generation process.
3.4.3.4
UART TRANSMIT INTERRUPTS
Every 1.14 seconds, data is transmitted via the UART to the HyperTerminal session
window. Four bytes are loaded at a time in the Transmitter Buffer registers. The term
“data” refers to the following:
• Analog data such as RP1, RP2 and RP3
• Temperature sensor data
• FFT frequency and bin number of the sampled input sine-wave signal
• Cycle count information for the FFT, FIR or IIR algorithms
• Chosen Filter Type – IIR, FIR or None
3.4.3.5
SPI INTERRUPTS, DIGITAL POT AND THE LCD CONTROLLER
The SPI 2 module is used to perform two functions:
• When the demo code is waiting for the ADC to collect 256 samples of data on pin
AN3, the SPI 2 module is used by the Timer1 ISR to transmit sine-wave samples
to the MCP41010 every 125 microseconds at a data rate of 230 kHz.
• When code execution reaches the DSP stage (i.e., filtering, FFT etc.) the SPI 2
module is used to send data to the PIC18F242 LCD controller on the expansion
board at a data rate of 921.6 KHz (F
CY
/8). The LCD has a 4 row x 20-character
display. All 80 characters are refreshed by the SPI 2 module.