Cirrus-logic AN88 Bedienungsanleitung Seite 7

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 14
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 6
AN88
AN88Rev2 7
;*************************************************************************************
;* Program Code
;*************************************************************************************
processor 16C84 ; Set Processor Type
org 0x00 ; Reset Vector
goto Main ; Start at Main
;*************************************************************************************
;* Routine - Main
;* Input - none
;* Output - none
;* This is the entry point to the program.
;*************************************************************************************
org 0x05
Main ; Start from Reset Vector
;******** Initialize System and Perform SELF OFFSET Calibration
CALL initialize ; Initialize the system
CALL calibrate ; Calibrate the ADC Offset
;******** Write to the GAIN Register
MOVLW 0x82 ; Prepare COMMANDBYTE
MOVWF COMMANDBYTE
MOVLW 0x80 ; Prepare HIGHBYTE
MOVWF HIGHBYTE
CLRF MIDBYTE ; Prepare MIDBYTE
CLRF LOWBYTE ; Prepare LOWBYTE
CALL write_register ; Write to Gain Register
;******** Read from the GAIN Register
MOVLW 0x92 ; Prepare COMMANDBYTE
MOVWF COMMANDBYTE
CALL read_register ; Read the Gain Register
;******** Perform Single Conversions
LOOP CALL convert ; Convert Analog input
goto LOOP ; Repeat Loop
;******** End MAIN
Seitenansicht 6
1 2 3 4 5 6 7 8 9 10 11 12 13 14

Kommentare zu diesen Handbüchern

Keine Kommentare