Interfacing Adc and Dac With Arm
Interfacing Adc and Dac With Arm
No:
DATE : INTERFACING ADC AND DAC WITH ARM
AIM
To develop a C-Language program for reading an on-chip ADC, convert into decimal and to display it in
PC and to generate a square wave depending on this ADC reading using ARM processor.
4. CRO
THEORY
ADC
Three 12-bit analog-to-digital converters are embedded and each ADC shares up to 16 external channels,
performing conversions in the single-shot or scan mode. In scan mode, automatic conversion is performed on a
selected group of analog inputs.
Additional logic functions embedded in the ADC interface allow:
Simultaneous sample and hold
Interleaved sample and hold
PROCEDURE
The two 12-bit buffered DAC channels can be used to convert two digital signals into two analog voltage signal
outputs.
This dual digital Interface supports the following features:
Two DAC converters: one for each output.
Channel 8-bit or 12-bit monotonic output.
Left or right data alignment in 12-bit mode.
Synchronized update capability.
Noise-wave generation.
Triangular-wave generation.
Dual DAC channel independent or simultaneous conversions.
DMA capability for each channel.
External triggers for conversion.
Input voltage reference VREF+.
Eight DAC trigger inputs are used in the device. The DAC channels are triggered through the timer update
outputs that are also connected to different DMA streams.
PROCEDURE
PROGRAM
/*Header Files*/
#include "stm32f4xx.h"
#include <stdio.h>
/*Declarations*/
int ConvertedValue = 0;
/*Main Routine*/
int main(void)
{
USART2_config();
adc_configure();
dac_configure();
while(1)
{
ConvertedValue = adc_convert(); //Read the ADC converted value
printf("\n\r ADC value => %d",ConvertedValue); //print the ADC value
DAC->DHR12R1 =ConvertedValue; //Move the Digital value to DAC
}
}
1 Preparation 2
2 Interest and
2
Involvement
4 Viva-Voce 2
Total 10
Date Sign