---------------------------------\r
\r
**Syntax**\r
- **ADC** *Rdst, Sar_sel, Mux, Cycles*\r
+ - **ADC** *Rdst, Sar_sel, Mux*\r
+\r
+ - **ADC** *Rdst, Sar_sel, Mux, 0* — deprecated form\r
\r
**Operands**\r
- - *Rdst* – Destination Register R[0..3], result will be stored to this register\r
- - *Sar_sel* – selected ADC : 0=SARADC0, 1=SARADC1\r
+ - *Rdst* – Destination Register R[0..3], result will be stored to this register\r
+ - *Sar_sel* – Select ADC: 0 = SARADC1, 1 = SARADC2\r
- *Mux* - selected PAD, SARADC Pad[Mux+1] is enabled\r
- - *Cycle* – number of cycles used to perform measurement\r
\r
**Description**\r
The instruction makes measurements from ADC.\r
\r
**Examples**::\r
\r
- 1: ADC R1, 0, 1, 100 // Measure value using ADC1 pad 2,\r
- // for 100 cycles and move result to R1\r
+ 1: ADC R1, 0, 1 // Measure value using ADC1 pad 2 and store result into R1\r
\r
\r
**REG_RD** – read from peripheral register\r
stage_rst
measure:
/* measure and add value to accumulator */
- adc r1, 0, adc_channel + 1, 0
+ adc r1, 0, adc_channel + 1
add r0, r0, r1
/* increment loop counter and check exit condition */
stage_inc 1