Download Engineer-To-Engineer`s Note EE-79 a
Transcript
The following example is the system file (Boothost.sys)
used to build this project:
dm(0x3fe3) = ay0;
{set BDMA Control}
ay0 = 0x1;
dm(0x3fe4) = ay0;
{set BWCOUNT, start BDMA}
.system BootHost;
nop; nop; nop; nop;
.adsp2101;
sr = lshift sr0 by -1 (LO); {shift reg holding PF data}
.mmap0;
ay1 = dm(0x3fdf);
.seg/pm/ram/code/data/abs=0
int_pm[0x4000];
dm(0x3fe5) = ay1;
.seg/dm/ram/data/abs=0
int_dm[0x3c00];
rti;
.seg/rom/boot=0 boot0[2048];
.endsys;
RESETPF:
sr0
From this example system file, you’ll notice that we’ve
declared an adsp2101 system with roughly 16k words of
PM and DM respectively!! This step is required to “trick”
the tools into using boot segments, (“.seg/rom/boot=0
boot0[2048];”), with a 2181 memory model.
= 0x40;
rts;
START:
ax0 = 0x0400;
dm(0x3fff) = ax0;
Now here is our code example. Here you’ll notice again
that a boot segment is used in this source file (located at
line 1), which is normally illegal for a 218x system. But,
since we’ve tricked the tools into using our modified 2101
system file, everything will work accordingly.
ax0 = 0x0000;
{set IOWAIT to 0}
dm(0x3ffe) = ax0;
imask = 0x200;
{enable IRQ2}
ax0 = 0x1f7f;
dm(0x3fe6) = ax0;
/* Filename : Boothost.DSP */
ax0 = 0x80;
.module/ram/boot=0
dm(0x3fe5) = ax0;
booty;
#include "vectab.h"
sr0
#define IRQ2ON
reset fl0;
= 0x40;
{make PFs output exc PF7}
{make all PFs exc PF7 lo}
{set data for first PF}
cntr = 0x6;
IRQ2INT:
do FLASHER until ce;
toggle fl0;
cntr = 0x1000;
none = pass sr0;
if eq call resetpf;
do FLASHER1 until ce;
{reset PF data}
ar = sr0 OR 0x80;
dm(0x3fde) = ar;
do FLASHER2 until ce;
{set data for BDMA wr}
ax0 = 0x7fdf;
dm(0x3fe0) = ax0;
ay0 = 0x7;
EN-79
nop;
{wait for IRQ2}
FLASHER:
toggle fl0;
{set BEAD}
ay0 = 0x3fde;
dm(0x3fe1) = ay0;
FLASHER2:
FLASHER1: nop;
{set IDMAA to PF DATA reg}
ay0 = 0x0;
dm(0x3fe2) = ay0;
cntr = 0x2000;
NOWHERE: idle;
jump NOWHERE;
{set BIAD}
#include " trailer.h"
Page 3
Technical Notes on using Analog Devices’ DSP components and development tools
Phone: (800) ANALOG-D, FAX: (781) 461-3010, FTP: ftp.analog.com, EMAIL: [email protected]