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.

TMS570LS0432: Issue with frequency detection using N2HET while all used channels are connected to same frequency source in TMS570LS0432

Part Number: TMS570LS0432

HET channels are used to measure the speed sensor output frequency (sensor frequency varies with speed) in my project. 4 speed sensors are connected to 4 channels of HET.

PROBLEM: when 4 channels are connected with different inputs then frequency is getting detected in all 4 channels. But when all channels are connected to the same frequency source then  

                    1. only first channel is detecting the frequency and all other channels are showing false values

                    2. if 2,3,4 are connected to same source then 2nd one is detecting but all other channels are showing wrong values 

                    3. if 3,4 are connected then 3rd one is only detecting the frequency

I ensured that there is no loading to HET in any case mentioned above, and measured the frequency at every HET channel input  in every case (clean signal is coming to HET with no distortion)

WCAPE instruction is used for capturing time stamp and edges for all channels and CNT instruction for free running counter

24, 26, 28, 30 pins of HET are used

WCAPE instructions for 4 channels respectively:

program field: 0x00005000,  0x00007000, 0x00009000, 0x00001000

control field: 0x00001820, 0x00001A20, 0x00001C20, 0x00001E20 (respectively for 4 channels)

register values:

DOUT- 0x00000000;

DIR- 0X00555555;

PDR- 0x00000000;

PULDIS- 0x00000000;

PSL- 0X00555555;

HRSH- 0x00000000;

AND- 0x00000000;

EXOR- 0x00000000;

PFR - 0x00000300;

PCR- 0x00000005;

PRY - 0x00000000;

INTENAC- 0xFFFFFFFF;

INTENAS - 0x00000000;

GCR - 0x00030001;

HET filter is not used.

please, provide a solution for the issue.

 

  • I also did the above mentioned experiment with different edges for adjacent channels (24, 28 positive edge; 26, 30 negative edge), But this time 24, 26 channels detected the frequency, but the remaining 2 showed wrong value.

  • I will study your settings, and come back to you later today.

  • Can you please show me your NHET code? I'd like to know the "Conditional Address" of each WCAPE instruction.

  • Hii Wang,

    NO conditional addressing is used in the program, 5 instructions (one CNT and 4 WCAPE) are used which will run in sequential manner.

    Already I mentioned the "Program and Control fields" of all WCAPE instructions which will give the information about conditional address and next program address.

  • Can you change the "Conditional Address" to the value of "Next address"? Otherwise only the first WCAPE instruction is executed, and other WCAPE instructions can not be reached.

  • In the "next program address" field of first instruction, the address of next instruction is given and all further instructions given in the same way (1-2, 2-3, 3-4, 4-1).

    Mr. Wang, all the WCAPE instructions are providing true data when different frequency sources are given, problem comes when all the provided with same source of frequency ( in this situation also all WCAPE instructions are executing, but giving wrong values)   

  • all the WCAPE instructions are providing true data when different frequency sources are given, problem comes when all the provided with same source of frequency

    If the condition address is left BLANK, the code execution will jump to the first instruction when the FALL edge is detected. If the 4 inputs are different, the fall edge of 4 inputs doesn't occur in the same loop period, so all the WCAPEs can be executed. If the 4 inputs are the same, the fall edge of 4 inputs occur in the same loop period, so code jumps to the 1st instruction after the 1st WCAPE is executed.

    Please try those instruction:

    L00 CNT { reg=A,max=0xffffff,data=0};
    L02 WCAPE { next=L03,cond_addr=L03,pin=24,event=FALL,reg=A};
    L03 WCAPE { next=L04,cond_addr=L04,pin=26,event=FALL,reg=A};
    L04 WCAPE { next=L05,cond_addr=L05,pin=28,event=FALL,reg=A};
    L05 WCAPE { next=L00,cond_addr=L00,pin=30,event=FALL,reg=A};

  • Mr. Wang, Let me try with the code you have given.

  • MR. Wang, Thank you so much for your code, its working now.

  • Mr. Wang, Can I know that is the difference between CONDITIONAL address and NEXT PROGRAM address??

  • 1. next address: the program address of the next instruction in the program flow. 

    2. conditional address: the address of the next instruction when the condition occurs.

    L02 WCAPE { next=L03,cond_addr=L03,pin=24,event=FALL,reg=A};

    If ( event = FALL edge of pin 24 )
    {
            Immediate Data Field = Selected register (A) value;
           Jump to Conditional Address L03;
    }
    Jump to Next Program Address L03;

    If you don't define the conditional address, the default value of conditional address is 0:

    L02 WCAPE { next=L03, pin=24,event=FALL,reg=A};

    If ( event = FALL edge of pin 24 )
    {
            Immediate Data Field = Selected register (A) value;
           Jump to Conditional Address L00;  --> L03, L04, L05 will not be executed!
    }
    Jump to Next Program Address L03;