An example of the AD12 notes and use of MSP430.

xiaoxiao2021-03-06  23

The AD12 of the MSP430 is flexible and powerful. I am particularly concluded in the process of learning, and I will be convenient to come back later, huh, huh.

1. AD12 (12-way input channel (8 external input channel, 4 internal input channels), 4 modes)

(1) Register:

A. Conversion control: ADC12CTL0, ADC12CTRL1

B. Interrupt control: ADC12IFG, ADC12IE, ADC12IV

C Storage Control Class: ADC12MCTL0 - ADC12MCTL15 (8-bit register, each register corresponds to an ADCMEM12X, define reference voltage and channel)

D. Memory class: ADC12MEM0 - ADC12MEM15

(2) Four working modes

A. Single-channel single conversion

B. Single channel multiple conversion

C. Multi-channel (sequence) single conversion

D. Multi-channel (sequence) multiple conversion

(3) ADC12CTL1 has two and clock-related settings:

A.SHS: (0-4) Sampling Input Signal Source Select Control Bit. AD sampling clock.

B.Adc12Ssel: (0-3) ADC12 core clock.

Special attention to the difference between the two.

(4) The ADC12 is completely automated in the AD conversion, so most of the interrupt handler is processed in multiple transitions.

It is necessary to learn more in learning, as follows is an example of single-channel single conversion. Different working modes require different work markers (0-3).

/ * MSP430 ADC12 single-channel single conversion * /

#include #define adcmem ((int *) 0x0140)

转载请注明原文地址:https://www.9cbs.com/read-40585.html

New Post(0)