SD16 Operation
27-18
SD16
SD16 Interrupt Handling Software Example
The following software example shows the recommended use of SD16IV and
the handling overhead. The SD16IV value is added to the PC to automatically
jump to the appropriate routine.
The numbers at the right margin show the necessary CPU cycles for each
instruction. The software overhead for different interrupt sources includes
interrupt latency and return-from-interrupt cycles, but not the task handling
itself. The latencies are:
-
SD16OVIFG, CH0 SD16IFG, CH1 SD16IFG
16 cycles
-
CH2 SD16IFG
14 cycles
The interrupt handler for channel 2 SD16IFG shows a way to check
immediately if a higher prioritized interrupt occurred during the processing of
the ISR. This saves nine cycles if another SD16 interrupt is pending.
; Interrupt handler for SD16.
INT_SD16
; Enter Interrupt Service Routine
6
ADD
&SD16IV,PC; Add offset to PC
3
RETI
; Vector 0: No interrupt
5
JMP
ADOV
; Vector 2: ADC overflow
2
JMP
ADM0
; Vector 4: CH_0 SD16IFG
2
JMP
ADM1
; Vector 6: CH_1 SD16IFG
2
;
; Handler for CH_2 SD16IFG starts here. No JMP required.
;
ADM2
MOV
&SD16MEM2,xxx
; Move result, flag is reset
...
; Other instruction needed?
JMP
INT_SD16
; Check other int pending
2
;
; Remaining Handlers
;
ADM1
MOV
&SD16MEM1,xxx
; Move result, flag is reset
...
; Other instruction needed?
RETI
; Return
5
;
ADM0
MOV
&SD16MEM0,xxx
; Move result, flag is reset
RETI
; Return
5
;
ADOV
...
; Handle SD16MEMx overflow
RETI
; Return
5
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...