Cirrus-logic AN88 Manuel d'utilisateur Page 7

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 14
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 6
1 2 3 4 5 6 7 8 9 10 11 12 13 14

Commentaires sur ces manuels

Pas de commentaire