Help!!!!

Status
Not open for further replies.
I'm almost as new in programming pic microcontrollers in assembly language. How to get the output (LED turn ON) when voltage at Ra0 vary using ADC?I have tried by follow the instruction but its not working.

**broken link removed**
 
At first, using 3 volt as input, LED turn OFF. means output 0. But when using input voltage below 3 volt, LED turn ON. please show me the program instruction..
 
this my coding i tried before

list p=16F887A
#include <p16F887A.inc>

___CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _LVP_OFF & _HS_OSC

ORG 0X000
goto main

main

BANKSEL TRISA
PORTA 0XFF
CLRF PORTD
CLRF PORTC
BANKSEL PORTA

Init_ADC


movlw b'10000001'
movwf ADCON0
BANKSEL ADCON1
movlw b'11000000'
movwf ADCON1
BANKSEL ADCON0
A

ADRESL b'1000101011'
BTFSC ADRESL,3
goto A
BTFSF ADRESL,4
goto A
BTFSC ADRESL,5
goto A
BTFSF ADRESL,6
goto A
goto B

B

BANKSEL TRISA
COMF TRISD
TRISC 0XFF
BANKSEL PORTA

return
end
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…