3 \author Scott Livingston
5 \brief Prototypes for ADC application. Note that this code was
6 written only with the x2274 chip and GoodFET31 in mind;
7 specifically, pin 5 of the (JTAG) header is sampled.
8 Supporting x2618, x1611/12 and other GoodFET boards remains!
9 For timing considerations, see at least Section 20.2.5
10 "Sample and Conversion Timing" (on page 589?) of msp430x2xx
24 //! Initialize ADC10 module (specific to 2xx chip family).
27 //! Uninit/stop ADC10 module (specific to 2xx chip family).
30 //! Return a single, instantaneous sample.
33 //! Fill cmddata string; sampling repeatedly at a fixed rate.
34 u16 nsamples_adc10( u8 N_count, //! Number samples to obtain (bounded w.r.t. cmddata)
35 u8 t_sample, /*! sample-and-hold time; this is
36 written directly to ADC10SHTx
37 field of ADC10CTL0 register;
42 11 64 ADC10CLK ticks. */
43 u8 clock_div ); /*! Value by which to divide SMCLK
44 (which is assumed to be 16
47 Possible values are 1..8
48 Cf. Fig. 20-1 (on page 585?)
49 of the msp430x2xxx family
54 #define ADC10_INIT 0x81 //! Initialize ADC10 module (i.e., get ready for sampling).
55 #define ADC10_UNINIT 0x82 //! Uninitialize (or "stop") ADC10.
56 #define ADC10_1SAMPLE 0x83 //! Capture a single sample.
58 /*! Capture a sequence of samples at a constant rate and write result
59 till requested number of samples is acquired or cmddata array is
60 filled, whichever is smaller. Hence, in the maximum length case,
61 (CMDDATALEN-4)/2 10-bit samples are obtained (128 total using
64 The command has several possible formats, switched according to
65 the length of received command data (from client). See above
66 comments about nsamples_adc10 function for meaning of ``t_samlpe''
69 length 0 => max sample sequence length, t_sample = 3, clock_div = 8;
70 1 => user-specified sequence length, t_sample = 3, clock_div = 8;
71 3 => user-specified length, t_sample and clock_div. */
72 #define ADC10_NSAMPLE 0x84
74 extern app_t const adc_app;