Texas Instruments MSP50C6xx User Manual

Page 345

Advertising
background image

C– – Efficiency

5-49

Code Development Tools

In main_ram.irx, two variables were added to save and restore r3 and r5 when
speaking. These registers are used by C– – so it is a good idea to save and
restore them in case they are modified by the speech routines. This is a good
example of adding RAM for use by cmm1.asm.

;****************************************************************
; MAIN_RAM.IRX
;
; Start of memory for MAIN module is defined in
;

include

”..\ram\ram.irx”

;****************************************************************
; Timer 2 interrupt variables
save_tim2_stat

equ RAMSTART_CUSTOMER + 2 * 1

save_tim2_a0

equ save_tim2_stat + 2 * 1

seconds_passed

equ save_tim2_a0 + 2 * 1

csave_r3

equ seconds_passed + 2 * 1

csave_r5

equ csave_r3 + 2 * 1

RAMSTART_CMM1

equ csave_r5

include ”cmm1_ram.irx”
; End of RAM
RAMEND_CUSTOMER equ RAMEND_CMM1
RAMLENGTH_CUSTOMER

equ

RAMEND_CUSTOMER – RAMSTART_CUSTOMER

The new variables, csave_r3 and csave_r5 were added by using the
mnemonic for the previous variable plus an offset.

The next modified file is vroncof2.asm. Here new interrupt service routines
were added. This project adds speech so the DAC_ISR needs to be added.
Timer 1 is also used for waking up from sleep routines so it was also added.
At the top of the file their labels were uncommented.

external

DAC_ISR

external

timer1_isr

external

timer2_isr

;

external

pd2

;

external

pd3

;

external

portF

;

external

pd4

;

external

pd5

external

init614

external

_main0

At the bottom of the file, their labels were commented out of the dummy
interrupt routine.

pd2
pd3
portF
pd4
pd5
;DAC_ISR
;timer1_isr
;timer2_isr

nop

Advertising