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
12 AN118REV2
/**************************************************************/
/* Routine - Main */
/* Input - none */
/* Output - none */
/* Description - This routine is the main algorithm used to call */
/* all subroutines. */
/**************************************************************/
main() {
initialize();
/*Check Dip Switches to see which Mode to Enter*/
temp = TEST_BIT3;
temp = temp<<1;
temp = temp |TEST_BIT2;
temp = temp<<1;
temp = temp |TEST_BIT1;
if(temp ==0){
while(1) {
COMM = 0x01; /*Turn off LED*/
command = RXSER(); /*Get Command from PC*/
COMM = 0x00; /*Turn on LED*/
decode_command(command); /*Decode Command*/
}
}
else
test_mode(); /*Enter Test Modes*/
}
/**************************Subroutines***************************/
/**************************************************************/
/* Routine - Initialize */
/* Input - none */
/* Output - none */
/* Description - This routine is used to setup the microcontroller */
/* and reset the converter. */
/**************************************************************/
void initialize()
{ data int j; /* Local counter variable */
P1 = 0xF4; /*SCLK - output, therefore low*/
/*SDI - output, therefore low*/
/*SDO - input, therefore high*/
/*CSb - ouput, therefore low */
P2 = 0x00; /*Toggle all LED’s, Start Up Sequence indicator*/
Delay();
P2 = 0xFF;