beautypg.com

An130 – Cirrus Logic AN130 User Manual

Page 10

background image

AN130

10

AN130REV2

MOVLW 0x05

; Command to write CSRs

BCF

PORTA, CS

; select the ADC

CALL

send_byte

; send command byte to ADC

;*** Setup CSR #1 - Setups 1 and 2
;

setting both to default value of ’000’

;

(A1-A0 = 00, Physical Channel = 1, OWR = 15Hz,

;

input V-range = 100mV, Bipolar Measurement mode) ***

MOVLW 0x00

; all zeros

CALL

send_byte

; send first byte

CALL

send_byte

; send second byte

CALL

send_byte

; send third byte

;*** Setup CSR #2 - Setups 3 and 4
;

setting Setup 3 to ’4C0’ and Setup 4 to ’105’

;

Setup 3 Settings - (A1-A0 = 01, Physical Channel = 2,

;

OWR = 101.1 Hz, input V-range = 100mV, Bipolar)

;

Setup 4 Settings - (A1-A0 = 00, Physical Channel = 3,

;

OWR = 15 Hz, input V-range = 25mV, Unipolar)

MOVLW 0x4C

; first byte of info

CALL

send_byte

; send first byte

MOVLW 0x01

; second byte of info

CALL

send_byte

; send second byte

MOVLW 0x05

; third byte of info

CALL

send_byte

; send last byte

BSF

PORTA, CS

; de-select the ADC

RETURN

; exit

;*****************************************************************************