Experiment 1
Experiment 1
Task :-
To develop an Embedded system in Proteus interfacing ADC-0808 and DAC-0808 with 8051-MC using
Keil software. RTOS Structured code is developed and the attenuations and distortions of the recovered
sinusoid is studied for various frequencies of the input sinusoid.
Components used :-
Schematic diagram :-
Assembly code :-
;including libraries
$NOMOD51
$INCLUDE (80C52.MCU)
;definitions
AD_op equ P0
ALE equ P3.5
SOC equ P3.4
EOC equ P3.2 ; external interrupt 0
DA_ip equ P2
Ex_edge equ TCON.0 ; to set external interrupt 0 as edge trigger
;variables
IE_val equ 81h ; to enable external interrupt 0
T2mod_val equ 02h ; to set as up programmable clock output and T2OE enable
T2con_val equ 00h ; to set it in 16 bit autoreload mode without TR2 and programmable clock out
RCAP_valL equ 0FCh ; lower byte of timer value for 691kHz clock out at T2 pin with 11MHz clock
RCAP_valH equ 0FFh ; higher byte
;reset vector
org 0000h
sjmp Start
org 0003h
sjmp ADC_ISR
ADC_ISR:push ACC
mov A, AD_op
mov DA_ip, A
setb ALE ; start ADC
setb SOC
clr ALE
clr SOC
pop ACC
reti
;code ends here
Oscilloscope view at different frequencies :-
1. At 50 Hz
2. At 100 Hz,
3. At 200 Hz,
4. At 400 Hz,
5. At 600 Hz,
Conclusion :-
From the above observation, it can be concluded that for frequencies above and around 400 Hz,
appreciable distortions are observed in the recovered sinusoidal signal.
Prepared by:-
K Santanu Sekhar Senapati
Roll No. – 118EE0577