Pages

Converters on TI MSP430

Digital-to-Analog Converter on TI MSP430

 

Summary: Explains how the digital-to-analog converter works on the MSP430.

 

The MSP430F169 is equipped with two digital to analog converters (DACs) on general I/O port 6. A DAC converts an unsigned integer into an analog voltage within the capacity of the MSP. As in all cases with the MSP, the complete details are found in the MSP430 Family User’s Guide from the Texas Instruments website www.ti.com.

Voltage Range and Precision

Unlike the ADC on the MSP, the DACs have variable bit precision of either 8 or 12 bits. The range is also controllable as either one or three times the voltage reference. The voltage reference is also selectable. All bits for controlling voltage reference, scaling, and precision can be found in the DAC12 Control Register (DAC12_xCTL). In most cases, 12 bit precision is desirable.
In the MSP430 architecture there are two general sources for a voltage reference: VeRef and Vref. VeRef is an externally supplied voltage, but Vref is generated by the MSP itself. Because the 226 board does not provide the MSP with a VeRef voltage, the only voltage reference available for the DAC and ADC is the Vref. This restricts the choices for the SREF bits of the DAC control register to the Vref choice. Additionally, the Vref voltage reference for the DAC comes from the ADC module. This means that it is necessary to turn on the voltage reference in the ADC control register (ADC12CTL0) with the REFON bit.

Operating Modes

The DAC competes with two of the ADC channels for access to the pins of I/O Port 6. Unlike most peripheral controls on the MSP430, the DAC’s access to the pins is not controlled by the PxSEL register. Instead, the DAC is multiplexed with the ordinary port control and will drive the output if the DAC12AMPx bits are set to any value greater than zero. The DAC12AMPx bits in the control registers also determine the mode of the DAC’s operation.
  • Mode 000 The input buffer is off. The DAC is off, and the output buffer is high impedence.
  • Mode 001 The input buffer is off. The DAC is off, and the output buffer is 0V.
  • Modes 010 - 111 Each step in mode increases the power consumption of the DAC while improving the settling time of the module.
The two most useful modes for these labs are modes 000 and 111. Because our devices are not battery powered, we can afford the power consumption to improve speed. Mode 000 is needed to turn off the module when necessary.

Using the DAC

The basic method of DAC operation is to load the DAC12_xDAT. Using the DAC12LSELx bits of the control register, the actual trigger for the output is set. The device can be figured to output whenever the data register is written to, whenever the data register is written and the DAC enable is set, or according to timers A or B. It is necessary to change the mode out of SEL mode 0 in order to use the interrupts with the DAC.
The DAC can be interrupt enabled via the DAC control register and the interrupt enable registers. The flag is set whenever a conversion is complete. Also, the DAC outputs can be grouped together to ensure that the output of both DACs appears simultaneously. When the units are grouped, both DAC12_xDAT registers must be written before the outputs will appear. The device does not check whether you have changed the value; updating with the same information will still work.

Analog-to-Digital Converter on the MSP430

 

Summary: Explains how to use the MSP430 analog-to-digital converter (ADC).

 

The analog to digital converter (ADC) on the ez430 is a type called a Sigma-Delta (SD) Converter. The way it operates is slightly different from what was described in the previous section (although the end result is the same) but those specifics are out of the scope of this course. The SD converter on the ez430 has 8 channels and a 16 bit resolution. The module is highly configurable and can run largely free of program involvement. In this portion of the lab, we will broadly explain the features of the module, but the particular effects of each register are listed, as usual, in Chapter 12 of the User’s Guide.

Range of Measurement

The result of each conversion will be 16 bits long in the form of an unsigned integer whose value is:
SD16_MEMx=(65,536)
VinVrneg
VrposVrneg
(1)
Where Vin is the input voltage to be measured, Vrneg is the lower reference voltage, and Vrpos is the higher reference voltage. The reference voltages are set to power and ground by default, but they can be changed to an internal reference generator or an externally supplied reference using the SD16CTL register.

Input Channels for the ADC

