Texas Instruments MSP50C614 manual Provided, External

Models: MSP50C614

1 414
Download 414 pages 24.44 Kb
Page 360
Image 360

Implementation Details

 

To call an assembly routine from C±±, the routine must be defined as GLOBAL

 

in the assembly file and as a CMM_FUNC in the C±± file. The following

 

contains C±± callable assembly routines for accessing the I/O ports, and a

 

wait routine. A C±± program which calls the assembly routines is also

 

provided.

RORG 0x0

 

GLOBAL

_wait

GLOBAL

_asminit

GLOBAL

_oport

GLOBAL

_iport

GLOBAL

_cport

GLOBAL

TIMER1_ISR, DAC_ISR

GLOBAL

TIMER2_ISR, PORTD2_ISR

GLOBAL

PORTD4_ISR, PORTD5_ISR

GLOBAL

PORTD3_ISR, PORTF_ISR

GLOBAL

reset, DUMMY_ISR

EXTERNAL

_main0

include

ºram\ram.irxº

include

ºcontrol\control.irxº

include

ºcontrol\io_ports.irxº

include

ºcontrol\control.asmº

;****************************************************************

;Reset

;Begin at init614 in INIT.ASM.

;This sets the 614 to run at 8 MHz, 10 bit DAC at 8 kHz reset ;***************************************************************** reset

include º.\control\init.asmº ;****************************************************************

;_MAINASM

;The start of the assembly code, which is called from

;main routine in main.cmm ;**************************************************************** _asminit

nop

 

;pause for breath

nop

 

 

nop

 

 

out

IFR,a0

;clear all interrupt flags

;****************************************************************

;Main program ;**************************************************************** mainbegin

mov

r4,1000 * 2

;pause for a second

call

_wait

 

;Set TIMER2 to run from the RTO/CTO (32 kHz) and with a one second period

in a0,IntGenCtrl

or

a0,TIM2REFOSC

;set bit 9, CTO clock (32 kHz)

out

IntGenCtrl,a0

 

INTE

 

;enable all interrupts

ret

 

 

5-60

Page 360
Image 360
Texas Instruments MSP50C614 manual Provided, External