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.

TMS570LS3137: N2HET measurement capability

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello,

I have some questions regarding the N2HET capability.

How many input signals can we measure the frequency or period of using the High resolution clock at the same time per N2HET module?

How many input signals can we measure the frequency or period of using the loop resolution clock at the same time per N2HET module?

Thanks

Scott

  • Scott,

    I will check for you

    Regards,
    QJ
  • Scott, 

    As many as there are HET pins.  The limitation is not on the # of signals;  it is on how fast the signals can change. 

    Your high pulse width and low pulse width generally need to be at least a loop resolution clock long (both of them) but check the datasheet for this spec.

    Also check the silicon errata for any variances.

  • Hello, and thanks for the response. I have a follow up question.

    The TMS570LS31x Technical Reference Manual states in chapter 20 that only one instruction specifying a high resolution operation (hr_lr=HIGH) is allowed to execute per loop resolution period. But the other instructions can be used in standard resolution mode (bit set to 1).

    Is this per each N2HET pin so that each pin could have one HR instruction in HR mode per loop? Or is it saying only one HR instruction in HR mode can be performed per loop regardless of how many pins are being captured?

    Thanks,

    Scott

     

  • There is a hardware 'timer' that is only 7 bits for each pin. 

    When you execute an instruction in HR mode it configures that timer.  That is how the HET achieves high resolution measurements while sampling basically at loop resolution. 

    So for example, the capture instruction is told when it executes whether there was an edge detected during the last loop;  but if it is executed in HR mode it will use that 7 bit hardware timer to determine the *offset* into the loop of the edge occurrance - and this is how you get the ~10ns resolution.

    It's also where the restriction comes from of one HR instruction per loop - there is only one hardware timer per pin so that it can only perform one function at a time and respond only to one event per loop.   

    There's a sort of 'workaround' on top of this - you can gang the hardware timers (HR Structures) from a pair of pins even&odd like 0,1  or 2,3  and make them operate on the even pin.   This is what the HRSHARE, ANDSHARE and XORSHARE modes are all about  (HRSHARE is for inputs,   AND/XOR are for outputs). 

    But if you use this extension you still code the same way - one instruction per 'pin' per loop but when you operate on the odd pin # it actually is tied also to the even pin in the pair. 

    Anyway, there is an HR structure for each pin and so you can execute one HR instruction per pin per loop. 

  • Hello again and thanks for the response. I have some more questions on this.

    Regarding the HRSHARE function, for the 144 pin PGE package, considering N2HET1[0] pin 25 and N2HET1[1] pin 23 for example, would we need to connect externally to N2HET1[0] pin 25 and not N2HET1[1] pin 23 for HRSHARE? N2HET1[0] would use both its own HR structure plus the HR structure from N2HET1[1] pin 23? And for sharing N2HET1[2] and N2HET1[3], we would need to connect to N2HET1[2] pin 30?

    Also, the ref manual describes register HETHRSH for both N2HET1 and N2HET2 with 16 bits from bit 0 = HRSHARE1/0 all the way to bit 15 = HRSHARE31/30. But N2HET2 only has 18 bits and also table 7-13 "Input Capture Pin Capability" in the datasheet shows that only N2HET2 bits 0, 4, 6, 12, 14, and 16 supports 32-bit capture. So since none of the odd bits of N2HET2 support 32-bit capture does that mean that HRSHARE function does not apply to N2HET2? How does HETHRSH apply to N2HET2?

    Also, if we wanted to have the capability to route an N2HET input to either N2HET1 or N2HET2, is there a way to configure that internally through software for any of the N2HET pins? Or would we be limited to only choosing the pins that appear to be multiplexed between N2HET1 or N2HET2 in the 144 pin PGE package? For example, are the following PGE package pins the only ones that can be routed to either N2HET1 or N2HET2: pins 23, 24, 31, 33, 35, and 6?

    Also, if we are only using the N2HET module for input capture and not output mode, can we just leave N2HET1_PIN_nDIS and N2HET2_PIN_nDIS unconnected? This is only for disabling PWM outputs and does not affect N2HET inputs right?

    Thanks,

    Scott
  • Hi Scott,

    On the devices where we are limited in the # of pins that can be bonded out -- we prioritize the even pins so that you can make use of HRSHARE / XORSHARE / ANDSHARE as much a possible.

    All 32 'pins' are implemented in the HET and it doens't matter if the odd are not bonded out because in the sharing mode the odd pin's logic is switched over to the even physical pin.

    For input signals unless there is a specific 'input mux' tab in HalCoGen, the input from the pin goes to all of the possible signals that are muxed onto that pin in parallel. So actually if a pin is muxed with N2HET1[x] / N2HET2[y] then you can measure that physical pin's input on both HETs simultaneously (although the timebases of HETS need to be synchronized if you want a coherent result). In this case the pinmux only controls which HET drives OUT it's value on the pin...

    So I'd look at the device specific pinmuxing information to come up w. a strategy.

    N2HETx_PIN_nDIS can be left open even if you are driving PWMs because it's an option to use this signal (not required) as a sort of shut-down input in case of an error from whatever power stage you are driving. But it's certainly not always used. There is a register in the HET that determines if it's used and I believe it defaults to 'not used'...
  • Hello Anthony,

    Thanks for your additional response on this! I have an additional question on this. Table 7-13 "Input Capture Pin Capability" in the datasheet shows that only N2HET2 bits 0, 4, 6, 12, 14, and 16 supports 32-bit capture. All the other N2HET2 bits listed in table 7-13 is says NO for supporting 32-bit capture. I believe in your previous response you are implying that all 32 bits can implement HR sharing right? But if only N2HET2 bits 0, 4, 6, 12, 14, and 16 supports 32-bit capture, then what good is it to use HR sharing with N2HET2 bits 1, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15, and 18 if these bits do not support 32-bit capture?

    Thanks again!

    Scott
  • Hi Scott,


    Yes those pins suffer from a silicon issue ..  

    It's a long story but while they all have the hi-res structure there is a silicon bug which causes them to occasionally capture the lower 7 bits incorrectly.   

    I think it's something like if the incoming edge lines up exactly at the loop resolution period then the lower 7 bits are corrupt;  they might read the lower 7 bits of the previous capture instead of what they should read for the current capture. 

    So I think you're right - you should avoid using these pins. 


    This is somewhat specific to the 31xx and 21xx series parts because it's a silicon bug but one that we don't have any design slots left to fix.


    Best Regards,

    Anthony

  • Hi Anthony,

    Thanks for the response! I have another follow-up question:

    So to confirm does that mean that, since no two adjacent odd and even pins for N2HET2 have YES in "SUPPORTS 32-BIT CAPTURE" column of datasheet table 7-13, that HR sharing function cannot be used for N2HET2? And that HR sharing can only be done on N2HET1?

    Thanks again!

    Scott

  • Hi Anthony,

    I have a follow up question regarding HR sharing. The reference manual says that the odd HET pins that are configured for HR sharing can still be accessed as general inputs/outputs. But what about the other multiplexed functions associated with those odd pins? Can the multiplexed functions still be accessed as well? For example, if PGE package pins 118 and 6 are configured for HR sharing for N2HET1[10] and N2HET1[11], can the other multiplexed functions MIBSPI3NCS[4] or N2HET2[18] associated with pin 6 still be used? Or can pin 6 only be used as GPIO?

    Thanks,

    Scott

  • Hi Scott,

    The shared channels can be treated as an internal channel for the sharing and will still be visible in the HEt registers. The issue with also using the alternate function on the muxed pin is that the inputs are shared between the muxed functions. i.e., if you use the pin as MIBSPI3NCS[4] the input to this functional input will also be shown/visible to the N2HET2[18] if they share a common pin. The mux only applies to the output buffer. However, there are some inputs that are also muxed and are specified as input mux configurations. I don't recall off the top of my head if the these specific pins have an input mux or not, but I would not anticipate that they would.
  • Yes no problem with that.

    The 'Sharing' is done inside the HET so the pinmux is a layer on top of that.
  • Hello and thanks for the reply! I have some more follow-up questions. If we are using the N2HET input to capture and measure input frequency of a signal, how sensitive is the input to non-monotonic signal edges? Is it like a clock input such that for example a 100mVp-p and 1ns to 2ns wide glitch occurring between VIL and VIH on the input signal edge will cause the N2HET to see multiple edges? Or will it only see the one edge assuming it crosses through VIL and VIH only once? Just trying to determine how clean the edges need to be before we consider having to use the input suppression filters.

    Also, if we have to use the input suppression filters, I assume this affects the accuracy of our frequency measurement right? Would the accuracy loss be a function of what value we set the filter's 10-bit down counter to as well as the frequency of our VCLK2 clock?

    Thanks again!

    Scott
  • Scott,

    That won't be a problem because its less than the sample rate of the N2HET; so it will get resolved by N2HET either as a '1' or a '0' but if its only a glitch it should be gone by the next sample point. So you may have some sampling uncertainty but it's not anything that different than the uncertainty you have anyway in sampling an asynchronous input.

    The supression filter built into the HET inserts a delay but if the 'bounce' on the rising and falling edges is symmetrical the delay will be about the same so a measurement will come out correct after accounting for the little bit of sample time uncertainty.

    If the input signal doesn't 'bounce' the same... say it bounces a lot more going 'low' than going high, then yes in that case you may keep resetting the supression filter counter on one edge direction and it may insert more delay than on the other direction - but that is a function of the input signal as much as anything.

    -Anthony