The following is a table of the 8 input channels on the ez430. "Analog signal input" channels will take any analog source (we will get to the pin mapping's shortly). Other channels perform specific tool integrated tasks. For example, channel A6 is an integrated temperature sensor. For detailed descriptions of the others, see the User's Guide.

SD16 Input Channels

  1. A0: Analog signal input
  2. A1: Analog signal input
  3. A2: Analog signal input
  4. A3: Analog signal input
  5. A4: Analog signal input
  6. A5: 
    VccVss
    11
  7. A6: Integrated temperature sensor
  8. A7: Short for PGA offset measurement
Here is a pin diagram corresponding to the 14 accessible pins showing which pins correspond to which input channels. Notice that each channel has a "+" and a "-" input. Although with other ADC's, we would simply have one input pin and connect the other to the ground, the SD converter requires us to connect the positive and negative inputs to the corresponding input channels. Note that the numbers from 1-14 on the chip correspond to pins 1-14 on the target board.
Figure 1: Shows which pins correspond to specific SD converter inputs. Also shows which pins correspond to specific ports (i.e pin 4 is connected to P1.2).
Pin Map
Pin Map (PinMap.png)

Operation Reminders for the ADC

Remember the following when attempting to use the ADC:
  • Be sure to enable SD16 interrupts (on SD16CCTL0) and to select the specific channel which you are using (onSD16INCTL)
  • After configuring the ADC, you must enable the SD16SC bit to start conversion.
  • All ADC values will be stored in the SD16MEMx variable where "x" is the number of the channel
The User's Guide will be very useful for this lab because of the complexity of this part of the MSP430. Be sure to go over the chapter atleast briefly before jumping into programming.
 

 

0 comments:

Post a Comment

Share your knowledge

Related Posts Plugin for WordPress, Blogger...

Popular Projects

program for Dual DAC 8051 Microcontroller Based DC Motor Control A Microcontroller Based Turbidity Meter A m -Controller Based Thermostat ASCII to BCD conversion in 8051 AT90LS8515 Digital Message Machine Audio Frequency Response Analyzer Audio Homing Robot Automated Juice Mixer Automated Pet Feeder Autonomous Car Autonomous Parallel Parking RC Car Autonomous Search Robot Autonomous Tank Autonomous Vehicle Contrast Following Rover Autonomous navigating robot BCD number to ASCII in 8051 Balance Bot Blind Bot Blood Pressure Monitor Bloodshed Dev-C++ 5 Compiler/IDE Breath Alcohol Tester Converters on TI MSP430 CrossStudio MSP430 IDE Design of a Real-Time Digital Guitar Tuner Digital Oscilloscope Digital Stethoscope Digital clock project using PIC16C54A microcontroller Digital thermometer ECG monitoring system GPS Data Logger with Wireless Trigger Handwriting Recognition Systm Home Security System Home energy managment IAR Embedded Workbench IDE INFRARED TRACKING SYSTEM IntelliBOT Laser Communications System Line following van MSP-EXP430FG4618 Development Tool and the eZ430 kits MSP430FG4618 device implement a Buzzer tone generator MSP430FG4618 device implement a Real Time Clock MSP430FG4618 device implement a voltage ramp generator MSP430FG4618 device present a message on the LCD Basic Microcontroller(8051) Lab Mivo- RFID based mobile payment system Multi-Zone Fire Alarm System PC based temperature control PIC 16f877 RPM Meter PIC16C54 dual dice electronic project circuit PIC16F84A digital thermometer microcontroller project PIC16F886 horn driver PWM motor contoller with MSP430 Program Block data transfer in 8051 Program to add two BCD numbers in 8051 Program to check whether a 4th bit of a byte is 1 Program to convert ASCII to hex in 8051 Program to count from 0-9 in 8051 Program to count number of 1's in a given data byte in 8051 Program to divide an 8 bit no by another 8 bit number in 8051 Program to find largest of n numbers in 8051 Program to find the LCM of two numbers in 8051 Program to find the square of an 8 bit number in 8051 Program to generate 50msec delay in 8051 Program to implement BCD counter to count from 0-99 in 8051 Program to implement BCD counter to count from 99-0 in 8051 Program to interchange two blocks of data in 8051 Program to multiply 16 bit number by 8 bit number in 8051 Program to search an element in an array in 8051 Program to sort an array of 10 elements in 8051 Programming the ez430 Proximity Security System RAMP wave in 8051 RC Car Controller RObo Dog Radio-controlled Truck Retina color tracker Robotic Arm Controller with GUI Robotic Car Traction Control Safety-sensor vehicle Security Entrance System Self-Powered Solar Data Logger Snake Arm Ultrasonic Positioning Control System Store FFh if 1 Super Train Controller TI MSP430 Microcontrollers Timers on the MSP430 TouchPad Drawing Board Ultra-Sonic Parking Assistant Ultrasonic Parking Controller Ultrasonic Range finder Voice Activated Alarm Clock Voice Recognition Robotic Car Voting Machine Weather Station Web-Monitored Thermostat Wireless Drawing Device Wireless Telemetry Wireless message Communicator Write a C program to display the code of the key pressed in 8051 Zigbee Wireless Relay Control and Power Monitoring System add two multibyte numbers in 8051 convert a decimal number to hex number in 8051 convert an 8bit Hex number to decimal number in 8051 convert hex number to ASCII number in 8051 eZ430-F2013 Development Tool use SD16_A ADC eZ430-RF2500 Development Tool use ADC10 else store 00 in the same location in 8051 find the GCF of two numbers in 8051 find the average of 10 numbers in 8051 generate Fibonacci series in 8051 metal detector project microcontroller using IAR Embedded Workbench program for Elevator Interface in 8051 program for Stepper motor interface in 8051 spectrum analyser square wave in 8051 triangle wave in 8051 voice recognition security system

Sites U missed

Hint

Open Pictures in new page by right click on it, if it is not shown full image.