Appendix: pic16c84 microcode to, Interface to the cs5521/22/23/24/28, An130 – Cirrus Logic AN130 User Manual
Page 6
AN130
6
AN130REV2
8. APPENDIX: PIC16C84 MICROCODE TO INTERFACE TO THE CS5521/22/23/24/28
;*****************************************************************************
;* File:
55221684.ASM
;* Date:
November 1, 1999
;* Revision: 1
;* Processor:PIC16C84
;* Program entry point at routine "main". Entry point address is 0x05.
;*****************************************************************************
;* This program is designed to provide examples of how to interface the
;* CS5521/22/23/24/28 ADCs to a PIC16C84 Microcontroller. The software handles all
;* of the serial communications between the controller and the ADC to perform
;* system calibration and acquire 24 and 16-bit conversion words.
;*****************************************************************************
;*** Memory Map Equates ***
STATUS
equ
0x03
; STATUS register
PORTA
equ
0x05
; I/O Port A address
TRISA
equ
0x85
; Port A Data Direction Control Latch
CARRY
equ
0x00
; Carry Bit in STATUS
RP0
equ
0x05
; Register Bank Select Bit in STATUS
CS
equ
0x00
; Port A bit 0 - Chip Select
SDI
equ
0x01
; Port A bit 1 - Serial Data In
SDO
equ
0x02
; Port A bit 2 - Serial Data Out
SCLK
equ
0x03
; Port A bit 3 - Serial Clock
HIGHBYTE
equ
0X0C
; Upper 8 Bits of Conversion Register
MIDBYTE
equ
0x0D
; Middle 8 Bits of Conversion Register
LOWBYTE
equ
0x0E
; Lowest 8 bits of Conversion Register
COMMAND
equ
0x0F
; Command Byte RAM location
TEMP
equ
0x10
; Temporary Data storage RAM location
COUNT
equ
0x11
; Software Counter RAM location
SERI_DATA
equ
0x12
; Serial Data RAM location
;*****************************************************************************
;* Program Code
;*****************************************************************************
processor
16C84
; Set Processor Type
org
0x00
; Reset Vector Location
goto
main
; Start at "main" routine
;*****************************************************************************