8 c-callable – Texas Instruments TLV1562 User Manual

Page 92

Advertising
background image

Software Overview

86

SLAA040

Constants definition – see 8.6.1.1 Constants.asm

Interrupt Routine handler – see 8.6.1.2 Interrupt Vectors

8.6.8

C-Callable

Mainprogram (C1562.c)

/* File: C1562.C */

/* This file will select the parameters to allow a C–call of the ADC sampling */

extern void TLV1562(int, int, int);

main()

{

/* TLV1562(Channel, Save Memory Start address, NUMBER_OF_SAMPLES); */

TLV1562(1, 0x2000, 0x0080);

/* 80h samples of channel 1 will be stored beginning on 2000h */

TLV1562(2, 0x2100, 0x0080);

/* 80h samples of channel 2 will be stored beginning on 2100h */

TLV1562(3, 0x2200, 0x0080);

/* 80h samples of channel 3 will be stored beginning on 2200h */

}

Assembler Routine to Control the Interface to the ADC (ASM1562.asm)

**************************************************************************

* TITLE : TLV1562 ADC Interface routine *

* FILE : DUALIRQ1.ASM *

* FUNCTION : MAIN *

* PROTOTYPE : void MAIN () *

* CALLS : N/A *

* PRECONDITION : N/A *

* POSTCONDITION : N/A *

* DESCRIPTION : main routine to use the mono interrupt driven mode *

* and the CSTART signal to CPU power for the conversion *

* time *

* AUTHOR : AAP Application Group, ICKE, Dallas *

* CREATED 1998(C) BY TEXAS INSTRUMENTS INCORPORATED. *

* REFERENCE : TMS320C54x User’s Guide, TI 1997 *

* : Data Aquisation Circuits, TI 1998 *

**************************************************************************

.title ”DUALIRQ1”

.mmregs

.width 80

.length 55

.version 542

Advertising