User guide
AN89
AN89Rev2 5
APPENDIX
68HC05 Microcode to Interface to the CS5525/6/9
****************************************************************************
*
* File: 55266805.asm
* Date: November 1, 1996
* Programmer: Keith Coffey
* Revision: 0
*
* Processor: 68HC05
*
* Program entry point at routine "main". The entry point is address $100
****************************************************************************
*
* This program is designed as an example of interfacing a 68HC05 to a CS5525/6/9
* ADC. The program interfaces via SPI (i.e. port D) which controls the
* serial communications, calibration, and conversion signals. Other ADC’s
* (16-bit and 20-bit) in the product family can be used.
****************************************************************************
******** Memory Map Equates
PORTA EQU $00 ; General Purpose I/O Port
DDRA EQU $04 ; Data Direction Control For Port A
SPCR EQU $0A ; Serial Peripheral Control Register
SPSR EQU $0B ; Serial Peripheral Status Register
SPDR EQU $0C ; Serial Peripheral Data I/O Register
SPIF EQU 7 ; Serial Peripheral Data Transfer Flag
******** RAM Values
ORG $50
******** Ram Memory Equates
HIGHBYTE RMB 1 ; Upper 8 bits of Conversion Register
MIDBYTE RMB 1 ; Middle 8 bits of Conversion Register
LOWBYTE RMB 1 ; Lowest 8 Bits of Conversion Register
COMMANDBYTE RMB 1 ; One byte RAM storage location