Manual
Table Of Contents
- AN118: Interfacing the CS5521/22/23/24/28 to the 80C51
- TABLE OF CONTENTS
 - 1. INTRODUCTION
 - 2. ADC DIGITAL INTERFACE
 - 3. SOFTWARE DESCRIPTION
 - 4. MAXIMUM SCLK RATE
 - 5. DEVELOPMENT TOOL DESCRIPTION
 - 6. CONCLUSION
 - 7. APPENDIX: 80C51 MICROCONTROLLER CODE
 
 

AN118
20 AN118REV2
case 0xEE:   /* System-Gain Cal on Setup 14 */
case 0xF6:   /* System-Gain Cal on Setup 15 */
case 0xFE:   /* System-Gain Cal on Setup 16 */
COMM = 0x00;  /* Turn on LED */
if(mode == 1) P1 = 0xF4;   /*Clear CSb*/
transfer_byte(command);
do {/* Nothing*/} while (SDO !=0);  /* Wait for cal to Complete */
if(mode == 1) P1 = 0xF5;   /*Set CSb*/
COMM = 0x01;  /* Turn off LED */
break;
/******************************/
/* Variable # of Normal Conversions */
/******************************/
case 0x1F:
COMM = 0x00;  /* Turn on LED */
sample_index = RXSER();  /* How many Conversions? */
temp  = RXSER(); /* What conversion channel? */
decode_sample_index();
/*Initiate Continuous Conversion*/
if(mode == 1) P1 = 0xF4; /* Clear CSb */ 
transfer_byte(temp); /* Initiate Single conversion */
for (j=0; j<sample_size; j++) {
do { /* Nothing*/} while (SDO !=0); /* Wait for SDO to fall */
transfer_byte(0x00); /* Send all zeros */
high_byte  = receive_byte();/* Receive Bytes */
mid_byte  = receive_byte();
low_byte = receive_byte();
TXSER(low_byte);  /* Return bytes to PC */
TXSER(mid_byte);  
TXSER(high_byte);
} 
transfer_byte(0xFF); /* Send all zeros */
high_byte  = receive_byte(); /* Receive last conversion */
mid_byte  = receive_byte();
low_byte = receive_byte();
if(mode == 1) P1 = 0xF5; /* Set CSb */
COMM = 0x01;  /* Turn off LED */ 
break;  
/************************************/
/* Variable # of Offset or Gain Calibrations */
/************************************/
case 0x2F:
COMM = 0x00;  /* Turn on LED */
sample_index = RXSER();  /* How many Cals? */
temp  = RXSER();  /* What type of Cal? */










