We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I did the configuration for the ADC and use a 2V voltage supply as an analog input. But the LCD shows nothing. The board im using is C8051F206. The integrated ADC is 12bit. Also, Im using Port 1.7 as the analog input.
MOV AMX0SL,#2FH ; Selects P1.7 as the input MOV ADC0CF,#000H ; 1 system clock and 1 gain MOV ADC0CN,#0C1H MOV ADC0L, #000H ; ADC Data Word Register MOV ADC0H, #000H ; ADC Data Word Register MOV ADC0LTH, #000H ; ADC Less-Than High Byte Register MOV ADC0LTL, #000H ; ADC Less-Than Low Byte Register MOV ADC0GTH, #0FFH ; ADC Greater-Than High Byte Reg MOV ADC0GTL, #0FFH ; ADC Greater-Than Low Byte Reg
CONVERT: SETB ADBUSY ; starts conversion LCALL DELAY POLL: JB ADCINT,PRINT ;Poll to see whether conversio is done SJMP POLL PRINT: CLR ADCINT CLR RS MOV DAT,#0FH ; On the LCD SETB EN LCALL DELAY CLR EN MOV A,ADC0H LCALL WRITE_TEXT RET
"You don't have a voltage reference with an error in the neighbourhood of Vref/4096"
What do you mean "with an error in the neighbour of Vref/4096"?
"If you can afford the use of the long data type, then you don't have to worry about overflow in the multiplication."
What do you mean when you said "if you can afford the use of long data type"? How do i know whether i can use long data type?
Im using assembly language and a 2x8 LCD.
A 12-bit ADC means that there are 4096 steps. Each step represents 0.025% of full range. The voltage reference you use must have a similar precision if you want all bits of the ADC value to mean anything. If the voltage reference is +/- 1%, then you can build two units, and the two units can differ by up to 2%. That is 80 steps on the ADC.
If you buy a multimeter and measure something, the values shown will not be correct. Depending on how the unit is calibrated, it may show too low or to high values. Changed temperature will also affect how much error there will be in the multimeter readings.
There is no difference when using an ADC in a uC project. You either have to calibrate the unit (by taking a calibrated multimeter of higher precision) and measure input voltage and resulting voltage. Then you have to adjust for the difference. Or you have to give the ADC a voltage reference that are guaranteed to give a reference voltage within the tolerances you require.
Yes, I know that you program in assembly. That was why I said: If you can afford. The amount of code for playing with 24-bit or 32-bit integers quickly grows, since the uC can't handle more than 8 bits at at time.
In some situations it might be better to use a successive approximation for converting from the ADC steps into actual voltage, since then you can implement without multiply or divide. All you need is add and shift operations. They are easy to use even for multi-precision integers.
To get a precise voltage reference, i have to find out from the datasheet?
i have to find out from the datasheet?
how horrible, you have to actually read the datasheet, I feel for you.
Erik
What i meant was...
do i have calculate or get the reference voltage from the datasheet?
Because from the datasheet, it states that i can use Vdd as a reference for ADC which is 3V...
But in the ADC electrical characteristics, it states that the reference voltage is 2.4V...
I have tried using Vdd(3V) as a reference voltage but the values differ.
I wanted to try using an external voltage reference of 2.4V, but im don't know how to connect and i'm afraid that will damage the board. Can someone please tell me how to connect?
Ok... I found the way to connect the external reference voltage to the kit and it works!!!
Thanks again guys...
Oh.. Btw, for C8051F206's 12 bit ADC, the converted data is already correct, theres no need to multiply/divide/adjust it. Just need to convert the data from binary to ASCII characters. And of course need to use 2.55V as the reference voltage.
Oh. I almost forgot... Does the output of a peak detector circuit gives the peak value?
hi does somebody now an ADC with at least 10Khz and 24 bits?
You may check the site of Analog Devices, they even provide an excellent search facilty:
www.analog.com/.../scResultsDisplay.asp
Thomas
thank's Thomas
hi i wonder if i can interface AD7739 with MSC1210?, because in the datasheet it's interfaced with 68HC11
You can interface almost all ADC with almost any microcontroller.
But why do you hijack an existing and unrelated thread for your question?
no, i don't hijack an existing and unrelated thread,this thread talks the ADC.
This thread is about Nigel Sk, and his use of a board with the C8051F206 chip and an integrated ADC.
You not being Nigel Sk, and the MSC1210 not being a C8051F206 is a good indication that your question should be in a new thread.