16F685 and 16F677 are in the same group of chips. I got them to work with Rcurls help as follows
Dim RAW As ADRES.Word
ANSEL = %00000111 'make AN0,AN1,AN2 an analog input. All others digital
ANSELH = %00000000
TRISA = %00000111
Hi, its great to see you visiting our forum. Why not try Proton Compiler for FREE?
Download the FREE version of Proton Compiler, Its called Amicus18 and its available from HERE
Already using proton Compiler??? Get rid of these pesky messages... get LICENSED USER STATUS
getamp:
ADCON0 = %10000101 ;measure an1 amps
DelayUS 50
ADCON0 = %10000111
Repeat
' DelayUS 10
Until ADCON0 = %10000101
Return
getvolt:
ADCON0 = %10000001 ' Right justify the result an0 volt
DelayUS 50
ADCON0 = %10000011
Repeat
'DelayUS 10
Until ADCON0 = %10000001
Return
getac:
ADCON0 = %10001001 ' Right justify the result an2 Vac
DelayUS 50
ADCON0 = %10001011
Repeat
Until ADCON0 = %10001001
Return
and use the result in RAW after calling the relevant subroutines



Reply With Quote
