ADC12 Operation
17-19
ADC12
ADC12 Interrupt Handling Software Example
The following software example shows the recommended use of ADC12IV
and the handling overhead. The ADC12IV 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:
-
ADC12IFG0 - ADC12IFG14, ADC12TOV and ADC12OV
16 cycles
-
ADC12IFG15
14 cycles
The interrupt handler for ADC12IFG15 shows a way to check immediately if
a higher prioritized interrupt occurred during the processing of ADC12IFG15.
This saves nine cycles if another ADC12 interrupt is pending.
; Interrupt handler for ADC12.
INT_ADC12
; Enter Interrupt Service Routine
6
ADD
&ADC12IV,PC; Add offset to PC
3
RETI
; Vector 0: No interrupt
5
JMP
ADOV
; Vector 2: ADC overflow
2
JMP
ADTOV
; Vector 4: ADC timing overflow
2
JMP
ADM0
; Vector 6: ADC12IFG0
2
...
; Vectors 8-32
2
JMP
ADM14
; Vector 34: ADC12IFG14
2
;
; Handler for ADC12IFG15 starts here. No JMP required.
;
ADM15
MOV
&ADC12MEM15,xxx ; Move result, flag is reset
...
; Other instruction needed?
JMP
INT_ADC12
; Check other int pending
;
;
ADC12IFG14-ADC12IFG1 handlers go here
;
ADM0
MOV
&ADC12MEM0,xxx ; Move result, flag is reset
...
; Other instruction needed?
RETI
; Return
5
;
ADTOV
...
; Handle Conv. time overflow
RETI
; Return
5
;
ADOV
...
; Handle ADCMEMx overflow
RETI
; Return
5
Summary of Contents for MSP430x1xx
Page 1: ... 2005 Mixed Signal Products User s Guide SLAU049E ...
Page 6: ...vi ...
Page 18: ...1 6 Introduction ...
Page 36: ...2 18 System Resets Interrupts and Operating Modes ...
Page 112: ...3 76 ...
Page 130: ...4 18 Basic Clock Module ...
Page 152: ...5 22 Flash Memory Controller ...
Page 160: ...6 8 Supply Voltage Supervisor ...
Page 168: ...7 8 Hardware Multiplier ...
Page 192: ...8 24 ...
Page 200: ...9 8 Digital I O ...
Page 234: ...11 24 Timer_A ...
Page 260: ...12 26 Timer_B ...
Page 291: ...13 31 USART Peripheral Interface UART Mode ...
Page 314: ...14 23 USART Peripheral Interface SPI Mode ...
Page 346: ...15 32 USART Peripheral Interface I2C Mode ...
Page 358: ...16 12 Comparator_A ...
Page 386: ...17 28 ADC12 ...
Page 418: ...18 32 ADC10 ...
Page 432: ...19 14 DAC12 ...