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.

TMS570LC4357: HTU not working, what am I missing?

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hello, I'm trying to get the HTU up and running. I'm following this example project: http://www.ti.com/lit/an/spna130a/spna130a.pdf (it's for a different MCU though so I'm not able to use the example project).

So far this is the code I'm using to initialize the HET and HTU:

Note: I do more to init the N2HET, however it isn't related to the HTU.

And this is my HET code:

From my understanding, this should write the period of the signal I'm sending on N2HET[2] to the buffer bufferA. However, when I debug the code and look at the buffer, no values are updated(NOTE: I've initialized the values of the buffer to 1, I wanted to make sure that PCNT wasn't sending 0 and I was missing it) :

It should also be noted that when I debug the program and read the data from the PCNT instruction, I get an actual period. So I'm confident the N2HET is working correctly. It's just that the HTU is not passing that data to the N2HET. 

Is there something I'm missing? Or does there exist an example HTU project for the TMS570LC4357?

Thanks.

  • Hello,

    One shot buffer mode is used in your code. If TMBA is set to one shot buffer mode (0x0) then the data stream will stop after all elements of buffer A have been transferred. This means that the corresponding DCP will be disabled after the last frame was transferred to/from buffer A and CFTCTA decrements to 0.

    Request Destination Select Register (HETREQDS) is used to choose HTU or DMA or both are used. But you configuration is to use none of them.

  • Thanks for the quick response :)

    Even with one shot mode, I should still have some data from the HET in the buffer, correct? 

    As for HETREQDS, I believe I am correctly setting it up for HTU. My code is:

    hetREG1 -> REQDS    &= 0xFFFEFFFE;      /* Set bits TDBS0 and TDS0 to 0     */

    And the data sheet shows:

    Meaning I should clear bit 0 and bit 16. 

    Is this incorrect? 

  • Just checked TRM. Yes, you are right. TDS0=0 means HTU is used.

  • Hello,

    I have figured out why it was not copying data from the HET to the RAM. 

    It was because of the MPU. I had thought that maybe the MPU had something to do with this, and I had disabled the MPU, but that didn't fix the issue. 

    What I ultimately needed to do was to configure a MPU region as "DEVICE_SHAREABLE." I set it up in HalCoGen like so:

    0x08001500 is the address where my array is located.