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
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?
Thanks for ur support actualy i did the simple mistake now im getting correct output
You should write your fix here so that others can learn from your mistake.