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.

Program, Control, Data word insertion

Other Parts Discussed in Thread: HALCOGEN

I want to put the instructions (PCNT, BRANCH) which the HET IDE so kindly generated into the RAM so that the HET will carry out my algorithm.

I can't just include the .c and .h files that the HET IDE generated because the std_het.h library isn't included.

Andd I can't include the std_het.h library because it apparently conflicts with the libraries generated by HALCOGEN.

The header will probably be necessary as well.

Is there a different library I can use to replace std_het.h?

So, how do I put a few words like this..(PCNT, BRANCH)..

#include "std_het.h"  

HET_MEMORY HET_INIT0_PST[2] = 
{

/* L01_0 */ 
{
0x00001768, 
0x00000000, 
0x00000000, 
0x00000000
},

/* L02_0 */ 
{
0x00000D00, 
0x00000000, 
0x00000000, 
0x00000000

};

// INTO THE HET MEMORY LOCATION?

  • So I tried simply inserting my words within the program like this:

    //BEFORE

    /* PCNT: Capture Duty 0
    * - Instruction = 25
    * - Next instruction = 26
    * - Conditional next instruction = na
    * - Interrupt = na
    * - Pin = 0
    */
    {
    /* Program */
    0x0001A700U | (0U << 5U) | (0U),
    /* Control */
    0x00000000U,
    /* Data */
    0x00000000U,
    /* Dummy */
    0x00000000U,
    },

    //AFTER

    /* PCNT: Capture Duty 0
    * - Instruction = 25
    * - Next instruction = 26
    * - Conditional next instruction = na
    * - Interrupt = na
    * - Pin = 0
    */
    {
    /* Program */
    0x00001768,
    /* Control */
    0x00000000U,
    /* Data */
    0x00000000U,
    /* Dummy */
    0x00000000U,
    },

    I thought that the words would then appear somewhere near the base address 0xFF460000h. But I couldn't find the words anywhere. 

    Additionally, writing the words directly to the RAM somewhere after 0xFF460000h doesn't seem to cause the algorithms to work.

    How do I get data from the HET?

    How do I ensure that my program words are being executed?

    What should be in my main function?

    ANY help would be greatly appreciated!

    Charlie

  • Charles,

    We answer another post from you with a similar question.
    An example is part of this answer.

    One point that I want to clarify, the HET program is a structure of data with a field for Instruction (32bits) for Control (32bits), for Data (32bits) and reserved (32bits).
    This structure is created by the HET_GUI or Halcogen and is part of the HET.C file.
    After compilation and link, this structure is part of your application code as constant.
    At runtime this structure has to be copied to your HETRAM using a memcopy.
    Halcogen, is taking care of this copy in the hetInit() routine. (aside of configuring all HET register according to your configuration.

    Please let me know if this help you understanding HET.

    Thanks and Regards,

    Jean-Marc

  • Jean-Marc,

    Thanks for all the help so far.

    The device is now running!

    I am trying to using the PCNT algorithm with the program field: 0x0000 1768

    The problem: HR DATA IS ALWAYS 0!

  • Charles,

    Will it be possible for you to send me your project so I can have a look?

    I'm still not clear if you are using HalCoGen, HET_GUI, existing demo project or a mix of all.

    Please let me know.

    Jean-Marc

  • I am NOW using halcogen to generate most all of the code.

    I simply inserted the PCNT instruction as written by the HET IDE.

    Here is het.c: 0243.het.c

    Here is sys_main.c: 8054.sys_main.c

    The problem:

    Of the 25 bits which I expected to see in the data word from the PCNT algorithm, only the 20 Most Significant Bits were represented.  The High Resolution data (5 Least significant Bits) are always 0!

  • So, the HR data did not show up because the Loop Resolution Prescaler (IN THE HET, CONTROLLED BY THE PFR REGISTER WHICH IS MAPPED TO THE MAIN SYSTEM MEMORY AT LOCATION 0XFFF7B804) was set to 6 (110) by halcogen. 

    It is made clear in the documentation for the TMS 470 that 6 and 7 are reserved in the LRP encription (ONLY 0-5 ARE VALID).

    Therefore Halcogen is setting the loop resolution to an illegal value by default.  

    This problem should be confirmed and then addressed.

    ..

    Charlie

  • Charlie,

    Can you confirm that with a prescaler value of 32 or smaller your problem is no more visible?

    I will have a discussion with the development team working on Halcogen and ask for a fix if this problem is confirmed.

    Thanks and Regards,

    Jean-Marc

  • So the Loop Resolution Prescaler Value determines wether the HR data is seen in the data register.  When Halcogen sets the value to 6 or 7, no HR data is seen.

    BELOW: Notice the five LSB in the highlighted data word on the left (for PCNT instruction) with illegal 0x0000 0600 and legal 0x0000 0500 in HET control register HETPFR.  The HR data bits are all 0s with the illegal HETPFR field.

  • Charles,

    I have the confirmation that this problem will be fixed in Halcogen.

    I don't have a precise date for the next release (03.02.00) but has soon as it is available you will be able to update your version of HalCoGen.

    If you consider your question has answered, please mark this post has "verified answer"

    Thanks and Regards,

    Jean-Marc