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.

Configure N2HET as two masters or two slaves?

I need two N2HET units clocked independently of each other. The TRM is not clear in whether the setting should be CMS = 0 or CMS = 1 for both units. Table 23-14 (on GCR, page 1102 in SPNU515B) reads "By default, this bit is reset, which means a slave configuration" (or independent units, I guess).

The Block Diagram (Figure 23-1, page 1062 in SPNU515B) could help but is bogus: A slave setting leads to a conflict between the thus-enabled driver and the prescaler output, while configuring both units as masters would lead to a conflict between the two drivers of the connecting line.

There is another uncertainty. The Block Diagram indicates synchronization of LRP only while the text to the CMS bit reads "to synchronize the prescalers of the slave N2HET" which I interpret as both HR and LRP being synchronized (different HR values are probably never useful).

  • Rainald,

    You should set CMS=1 on both N2HETs.

    NB: There is nothing to ensure in this case that there will be an offset between the HET LRPs, it will depend on the timing of the code that enables N2HET1 and N2HET2.

    Good thought about the HRP being synchronized. The intent is to have both HETs start their loop counter simultaneously. Would need to research whether that means they are synchronized down to the same internal clock (VCLK) or just that both loops start within the same HRCLK of each other. Most times you would use an HRCLK divider of /1 though so that you get highest resolution - and in this case synchronizing the loop resolution clock start time would mean the two HETs are completely sync'd (so outputs from one HET v.s. other HET triggered by the same compare value on the synchronized counter would trigger within the same 'cycle' as each other - and only differ by some propogation delay difference on the device (clock to data out delay).
  • Thank you, Anthony.

    I have tested CMS = 1 in both units: Loop-back with slightly different LRP yielded the expected slow phase drift.
    CMS = 1 on both N2HETs is astonishing, however, since CMS = 0 is the default after reset. Please update the TRM.

    Best regards,
    Rainald