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.

HTU can not be resetted in rum time

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

Hi TI,

I am working with N2HET and HTU of TMS570LC4357. And I am using F-ree RTOS driver code from HalCoGen.

I want my HTU Module to transfer data from Main RAM to N2HET RAM Location when trigger is given by one of the instruction written in N2HET RAM.

To achieve this, I did configuring N2hET, HTU Module only once in the 10ms Task. After that N2HET will do toggling a pin with certain intervals defined by the data that HTU Transfers to N2HET RAM.

So in my code I follows the following approach and I cannot achieve achieve the concept.

I don't know why it is happening? Please anybody explain me about this.

And To overcome this I just tried in the following way.

So please explain me why these two things happen?

(At the time of writing this post, I examined again and I noticed that I cannot update even a single bit of a register associated with the HTU Module after RTOS Code is run.)

I cannot find anything meaningful from these scenarios. Please anybody help me in understating.

And how to Stop and Reset HTU/N2HET Module and re-configure it while it is working with any other configuration.?

Thanks in advance,

Regards,

Karthikeyan.K

  • Would you please explain why you want to restart the timer every 10 ms? What system level functionality do you want to achieve?

    I am not sure what you mean by "how to Stop and Reset HTU/N2HET Module and re-configure it while it is working with any other configuration?". NHET and HTU can be reset at module level through its own control registers. Are you sure this is what you want?

    One more thing. Would you please not use shaded letters in the posting? they are hard to read.

    Thanks and regards,

    Zhaohong
  • Hi Zhaohang,

    Thanks for your reply. And sorry I will not use shaded letters any more while posting. Thanks for pointing this out.


    So Let me explain my situation sir.

    Here i am using TMS570LC4357 with free-RTOS and created a 10ms Task.


    In 10ms Task, I will check whether any data/command is coming from Serial Port or not. If they come TMS570 have to respond to the command from PC.

    This is my set-up. So with this set-up, I will receive the N2HET Code Structure (equivalent Hex values) from PC at any time.

    (My PC will always send "COMMANDWord + HEXValues" at a shot. In my case I assume 0x03 as a command word and the next 640 Bytes as HET Code)

    So in 10ms Task, If I found a command from PC to update the N2HET RAM with new values, then I will update N2HET RAM with new values from PC.

    Same way, My PC can update HTU Configuration at any time. For that PC will send "0x04 (COMMANDWord)+ 240bytes (HTU Configuration Data) ".

    So as soon as I receive new HTU Configuration, I have to reset the HTU to destroy the previous HTU Configuration and I have to re-configuration HTU with new configuration scheme that comes now from the PC. I have developed separate System side application to send commands from PC.

    This is my requirement sir.

    To achieve this only I have to re-configure HTU.

    TMS570LC4357 trm says that 16th bit htuREG1->GC register is to enable HTU. So as soon as I clear this bit, HTU will get disabled.

    and 0th bit of the same register can be used to reset the entire HTU Module.

    My code is organised in the following way:

    void main()
    
    {
    
    Config_free_RTOS();
    
    Start_Scheduler();
    
    while(1);
    
    }
    
    void _10msTask()
    
    {
    
    ReadSerialPort();
    
    if(Received)
    
    {
    
     switch(COMMAND)
    
    {
    
    case 0x03: UpdateN2HET(); break;
    
    case 0x04: UpdateHTU(); break;
    
     }
    
     }
    
     }
    
    void UpdateN2HET()
    {
     if(N2HETisWorking)
     {
      StopN2HET();
      }
     memcpy(N2HETRAM,N2HETCode,sizeof(N2HETCode));
    }
    
    void UpdateHTU() // this function is getting executed but the register fields or not actually getting updated. This is my problem.
    {
     if(HTUisWorking)
     {
      StopHTU(); 
      }
    ConfigHTU(); //to update htu with new configuration.
    }
    
    void StopHTU()
    {
     htuREG1->GC = 0; //to disable HTU.
     htuREG1->GC |= 1; //to issue software htu reset.
     while(htuREG1->GC & 1); //to wait until reset get completed.
    }

    So in this code, I am updating or reconfiguring N2HET and HTU after free-rtos code begins run.

    Just as a try / test, I tried updating / reconfiguring N2HET Module and HTU Module multiple times before free-RTOS is star running. At that time I really can make whatever modification I want.

    But after free-RTOS code begins running,

    htuREG1->GC = 0; line is getting executed but if examine that register with debugger GC register is not cleared.

    I think now you can understand clearly what I am saying.

    I examined again and I noticed that I cannot update even a single bit of a register associated with the HTU Module after RTOS Code is run. This problem exist with updating HTU registers only. i.e: I can reconfigure N2HET registers (no problem), but not the HTU registers.

    Please help me to understand this and to find a way to overwrite the HTU registers after free-RTOS begins running.

    Thanks,

    Regards,

    Karthikeyan.K

  • Hi Zhaohong,

    Here I have attached the example code of my intention. Please go through this. And analyse the HTU Related registers through watch window so that you can know that they are not getting updated even still the code is tried to update them.

    7026.HETHTURTOS.zip

    Please help me in this.

    Thanks,

    Regards,

    Karthikeyan.K

  • I would suggest you to take look that reply to your other post about HTU. I think that they are related.

    Thanks and regards,

    Zhaohong