|
帮忙分析一下,NHET Htu 方面的问题?困扰好久!
[复制链接]
指令:
l0 CNT { reqnum=0,request=GENREQ,reg=A,max=7};
l1 SHFT { smode=OR0,cond=UNC,pin=1,data=0xd5};
l2 DJZ { cond_addr=l4,reg=B,data=7};
l3 BR { next=l0,cond_addr=l0,event=NOCOND};
l4 MOV32 { next=l5,remote=l1,type=IMTOREG&REM,reg=NONE,data=0xff};
l5 MOV32 { next=l0,remote=l3,type=IMTOREG&REM,reg=B,data=7};
程序:
unsigned int data_table[data_num] = {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255};
void main(void)
{
/* USER CODE BEGIN (3) */
htuInit();
//
hetInit();
//
configNHET1();
//
while(1);
/* USER CODE END */
}
/* USER CODE BEGIN (4) */
void htuInit(void)
{
htuRAM1 ->DCP[0].ITCOUNT = 0x00010000+ data_num;
htuRAM1->DCP[0].IHADDRCT = 0x00000000
|(1U<<23U) /* DCP0 CPx DIR = main memory to NHET */
|(0U<<22U) /* SIZE = 32-bit */
|(0U<<21U) /* ADDMH = 16 bytes */
|(0U<<20U) /* ADDFM = constant mode main memory */
|(1U<<18U) /* TMBA = one shot buffer A */
|(0U<<16U) /* TMBB = one shot buffer B (not rel.) */
|(18U<<2U); /* IHADDR = 0xA => 0x8 PCNT data field */
/* DCP0 CPA startaddress of source buffer */
htuRAM1 ->DCP[0].IFADDRA = (unsigned int)data_table;
/* enable DCP0 CPA */
htuREG1 ->CPENA= 0x00000001;
/* enable HTU */
htuREG1 ->GC = 0x00010000;
}
//
void configNHET1()
{
/* configure the LRP prescaler,the hr is always 1 and lr can be
hetREG1->REQENS = 1 ;
hetREG1->DIR = (1 << PIN_HET_1) ;
hetRAM1->Instruction[1].Control =
(hetRAM1->Instruction[1].Control & 0xFFFFE0FF) |
(1 << 8);
}
本人的想法是::想通过指令把16进制的数,用高点电平的形势发出去。。各种指令都试过 ECMP MCMP等等
用het IDE 软件仿真的结果发出的方波可以连续
但结果主程序启动HTU 模式 ,有了请求进入主程序 将数组data_table发送出去 硬件IO口(示波器)
图像如下:
不知道 为什么 ,过一定的时间 有一个低电平!
|
|