Page 287 - Amphibionics : Build Your Own Biologically Inspired Robot
P. 287
Amphibionics 06 3/24/03 9:02 AM Page 266
PROGRAM 6.13
' bit4 - CHS1
tx-remote.bas program
' bit3 - CHS0
listing (continued) ' bit5 - reserved Amphibionics
' bit2 - GO/DONE
' bit1 - ADIF
' bit0 - ADON
' ADCS1 and ADCS2 - bit7 and bit6
' A/D conversion clock select:
' ADCS1,0 = 00: fosc/2
' 01: fosc/8
' 10: fosc/32
' 11: f rc (derived from internal
' rc oscillator)
' bit5 - reserved
' Analog channel select - bit4 and bit3
' CHS1, CHS0 = 00: channel 0 (AIN0)
' 01: channel 1 (AIN1)
' 10: channel 2 (AIN2)
' 11: channel 3 (AIN3)
' GO/DONE - bit2: must be set to begin a
' conversion. It is automatically
' reset in hardware when conversion
' is done.
' ADIF - bit1: A/D conversion complete interrupt flag bit. Set
' when conversion is completed. Reset in software.
' ADON - bit0: If ADON = 0 A/D converter module is shut off and
' consumes no operating current. ADON = 1 A/D
' converter module is on.
'
' ADRES = 09 hex = 9 dec
' A/D conversion result register
'
' INTCON = 0B hex = 11 dec
' interupt control register
'------------------------------------------------------------------------------------------------------------------------------
' set PortA inputs.
trisa = %00011111
266