This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ADC Help!!!

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

Parents
  • "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.

Reply
  • "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.

Children