WWW.STUDENTSFOCUS.
COM
DAC INTERFACING WITH ARM PROCESSOR
AIM
To interface and convert Digital to Analog using DAC in ARM processor.
APPARATUS REQUIED
1. ARM processor, EK-TM4C123GXL
2. Computer with energia software.
3. Voltmeter (0-20)v or Multimeter
4. Connecting wires
THEORY
Digital scale value in program is uploaded to ARM processor. This value is passed to
digital to analog converting pin using analog write program line, so equivalent digital value is
obtained at the output of that pin. This is monitored by Voltmeter connected across the same pin
with ground.
PROCEDURE
1. Connections are given as per the circuit diagram.
2. DAC energia program is loaded in ARM processor.
3. In circuit connect digital to analog pin to + terminal of voltmeter
4. Another end of voltmeter to be connected with ground.
5. Observe the respective analog voltage in voltmeter.
PROGRAM – FIXED VALUE INPUT OUTPUT
int digitalscalevalue =85; 85 1 volt
int analogpin=PB_2; 140 2 volt
void setup() 240 3 volt
{Serial.begin(9600);
pinMode(analogpin, OUTPUT);
}
void loop()
{
analogWrite(analogpin, digitalscalevalue);
Serial.println( digitalscalevalue);
}
PROGRAM - VARIABLE VALUE INPUT OUTPUT
int digitalscalevalue =0; 5 0.1 volt
int addvalue = 5; 10 0.2 volt
int analogpin=PB_2; 15 0.3 volt
void setup() . .
{ . .
pinMode(analogpin, OUTPUT); 255 3.3 volt
}
void loop()
{
analogWrite(analogpin,digitalscalevalue);
WWW.STUDENTSFOCUS.COM
delay(30);
digitalscalevalue = digitalscalevalue +
addvalue;
if (digitalscalevalue ==255 )
{
digitalscalevalue =0;
}
}
CIRCUIT DIAGRAM
RESULT
Thus the Conversion of Digital to Analog is performed and verified with ARM processor
successfully.