DSPRelated.com
Forums

Problems with timer on ADSP-2181 EZ-KIT

Started by marko_dsp March 28, 2003
Here is my simple code. The timer work properly only the first "step"
run (on simulator). When return from abc the bit of pending
interrupt request (IREQ) sets on (why?!?) and the program don't
attend the end of TCOUNT (jumps from <-). Can anyone help me? #include "def2181.h" .SECTION/DM data1;

.var buff_iniz[10] = 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007,
0x008, 0x009, 0x00a;
.var buff_fin[10] = 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000,
0x000, 0x000, 0x000;
.var tempo = 0x0010;

.SECTION/PM interrupts;
jump start; rti; rti; rti; /*00: reset */
rti; rti; rti; rti; /*04: IRQ2 */
rti; rti; rti; rti; /*08: IRQL1 */
rti; rti; rti; rti; /*0c: IRQL0 */
rti; rti; rti; rti; /*10: SPORT0 tx */
rti; rti; rti; rti; /*14: SPORT1 rx */
rti; rti; rti; rti; /*18: IRQE */
rti; rti; rti; rti; /*1c: BDMA */
rti; rti; rti; rti; /*20: SPORT1 tx or IRQ1 */
rti; rti; rti; rti; /*24: SPORT1 rx or IRQ0 */
jump read; rti; rti; rti; /*28: timer */
rti; rti; rti; rti; /*2c: power down */

start:
ax0 = dm(tempo);

i2 = buff_iniz;
l2 = LENGTH(buff_iniz);
i3 = buff_fin;
l3 = 0;

m2 = 1;
m3 = 1;

read:
mx0 = dm (i2,m2);
dm (i3+=m3) = mx0;

mstat = b#0100000;
imask = b#0000000001;

dm (Tcount_Reg) = ax0;
ena timer; <-

abc:
idle;
jump abc;

rti;