measuring dc voltage giving output through dac

Status
Not open for further replies.

freemanantony

Member level 4
Joined
May 19, 2010
Messages
70
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Chennai, India
Visit site
Activity points
2,005
hai everybody,
i am using c8051350 controller in a board to measure dc voltage upto 600v and give DAC output proportionaly upto 9.22v maximum , while measuring voltages upto 60v the dac is giving output then it is getting reduced and after 300v the DAC is giving 0v output.the controller is having current output DAC we are converting it to voltage using resistor,what can be the reason can anyone help me?
 

rohit here is my code

void main (void)
{

PCA0MD &= ~0x40;//disable watchdog timer
initialise();
//present_voltage = 0x22;
while(1)
{
read_adc();
delay();
IDA1 = ((present_voltage)*(0x02));
delay();
//IDA1 = 0x90;
}
}

void read_adc()
{
//while(AD0BUSY);

while(!AD0INT); // Wait till conversion complete
AD0INT = 0; // Clear ADC0 conversion complete flag
present_voltage = ADC0L;
present_voltage = ADC0M;
present_voltage = ADC0H;

}
void adc_init(void)
{
REF0CN |= 0x01;
ADC0CN = 0x00;
ADC0CF = 0x00;
ADC0CLK = (SYSCLK/MDCLK)-1;
ADC0DEC = ((unsigned long) MDCLK / (unsigned long) OWR /
(unsigned long) 128) - 1;
ADC0MUX = 0x08;

ADC0MD = 0x83;
}
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…