beautypg.com

Cirrus Logic AN131 User Manual

Cirrus Logic Hardware

background image

1

Copyright

Cirrus Logic, Inc. 1999

(All Rights Reserved)

P.O. Box 17847, Austin, Texas 78760
(512) 445 7222 FAX: (512) 445 7581
http://www.cirrus.com

AN131

Application Note

Interfacing the CS5521/22/23/24/28 to the 68HC05

TABLE OF CONTENTS

1. INTRODUCTION ................................................... 1
2. ADC DIGITAL INTERFACE ................................... 1
3. SOFTWARE DESCRIPTION ................................. 2

3.1 Initialize ............................................................. 2
3.2 Write Channel Setup Registers ........................ 2
3.3 Self-Offset Calibration ....................................... 3
3.4 Read/Write Gain Register ................................. 3
3.5 Acquiring Conversions ...................................... 4

4. MAXIMUM SCLK RATE ......................................... 4
5. CONCLUSION ....................................................... 5
6. APPENDIX: 68HC05 MICROCODE TO INTERFACE

TO THE CS5521/22/23/24/28 ................................ 6

1. INTRODUCTION

This application note details the interface of Cirrus
Logic’s Crystal

®

CS5521/22/23/24/28 Analog-to-

Digital Converter (ADC) to a Motorola 68HC05
microcontroller. This note takes the reader through
a simple example describing how to communicate
with the ADC. All algorithms discussed are includ-
ed in Section 6. “APPENDIX: 68HC05 Microcode
to Interface to the CS5521/22/23/24/28” on page 6.

2. ADC DIGITAL INTERFACE

The CS5521/22/23/24/28 interfaces to the 68HC05
through either a three-wire or a four-wire interface.
Figure 1 depicts the interface between the two de-
vices. Though this software was written to inter-
face to the three-wire SPI

TM

on the 68HC05, the

algorithms can be easily modified to work in the
four-wire format.

The ADC’s serial port consists of four control
lines: CS, SCLK, SDI, and SDO.

CS, Chip Select, is the control line which enables
access to the serial port.

SCLK, Serial Clock, is the bit-clock which controls
the shifting of data to or from the ADC’s serial
port.

SDI, Serial Data In, is the data signal used to trans-
fer data from the 68HC05 to the ADC.

SDO, Serial Data Out, is the data signal used to
transfer output data from the ADC to the 68HC05.

CS5521/22/23/24/28

68HC05

PA0

MOSI (PD3)

MISO (PD2)

SCK (PD4)

CS

SDI

SDO

SCLK

Figure 1. 3-Wire and 4-Wire Interfaces

CS5521/22/23/24/28

68HC05

No Connect

MOSI (PD3)

MISO (PD2)

SCK (PD4)

CS

SDI

SDO

SCLK

3-Wire Interface

4-Wire Interface

NOV ‘99

AN131REV2