2
\$\begingroup\$

I'm doing a DSP project using the MSP430. I want to take an analog signal and convert it to a digital output using a microcontroller attached to an ADC on a DSP board. How would I program this in C?

  Input  -->  Output
 Analog  --> Digital
Digital  -->  Analog
\$\endgroup\$

closed as too broad by Nick Alexeev May 17 at 0:04

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ I dont think any one will code it for you =, but you may want to try the 43oh.com forums for code examples using the ADC on the msp430 line of chips. \$\endgroup\$ – jsolarski Dec 25 '10 at 18:58
  • \$\begingroup\$ Thanks for the site, i actually have found some useful information. \$\endgroup\$ – Martin Dec 25 '10 at 19:27
4
\$\begingroup\$

This is the case where reading the datasheet is truly the best thing for you to do -- they will tell you exactly how to initialize, start [and stop], and use both an ADC and DAC. Since you haven't named a specific MSP430, ADC chip, or analog signal characteristics, I'm guessing that the design is very much in the initial planning stages. I suggest nailing down some requirements for each block in your system diagram, looking for parts that will do those things, then reading their datasheets. Examples of requirements would be sampling rate/frequency (remember Nyquist) and depth (in bits, which can be translated from Volts); you can get an MSP430 with a 12-bit ADC and DAC on the chip. Something else is peripheral support: are you using a user interface? Comparators or trigger interrupt pins, used with hardware timers, are great for interfacing with and debouncing buttons; SPI, UART or I2C/TWI are serial protocols used to drive a screen. Note that there are a variety of ways to generate analog signals -- no need to limit searches to DAC peripherals or ICs: given some parameters, such as ripple and precision, you can determine what frequency and number of bits to use to do PWM with a single (or two) pins. You can also use a traditional R2R DAC, but make the LSB a PWM output to give you both R2R resistor calibration as well as additional precision.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.