This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请TI 专家帮忙分析一下,NHET Htu 方面的问题?困扰好久!

Other Parts Discussed in Thread: HALCOGEN

指令:

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口(示波器) 

 图像如下:

不知道 为什么 ,过一定的时间 有一个低电平!

  • Hello,

    你的仿真是没有错的。请检查你是不是把你的instructions copy到NHET RAM里了。 

    在ccs中运行程序,然后暂停。打开memory browser,输入地址0xFFF7B800。看看内容是不是IDE产生的代码(HET_INIT0_PST[x])

    Regards

    Qingjun

  • Qingjun

     您好!

     如何能看出来。。帮忙说说,这个问题困扰我太长时间了

     

     
  • HET_MEMORY const HET_INIT0_PST[6] =
    {

    /* l0_0 */
    {
    0x00002C20,
    0x08000007,
    0x00000000,
    0x00000000
    },

    /* l1_0 */
    {
    0x00005E00,
    0x00004106,
    0x00006A80,
    0x00000000
    },

    /* l2_0 */
    {
    0x00007480,
    0x00008002,
    0x00000380,
    0x00000000
    },

    /* l3_0 */
    {
    0x00001A00,
    0x00000000,
    0x00000000,
    0x00000000
    },

    /* l4_0 */
    {
    0x0000A801,
    0x0000000E,
    0x00007F80,
    0x00000000
    },

    /* l5_0 */
    {
    0x00000803,
    0x0000000A,
    0x00000380,
    0x00000000
    }
    };

  • 好像没有把instruction写到NHET RAM中

    NHET RAM位于0xFFF7_B800 (NHET1) or 0xFFF7_B900 (NHET2). The instructions 1 should be written into the beginning of the RAM:

    0xFFF7_B800: 0X00002C20

    0xFFF7_B804: 0X00000003

    0xFFF7_B808: 0X00000000

    0xFFF7_B80C: 0X00000000

    THEN INTRUCTION 2, 3 ....

    USE MEMCPY TO COPY THE INTSRUCTIONS INTO THE RAM。 参考的HalCoGen产生的例程:

    memcpy((void*)hetRAM1, (void*)HET_INIT0_PST, sizeof(HET_INIT0_PST));

    Regards,

    Qingjun

  • Qingjun

     你好!

     谢谢!

    能继续指点下吗,这方面资料也看了不少,这个程序的波形前面部分能跟仿真的一样,那说明他也执行了那些指令,主要是后面用到HTU部分,想通过请求把主程序中的数据传递到指令的move中有问题!