if (ad[0]>=0x800)
d=-(((~ad[0])+1)&0xfff);
else
d=(ad[0]&0xfff);
if (ad[0]>=0x800)
a[0]=-(float)(((~ad[0])+1)&0xfff)*10.0/4096.0;
else
a[0]=(((float)(ad[0]&0xfff)))*10.0/4096.0;
if (ad[1]>=0x800)
a[1]=-(float)(((~ad[1])+1)&0xfff)*10.0/4096.0;
else
a[1]=(((float)(ad[1]&0xfff)))*10.0/4096.0;
if (ad[2]>=0x800)
a[2]=-(float)(((~ad[2])+1)&0xfff)*10.0/4096.0;
else
a[2]=(((float)(ad[2]&0xfff)))*10.0/4096.0;
if (ad[3]>=0x800)
a[3]=-(float)(((~ad[3])+1)&0xfff)*10.0/4096.0;
else
a[3]=(((float)(ad[3]&0xfff)))*10.0/4096.0;
*(ch2+dot)=d;
ipcb[dot]=a[0]*100000000;
EINT;
dot++;
if(dot==1024)
XIntruptRegs.XINT2CR.all=0x0000;
else XIntruptRegs.XINT2CR.all=0x0001;
XIntruptRegs.XINT1CR.all=0x0001;
}
cmd文件是:
MEMORY
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
/* ZONE7 : origin = 0x3FC000, length = 0x003FC0 /* XINTF zone 7 available if MP/MCn=1 */
ROM : origin = 0x3FF000, length = 0x000FC0 /* Boot ROM available if MP/MCn=0 */
RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM (MP/MCn=0) or XINTF zone 7 (MP/MCn=1) */
VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM (MP/MCn=0) or XINTF zone 7 (MP/MCn=1) */
PAGE 1 : /* Data Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
/* Allocate sections to memory blocks.
Note:
codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code
execution when booting to flash
ramfuncs user defined section to store functions that will be copied from Flash into RAM
*/
/* Allocate uninitalized data sections: */
.stack : > RAMM0 PAGE = 1
.bss : > RAML0L1 PAGE = 1
.ebss : > RAML0L1 PAGE = 1
.esysmem : > RAMH0 PAGE = 1
.sysmem : > RAMH0 PAGE = 1
/* Initalized sections go in Flash */
/* For SDFlash to program these, they must be allocated to page 0 */
.const : > FLASHC PAGE = 0
.econst : > FLASHC PAGE = 0
.switch : > FLASHC PAGE = 0
/* Allocate IQ math areas: */
IQmath : > FLASHC PAGE = 0 /* Math Code */
IQmathTables : > ROM PAGE = 0, TYPE = NOLOAD /* Math Tables In ROM */
/* .reset is a standard section used by the compiler. It contains the */
/* the address of the start of _c_int00 for C Code. /*
/* When using the boot ROM this section and the CPU vector */
/* table is not needed. Thus the default type is set here to */
/* DSECT */
.reset : > RESET PAGE = 0, TYPE = DSECT
vectors : > VECTORS PAGE = 0, TYPE = DSECT