ADC and DAC of a sine wave in PIC18f452

Status
Not open for further replies.

mehrab ramzan

New Member
hi all,
I want to do adc in pic18f452. For verification i am applying a sine wave(amplitude=1v and frequency=2Hz) as an analog input to the pic and want to convert the digital output of pic again to analog sine wave using a dac0808
pic18f452 has a 10bit adc but i have adjusted the input voltage and Vref in such a way that digital output is in 8 bits.
I am using a 11Mhz crystal and MPLAB to build a hex file.
I tried to simulate it in proteus but the wave is not correctly reconstructed at the output.
Kindly help to identify the bug.
Attached are the files: 1) c code for adc(text file) 2)hex file 3)proteus design 4)MPLAB project and workspace
 

Attachments

  • adc files.zip
    25.4 KB · Views: 177
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…