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: How can HOST CPU directly read N2HET calculate result

Part Number: TMS570LC4357

Currently I have an application required doing XOR calculate with N2HET micromachine over multiple PINs and set flag within N2HET RAM. My thoughts is to use XOR with SHIFT cmd and MOV32/MOV64 to set flag on an absolute address in N2HET RAM, then host CPU can access RAM and read directly. Is that doable?

Besides, I have read through technical manual, but the definition of "remote address", "IMM", "IMMEDIATE DATA FIELD", "REMP" and "REMPS" are confusing. Below are my understanding, please help verify.

Remote address: 9-bit absolute address in N2HET RAM space. Aligned to 32 bits. Moreover, N2HET RAM can be used to store either instructions or pure data. Once remote address gives an address, the target address will be treated as a normal RAM space and data can be write over RAM space freely.

IMM, IMM DATA FIELD: Current instruction data filed (32-bits)

REMP, REMPS: Not clear

And my final question is, can N2HET program read/write other peripherals register? For instance, use N2HET to initiate a SPI read, and read data received. Is that possible?

Looking forward to hear soon and many thx!

 

  • Hello Yiran,

    Yes, the host can read the result from the NHET RAM, and host can also write data to the NHET RAM. This is the example. The function is used to read the period of a PWM, and write the new duty cycle, from/to the data field of the NHET instruction.


    /** Duty cycle in % of the period; >0 and <100 */
    void pwmdbSetDuty(hetRAMBASE_t * hetRAM, float pwmDuty)
    {
    /* In out design: lr=128, and hr=1: LRP=128*HRP, and HRP=1*Tvclk2*/
    float pwmPeriod; //us

    /*Since lr=128, Data[31:0] is the period (how many HRP) */
    pwmPeriod = hetRAM->Instruction[pHET_BUFPER_0].Data;

    hetRAM->Instruction[pHET_BUFDCA_0].Data = (pwmPeriod * pwmDuty) / 100U; //for postive duty
    }

    You can also access the memory by absolute address. The base address is: 0xFF460000U
  • Hey QJ Wang,

    Thanks for your reply.

    I've written some test NHET codes to help clear my thought about this peripheral. The answer to my last question is appending here to help others who just start learning NHET. Correct me if I'm wrong.

    1. The answer to the verify first question is the plan is completely doable and already achieve. Only need to note that NHET can only read one PIN per instruction.

    2. Most of terminology understanding is correct, except "N2HET RAM can be used to store either instructions or pure data". Each N2HET address is combine of 32-bit CMD, 32-bit Control field, 32-bit Data field and 32-bit reserved. Each address can have all three components and each components can only set within its own field.

    3. N2HET may not able to access other peripheral memory as HTU was designed to exchange data between main RAM only and NHET RAM. The only data soruce for N2HET machine is
    1). NHET PINs
    2). IMM and REMOTE data. Note that IMM and REMOTE value can be modified by main CPU over either absolute address or HTU
  • Hello,

    Yes, you are right, one NHET instruction can only read/write one NHET pin. The host CPU can write any data to NHET RAM as regular SRAM. For example, you can store some data to NHET RAM temporary during SRAM PBIST. The HTU is tightly coupled to the NHET and is not intended to transfer data from other peripheral modules.