An 8bit 20 us 20e6 s bipolar ADC with reference voltage Vr5V

An 8-bit, 20 us (20e-6 [s]) bipolar ADC with reference voltage Vr=5[V] will monitor a sinusoidal signal with peak voltage of 3[V]. What is the maximum frequency that can be tracked to 8-bit % accuracy? Plot the maximum (trackable) frequency VS number of bits accuracy used in ADC. Assume that the range of number of bits is (8, 9, ..., 32) Also assume that the tc values of the ADC are proportional to the number bits of the ADC. Use \"semilogy\" function when plotting for readability

Solution

#include <REGX51.H>
#include<stdio.h>
#include<string.h>

sbit INTR = P3^5;
sbit RD_ADC = P2^4;
sbit WR_ADC = P2^3;
sfr MYDATA = 0x80;        //Port-0
sfr LcdData = 0x90;        //Port-1
sbit RS = P2^5;
sbit RW = P2^6;
sbit EN = P2^7;
void lcdcmd(unsigned char value);
void lcddata(unsigned char value);
void lcdstr(unsigned char msg[]);
void Delay(unsigned int itime);
void SerTX(unsigned char x);
void SerTX_str(unsigned char msg[]);
unsigned char msg[] = \"VOLTAGE --->\";
void main()
{
    unsigned int temp;
    int hundreds,tens,ones;
    unsigned char buffer[10];
    TMOD = 0x20;    //Timer-1, 8-Bit Auto Reload Mode
    TH1 = 0xFD;        //9600 Baud Rate When Crystal Used is 11.0592MHZ
    SCON = 0x50;
    TR1 = 1;        //Start Timer
    MYDATA = 0xFF;    //Making P1 as Input Port
    INTR = 1;
    RD_ADC = 1;        //Set RD high
    WR_ADC = 1;        //Set WR high
    lcdcmd(0x38);
    Delay(1);
    lcdcmd(0x0E);
    Delay(1);
    lcdcmd(0x01);
    Delay(1);
    lcdcmd(0x80);
    lcdstr(\"VOLTAGE\");
    lcdcmd(0x0C);
    while(1)
    {     
        lcdcmd(0xC0);                                                                
        WR_ADC = 0;        //Send WR Pulse
        Delay(1);
        WR_ADC = 1;        //Low-High Pulse means Start of Conversion
        while(INTR == 1);    //Wait until End of Conversion
        //When Conversion Gets Completed the INTR Pin Goes Low we get out of the Loop
        RD_ADC = 0;        //Send RD Pulse
        temp = MYDATA * 2;
        //Conversion Process Starts Here        
            ones = temp%10;
            temp = temp/10;
            tens = temp%10;
            hundreds = temp/10;
            sprintf(buffer,\"%d.%d%d Volts\",hundreds,tens,ones);
            lcdstr(buffer);
            SerTX_str(msg);
            SerTX_str(buffer);
            SerTX(13);
            SerTX(13);
            Delay(10);
            Delay(10);
            RD_ADC = 1;
    }
}
void lcdcmd(unsigned char value)
{
    LcdData = value;
    RS = 0;
    RW = 0;
    EN = 1;
    Delay(1);
    EN = 0;
}
void lcddata(unsigned char value)
{
    LcdData = value;
    RS = 1;
    RW = 0;
    EN = 1;
    Delay(1);
    EN = 0;
}
void Delay(unsigned int itime)
{
    unsigned int i,j;
    for(i=0;i<1275;i++)
    for(j=0;j<itime;j++);
}
void lcdstr(unsigned char msg[])
{
    unsigned short int len,i;
    len = strlen(msg);
    for(i=0;i<len;i++)
    {
        lcddata(msg[i]);
        Delay(1);
    }
}
void SerTX(unsigned char x)
{
    SBUF = x;
    while(TI == 0);
    TI = 0;
}
void SerTX_str(unsigned char msg[])
{
    unsigned short len,i;
    len = strlen(msg);
    for(i=0;i<len;i++)
    {    
        SerTX(msg[i]);
    }
}

That\'s all, for more information contact us at  matlab.academy@gmail.com

 An 8-bit, 20 us (20e-6 [s]) bipolar ADC with reference voltage Vr=5[V] will monitor a sinusoidal signal with peak voltage of 3[V]. What is the maximum frequenc
 An 8-bit, 20 us (20e-6 [s]) bipolar ADC with reference voltage Vr=5[V] will monitor a sinusoidal signal with peak voltage of 3[V]. What is the maximum frequenc
 An 8-bit, 20 us (20e-6 [s]) bipolar ADC with reference voltage Vr=5[V] will monitor a sinusoidal signal with peak voltage of 3[V]. What is the maximum frequenc

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site