Hi, Can any body help me how to calculate the DAC code that to be loaded in to DAC0L and DAC0L to obtain a variable voltage reference for ADC in the runtime??? rgds Deepak
"The data sheet says you can change the value of ADC0H and ADC0L in order to change the output voltage. " You mean DAC0H and DAC0L. The datasheet says: "Each DAC has an output swing of 0V to (VREF-1LSB) for a corresponding input code range of 0x000 to 0xFFF." ie, an input code of 0x000 gives an output voltage of 0V; an input code of 0xFFF gives an output voltage of (VREF-1LSB). Input values between 0x000 and 0xFFF give output voltages in linear proportion between those two limits. The Input value is the "Digital" part of "Digital-to-Analogue" Note that the Input values are 12 bits - that's why two 8-bit registers are required; called DAC0L and DAC0H. Because there are two separate registers, you cannot write the 12-bit Input value in one go - so there has to be some way to define when the whole values is complete, so that the analogue output can be allowed to change. The datasheet defines the options for this. Hope that helps...
Dear Mr.Andy Neil, Thank you very much for your kind help Regards, Deepak