Hi i am using anolog device aduc812 microcontroller i tryed to accesses buit in adc with out giving input i am getting output 0xFFF i.e maximum value in all channel except channel 8 ie temp sensor.taht gives some value ie 423 what is the problem please help me
"with out connecting means it should be give output 0x00"
Because the datasheet specifies this behavior, or because you think that it is logical?
Without anything connected, the input may be very high-impedive (and normally is) so tiny leak currents may charge the input and make the input float to +VCC.
So, did you test what happens if you do connect a voltage source, or at least a resistance (possibly quite big) from the input to ground?
i connected -ve terminal of power supply to input and +ve to ground it show some value for fraction of second then once again it shows to maximum value i.e 0xfffh
please tell me adc output is in BCD or HEX formate
You connected a negative voltage to the input?
How many volt did you connect?
The datasheet specifies as absolute maximum ratings -0.3V and up to VDD + 0.3V.
If you connected a voltage lower than -0.3V, then you may have permanently killed that input - or possibly all inputs.
The datasheet will know. But shy do you think about BCD? A 12-bit unipolar ADC as a binary range of 0x000 to 0xfff, and you claimed that you read 0xfff.
actualy i connected 3.3 volt battery
But you did connect the + of the battery to ground, and the - of the battery to the ADC input?
That would represent -3.3V on the input, and the absolute limit is -0.3V - i.e. you did connect a 11 times as high voltage as allowed. That is more than enough to kill the input unless you had a resistor with a very high value in series.
By the way - have you connected AVCC to a suitable voltage? If AVCC is low, all inputs will most probably also also show 0xfff.
MAIN(void) { call ADC_START; //DO SOME WORK // CALL RETRIVEDATA; } // ADC ISR ORG 0033H MOV A,ADCDATAL CALL DISPLAY MOV A,ADCDATAH CALL DISPLAY IRET ADC_START: MOV ADCCON1,#07CH MOV ADCCON2,#08H SETB EA ; enable interrupts SETB EADC ; enable ADC interrupt SETB SCONV RET
What language is that?
You have a main() - but spelled with capitals - that directly calls assebler.
You initialize an interrupt without having an interrupt handler?
What was your intention with your post?
it is part of program
If AVCC is low, all inputs will most probably also also show 0xfff.
But that's not what he sees. He has one channel reporting 0x4??. So he either has some AVCC connected, or his chip can work without it.
No, it's not. There's no program this could be "part" of. It might be referred to as "clippings", at best.
And there are lots of things wrong even with these small clippings. You totally confuse C and assembler language, and to add insult to injury, neither the C nor the asm is written particularly well. For example you should not call asm functions from the middle of C code without a much better reason than is apparent in those clippings --- and even if you do, you don't do it by issuing a verbatim asm CALL instruction.
CSEG AT 0 USING 0 JMP START ORG 100 START:NOP UP:NOP call ADC_START; //DO SOME WORK // CALL RETRIVEDATA; JMP UP // ADC ISR ORG 0033H MOV A,ADCDATAL CALL DISPLAY MOV A,ADCDATAH CALL DISPLAY IRET ADC_START: MOV ADCCON1,#07CH MOV ADCCON2,#08H SETB EA ; enable interrupts SETB EADC ; enable ADC interrupt SETB SCONV RET END
I connected .7 volt stil showing output 0xfff
On the same input that you previously connected to -3.3V, and that may be burned to cinders right now?
Why do you have one label START and another label UP with a single nop between? can't you use the same label? And why do you think that you need a nop after the label?
You read out low and high byte of the ADC and perform separate calls to your display code (which you haven't shown). How do you expect your display code to know if it receives the high or low byte of data?
How have you deduced that you pick up the value 0xfff? By looking at the actual register contents in a debugger, or by assuming that your code is correct and will display the correct information on the display? Or did you use any other method?