12
Programming Model
12 – 9
{code starts here}
{load interrupt vector addresses}
JUMP restarter; NOP; NOP; NOP;
{restart interrupt}
RTI; NOP; NOP; NOP;
{IRQ2 interrupt}
RTI; NOP; NOP; NOP;
{HIP write interrupt}
RTI; NOP; NOP; NOP;
{HIP read interrupt}
RTI; NOP; NOP; NOP;
{SPORT0 transmit int}
JUMP fir_start; NOP; NOP; NOP;
{SPORT0 receive int}
RTI; NOP; NOP; NOP;
{SPORT1 transmit int}
RTI; NOP; NOP; NOP;
{SPORT1 receive int}
RTI; NOP; NOP; NOP;
{TIMER interrupt}
{initializations}
restarter:
L0=%data_buffer;
{setup circular buffer length}
L4=%coefficient;
{setup circular buffer length}
M0=1;
{modify=1 for increment through buffers}
M4=1;
I0=^data_buffer;
{point to data start}
I4=^coefficient;
{point to coeff start}
CNTR=%data_buffer;
DO clear UNTIL CE;
{clear data buffer}
clear:
DM(I0,M0)=0;
{set up memory-mapped control registers}
AX0=191;
DM(0x3FF4)=AX0;
{set up divide value for 8KHz RFS}
AX0=3;
DM(0x3FF5)=AX0;
{1.536MHz internal serial clock}
AX0=0x69B7;
DM(0x3FF6)=AX0;
{multichannel disabled}
{internally generated serial clock}
{receive frame sync required}
{receive width 0}
{transmit frame sync required}
{transmit width 0}
{int transmit frame sync disabled}
{int receive frame sync enabled}
{u-law companding}
{8 bit words}
AX0=0x7000;
DM(0x3FFE)=AX0;
{DM wait states: }
{ 0x3400-0x37FF 7 waits}
{ all else 0 waits}
AX0=0x1000;
DM(0x3FFF)=AX0;
{SPORT0 enabled}
{boot from boot page 0}
{0 PM waits}
{0 boot memory waits}
ICNTL = 0x00;
IMASK = 0x0018;
{enable SPORT0 interrupt only}
mainloop:
IDLE;
{wait for interrupt}
JUMP mainloop;
.ENDMOD;
Listing 12.1 Program Example Listing (Setup & Main Loop Routine)
C
D
E