Cirrus-logic AN88 Manual de usuario

Busca en linea o descarga Manual de usuario para Hardware Cirrus-logic AN88. Cirrus Logic AN88 User Manual Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 14
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 0
1
Copyright
Cirrus Logic, Inc. 1997
(All Rights Reserved)
Cirrus Logic, Inc.
Crystal Semiconductor Products Division
P.O. Box 17847, Austin, Texas 78760
(512) 445 7222 FAX: (512) 445 7581
http://www.crystal.com
AN88
Application Note
Interfacing the CS5525/6/9 to the PIC16F84
By Keith Coffey
INTRODUCTION
This application note details the interface of Crys-
tal Semiconductor’s CS5525/6/9 Analog-to-Digi-
tal Converter (ADC) to the Microchip PIC16
microcontroller series. This note takes the reader
through a simple example describing how to com-
municate with the ADC. All algorithms discussed
are included in the Appendix at the end of this
note.
ADC DIGITAL INTERFACE
The CS5525/6/9 interfaces to the PIC16F84
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 Port A (RA) on the PIC16F84 with a four-
wire interface, the algorithms can be easily modi-
fied to work with the three-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 PIC16F84 to the ADC.
SDO, Serial Data Out, is the data signal used to
transfer output data from the ADC to the
PIC16F84.
SOFTWARE DESCRIPTION
This note presents algorithms to initialize the
PIC16F84 and the CS5525/6/9, perform a self-off-
set calibration, modify the CS5525/6/9 gain regis-
ter, and then acquire a conversion. Figure 2 depicts
CS5525/6/9 PIC16F84
RA0
RA1
RA2
RA3
CS
SDI
SDO
SCLK
Figure 1. 3-Wire and 4-Wire Interfaces
CS5525/6/9 PIC16F84
NC (RA0)
RA1
RA2
RA3
CS
SDI
SDO
SCLK
NOV ‘97
AN88Rev2
Vista de pagina 0
1 2 3 4 5 6 ... 13 14

Indice de contenidos

Pagina 1 - Application Note

1Copyright  Cirrus Logic, Inc. 1997(All Rights Reserved)Cirrus Logic, Inc.Crystal Semiconductor Products DivisionP.O. Box 17847, Austin, Texas 78760(

Pagina 2 - 2 AN88Rev2

AN8810 AN88Rev2;*************************************************************************************;* Routine - write_register;* Input - COMMANDB

Pagina 3 - AN88Rev2 3

AN88AN88Rev2 11;*************************************************************************************;* Routine - send_spi;* Input - Byte to be tra

Pagina 4 - DEVELOPMENT TOOL DESCRIPTION

AN8812 AN88Rev2;*************************************************************************************;* Routine - delay;* Input - Count in register A

Pagina 7

AN882 AN88Rev2a block diagram overview. While reading this ap-plication note, please refer to the Appendix for thecode listing.InitializeInitialize i

Pagina 8

AN88AN88Rev2 3data-state where it waits until data is read from itsserial port. To receive the data, read_register callsreceive_spi three times. Recei

Pagina 9

AN884 AN88Rev2 MAXIMUM SCLK RATEA machine cycle in the PIC16F84 consists 4 oscil-lator periods or 400 ns if the microcontroller’s os-cillator frequenc

Pagina 10

AN88AN88Rev2 5CONCLUSIONThis application note presents an example of howto interface the CS5525/6/9 to the PIC16F84. It isdivided into two main sectio

Pagina 11

AN886 AN88Rev2APPENDIXPIC16F84 Microcode to Interface to the CS5525/6/9;******************************************************************************

Pagina 12

AN88AN88Rev2 7;*************************************************************************************;* Program Code;****************************

Pagina 13 - • Notes •

AN888 AN88Rev2;*************************************************************************************;* Subroutines;*****************************

Pagina 14

AN88AN88Rev2 9;*************************************************************************************;* Routine - calibrate;* Input - none;* Output

Comentarios a estos manuales

Sin comentarios