Cirrus-logic AN74 Manuel d'utilisateur Page 6

  • 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 5
AN74
6 AN74Rev2
APPENDIX
80C51 Microcode to Interface to the CS5525/6/9
/****************************************************************************
* File: 55268051.asm
* Date: November 1, 1996
* Programmer: Keith Coffey
* Revision: 0
* Processor: 80C51
* Program entry point at routine "main".
****************************************************************************
* This program is designed as an example of interfacing a 80C51 to a CS5525/6/9
* Analog-to-Digital Converter. The program interfaces via Port 1 which controls the
* serial communications, calibration, and conversion signals.
****************************************************************************/
/*** Function Prototypes ***/
void initialize(void);
void reset_converter(void);
void toggle_sdo(void);
char receive_byte(void);
void transfer_byte(char);
void write_to_register(char command,char low,char mid, char high);
void read_register(char command);
void acquire_conversion(char command);
/*** Byte Memory Map Equates ***/
sfr P1 = 0x90; /*Port One*/
sfr ACC = 0xE0; /*Accumulator Register Equate*/
/*** Bit Memory Map Equates ***/
sbit CS
= 0x90; /* Chip Select, only used in four-wire mode*/
sbit SDI = 0x91; /* Serial Data In*/
sbit SDO = 0x92; /*Serial Data Out*/
sbit SCLK = 0x93; /*Serial Clock*/
/*** Global Variable ***/
char command, /*Memory Storage Variable for Command Byte */
high_byte, /*Memory Storage Variable for Most Significant Byte*/
mid_byte, /* Memory Storage Variable for Most Significant Byte*/
low_byte, /* Memory Storage Variable for Most Significant Byte*/
temp, /*General Purpose Temporary Variable*/
mode; /*Variable Stores Mode of Operation 0 = three wire, 1 = 4 wire*/
Vue de la page 5
1 2 3 4 5 6 7 8 9 10 11 12 13 14

Commentaires sur ces manuels

Pas de commentaire