ADC DAC External Memory(RAM)

This is what I am assigned to do, what are the aim

  • Generate Sinewave through DAC (why not PWM?)
  • Read the sinewave(through ADC810)
  • Save the values in a 32KB Ram.

And the tradeoffs are

  • Generate the highest frequency which will lead to impure sinewave.
  • DAC and ADC speed must match.
  • Simultaneously i have to save the data in RAM

 
 

The microcontroller U5 (AT89C51) is generating sinewave, loaded with the following code

#include<reg51.h>

void delay(int k)

{int i,j=k*10;

for(i=0;i<j;i++)

{}

}

main()

{

while(1)

{

    /*

P1=0x01;delay(5000);

P1=0x00;delay(5000);

P1=0x80;delay(5000);

P1=0x00;delay(5000);

*/

// P1=0x80; //delay(3); //10

// P1=0x96;//delay(3); //20

//P1=0xAB;//delay(3); //30

// P1=0xC0; //delay(3);     //40

// P1=0xD2; //delay(3); //50

P1=0xE2;    //delay(3);     //60

// P1=0xEE;    //delay(3);        //70

// P1=0xF8; //delay(3);    //80

//P1=0xFE; //delay(3); //90

//P1=0xFF; //delay(3);         //100

//P1=0xFE;     //delay(3);

P1=0xF8;    //delay(3);          //120

 

//P1=0xEF; //delay(3);

//P1=0xE2;//delay(3);

//P1=0xD2;//delay(3);         //150

//P1=0xC0; //delay(3);

// P1=0xAB; //delay(3);

P1=0x96;    //delay(3);         //180

//P1=0x80;    //delay(3);

//P1=0x69; //delay(3);

//P1=0x54; //delay(3);         //210

//P1=0x40; //delay(3);

//P1=0x2D;     //delay(3);

P1=0x1D;    //delay(3);     //240                

//P1=0x11;//delay(3);

//P1=0x07;//delay(3);

//P1=0x01; //delay(3);     //270

//P1=0x00; //delay(3);

//P1=0x01;    //delay(3);

P1=0x07;    //delay(3);     //300

//P1=0x11; //delay(3);

//P1=0x1D;//delay(3);

//P1=0x2D;//delay(3);     //330

// P1=0x40; //delay(3);

// P1=0x54; //delay(3);

P1=0x69;    //delay(3);     //360

 

                            

     /*

     P1=0x80;

     P1=0xC0;

     P1=0xEE;

     P1=0xFF;

     P1=0xEE;

     P1=0xC0;

     P1=0x80;

     P1=0x40;

     P1=0x11;

     P1=0x00;

     P1=0x11;

     P1=0X40;

     */

}

}

And the U1 doing 2 jobs one is to read the sinewave through a ADC810 and other is two save sinewave data to a external RAM 32KB. U1 loaded with following code

Published by

ASIM MAHAKUL

Hello, I am Asim admin of this blog. An expert in Scientific Instrumentation (Analytical Instrumentation). My works are always associated with both Physics and electronics. Currently working on ARM based embedded systems for Optical(UV and Visible) and electrochemical spectroscopy (EIS). My M.Tech. Thesis was related to all these things. I had worked for a 8 bit microcontroller based standalone EIS (electrical impedance spectroscopy) device. I have Masters in Instrumentation engineering from NIT Kurukshetra,Haryana and Masters in Electronics Science from Sambalpur University, Odisha (Formerly Orissa/Utkal) Am also work for PHP MySQL AJAX based CMS design. i love blogging and coding(am not an expert).

Leave a Reply