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.

Retrieve data from N2HET

Other Parts Discussed in Thread: HALCOGEN

Hi

I need to retrieve the data from the N2HET1 and N2HET2 RAM to the CPU but I have no idea of how to do it. I looked at the HAHSCPTO examples but I didn't understand that part... 

I really appreciate the help...

thanks!!

  • The base address of the RAM for each N2HET is in the datasheet:

    The structure for the N2HET RAM is in the TRM:

    If you know which instruction you want to read the data field of, you can then calculate the address you need to read.

  • ooh okok 

    I need to take a closer look to remember the directions but... I think I get it. And need to look for some examples with the code lines needed. Why some banks on the data sheet but on the HET IDE different ones?? 

    But... why not use the HTU?? 

    or maybe, how to use the HTU to do this for me and then only retrieve the data from DMA?? I mean... I know my MCU has the HTU but Halcogen doesnt have the option to configure it. And looking at the SPNA130a (http://www.ti.com/lit/an/spna130a/spna130a.pdf) I really don't know how to do that hehe

    but lets talk with an example, to make things a little bit more clear to me 

    Lets say I have the variable "Hola", which is a counter on my N2HET1 code and the variable "Adios" (another counter) on my N2HET2. "Hola" is on the Program Field Address XX0010h of N2HET1 and "Adios" on the  Program Field Address XX0030h of N2HET2. 

    Using the HTU, how would I do to retrieve the data from both variables?? All I have on the htu.h file is this: 

    #ifndef __HTU_H__
    #define __HTU_H__
    
    #include "reg_htu.h"
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    /* USER CODE BEGIN (0) */
    /* USER CODE END */
    
    /* HTU General Definitions */
    
    #define HTU1PARLOC		(*(volatile uint32 *)0xFF4E0200U)
    #define HTU2PARLOC		(*(volatile uint32 *)0xFF4C0200U)
    
    #define HTU1RAMLOC		(*(volatile uint32 *)0xFF4E0000U)
    #define HTU2RAMLOC		(*(volatile uint32 *)0xFF4C0000U)
    
    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    
    #ifdef __cplusplus
    }
    #endif /*extern "C" */
    
    #endif
    

    Thanks Bob!!

  • Hi Bob
    Hope you're doing great
    Im having a lot of trouble trying to retrieve the data... I would really appreciate some help...

    Thanks!!
  • How do I use this information? 

    I read the example but I could not understand anything. I really need to solve this in this week... 

    Does anyone knows how to do that or have an example for that? Im not talking about the HAHSCPTO because I did not find it usefull..

    thanks

  • /cfs-file/__key/communityserver-discussions-components-files/312/2781.TMS570LS1224_5F00_HET.zip

    Here is an example project using HALCoGen 4.06.00. In this project I used the default HET program from HALCoGen but configured PWM1 to be an output PWM on HET[16], and configured capture 0 to capture the low pulse and the period of HET[30]. I then externally connected the two pins together so CAP 0 measured PWM 1. Look at the function capGetSignal in the HALCoGEn file het.c. Line 1830 reads the data field of 25th HET instruction (lines 501-517)  which is the capture of the low period. Then line  1831 reads the data field of the 26th HET instruction (lines 518-534) which is the capture of the total period. So this example uses hetINSTRUCTION_t type and the index of the HET instruction to identify the data.

    Look at this post from Charles.  LINK

    In this example he uses labels on the HET instructions to generate the HET instruction index.