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.

Tivaware analog comparator configure suggests only one reference input Comp0+.

Guru 56188 points

Other Parts Discussed in Thread: TM4C129XNCZAD, TM4C1294NCPDT

The data sheet text infers (each) individual analog comparator can use the +ve input C0+ as external input reference voltage.

Is the Doxygen text just worded strange so it seems ComparatorConfigure can set each ANLGCOMP 0-2 but only for COMP_ASRCP_PIN0 only?

Shouldn't it be (each) comparator, not "for the comparator 0" - there's 3 analog comparators. Perhaps makes more sense if it stated C0+ input of each comparator. The wording in Doxygen differs from the datasheet wording makes it sound like all the comparators use only comparator 0 C0+ input source.

//! - \b COMP_ASRCP_PIN0 to use the Comp0+ pin as the reference voltage (this the same as \b COMP_ASRCP_PIN for the comparator 0).

It seems the configuration below should use (each) comparator C0+ input or does it only use comp0+ input as the Doxygen states?

/* Configure each ANALGCOMP Cx0+ input for (+ve) external 
 * reference input source */
 ROM_ComparatorConfigure(COMP_BASE, 0 , (COMP_ASRCP_PIN0));
 ROM_ComparatorConfigure(COMP_BASE, 1 , (COMP_ASRCP_PIN0));
 ROM_ComparatorConfigure(COMP_BASE, 2 , (COMP_ASRCP_PIN0));

  • Hello BP101,

    No. It means that either each comparator can have its reference or they can refer to Comparator 0+ pin. For Comparator 0 this setting of using individual 0+ or Comp 0+ pin is the same.

    Regards
    Amit
  • Hi Amit
    >For Comparator 0 this setting of using individual 0+ or Comp 0+ pin is the same.
    Ok that one seems strait forward but gets confusing when all 3 are being used so what about the other 2 comparators?

    So the configuration above appears ok if we want each comparator (+ve) input to be the external reference. Gets even more confusing in PinMux Tool showing each comparator input as C0+,C1+,C2+ . Data sheet fig 22-2 then states the input source for Vin+ can be the C0+.

    Perhaps it better to say each comparators (+ve) pin can be the external input source, in datasheet and Doxygen. Using the short Comp0 when there is a comparator 0 is confusing makes it seem like COMP_ASRCP_PIN0 assigns each individual comparator (+ve) to C0+ shown in PinMux Tool. See what I mean?

    So the single define is used to set all 3 comparators (+ve) input source: #define COMP_ASRCP_PIN0 0x00000200 // Comp0+ pin

    Thanks for clarify this - Sorry for confusion double checking SW configurations and trying to avoid surprises in HW configurations.
  • Hello BP101,

    The Tiva PinMux tool is being obsoleted by the TI Pin Mux Tool, which fixes the issue of "+"

    e2e.ti.com/.../451208

    My question: What is the configuration you want. Independent reference or Common reference Pin?

    Regards
    Amit
  • BP101 said:
    seems strait forward

    Magellan - sailing his "strait" - found such water passage not so straight forward!

    On the tech front - there are "known methods" to "peak detect" the outputs of 3 current (or other) sensors - and feed that "peak" signal into a single, ANALOG Comparator.

    (thus escaping the need for three...)

  • Hi Amit,
    Ideally 3 independent external reference (+ve 0) input . Might consider going to 1 external +Vref for all 3 comparators, fewer circuit traces resistors etc.. The PCB is currently laid out for 3 independent +Vref inputs.

    For some reason the datasheet fig 22-2 discussion shows only C0+ omitted C1+, C2+ inputs being available. Yet fig 22-1 shows C0+, C1+, C2+. So it appears all 3 (+ve 0) comparator inputs are valid for external +Vref source.

    Thank you for new TI PinMux Tool link, has it been regression tested to work with *.pin file from Tiva PinMux Tool v1.04?
  • Hello BP101,

    The Fig-22-2 is for a single comparator unit, while Fig-22-1 is the whole comparator peripheral.

    No, the TI Pin Mux Tool is not compatible with Tiva Pin Mux Tool.

    Regards
    Amit
  • The only draw back to 1 is better than 3 scenario, all redundancy is lost in the 1 only. How valid is redundancy in real world may boil down to unexpected environmental conditions such as a 15kv ESD entering 1, might be the end of any PWM fault fail safe. Who would even know until fault mode didn't work when it was expected to.
  • Recall that not all decisions are "strictly" tech-based. My small firm is a bit ahead of yours - we've had to "blend" from multiple choices involving Sales, Legal, Production, Finance & Tech. As you enter the "real-world" market - I'd not be too surprised - if your advisors will suggest very much as Robert/I have outlined.

    It is immensely difficult for "Lone Ranger" to, "Know and Do" ALL!    Even though - and especially as - I've been to Engineering & Law school - I regularly consult w/more skilled/practiced/focused others - so that we have the best chance of, "getting things right."   Mistakes and "unchecked hopes/beliefs" prove COSTLY!

  • How does that have anything to do with suggested system redundancy. Perhaps you have been following ridiculous (human) regulations for so long your best judgment has been compromised, when perhaps you should challenge them to consider all the scenarios.... Such regulations and rulings could end in life threating situations or drawn out law suites.

    GM is currently fighting 100's of law suites from ignition switch failures. Such electronics lacked redundancy and killed people as a result. Pass key III ignition switches randomly turning to the off position killed several people. The new dumb ass CEO went in front of senate hearing committee lied through her teeth she knew little to nothing about that - she was after all the new CEO. Engineers had been filling reports for over a year about key failures.

    I have such a failed key cylinder removed '04 Chevy classic Malibu. The key can as reported in the recall randomly switch off shutting off the engine. The driver trying desperately can not rotate the key back to the on position (EVER again) as it is a defective lock cylinder also a misdiagnosed issue by GM. The Hall sensor module in the pass III key lock mechanism detects the transponder embedded in the key but can not override the BCM. This case the odometer output from the PCM can't tell the BCM the vehicle is still moving as the pass key III system has no built in redundancy. In fact a person can not put the vehicle back into drive if they panic and shift it into park being a cable connects into the back of the ignition switch, antitheft when the shifter is in Park. There is no excuse for that (what if) scenario being skirted over or ignored. Long story short we struggled just to get the vehicle onto tow truck, in my genius popped the shift cable off the transaxle under the hood and manually shifted to neutral. My daughters car, first born and man you can bet that would put me over the edge had she been a fatality victim of misinformed regulators. Purchased the car 2 days before that occurred and had no idea this was an issue other than dealer stated there was a recall. The dealer only adds inserts to the elongated key slot - that's it.  How pathetic!

  • BP101 said:
    100's of law suites

    That would be, "suits."

    BP101 said:

    How does that have anything to do with suggested system redundancy. Perhaps you have been following ridiculous (human) regulations for so long your best judgment has been compromised, when perhaps you should challenge them to consider all the scenarios.... Such regulations and rulings could end in life threating situations or drawn out law suites.

    Being able to SELL into the "reasonable" market suggest that compliance w/normal/customary Agency requirements has EVERYTHING TO DO w/business success...  

    I'd saddle - then mount my trusty steed - and charge the nearest windmill ... prior to following your direction to "challenge them!"

  • >Being able to SELL into the "reasonable" market suggest that compliance w/normal/customary Agency requirements has EVERYTHING TO DO w/business success...

    Nobody ever challenged that premise - yet refuting that adding redundancy some how violates regulation is simply ridiculous.

    The USA is a free market to sell your products and is very accepting of value added safety benefits protecting human life. There are more agencies protecting your right to add life saving redundant methods far exceeding the one or two who do harm unto the public. Hopefully Donald Trump will send some of those agencies packing with pink slips. As for CEC, UL, IEEE those boys need a lesson in futility how to be a little more accepting that sometimes their way may not always lead to the highway of enlightenment. They are not GODS.
  • Someday - as and "if" you actually "go to market" - your attitude will (most likely) change!   [cb1 departs this "dead horse."]

  • Hopefully the market will have recovered sanity before some people get those pink slips!
  • Hi Amit,

    >My question: What is the configuration you want. Independent reference or Common reference Pin?

    My posted reply to you is MIA - it was here the other day now it is gone? Responded to your question in the above post. Desire independent external C0+,C1+,C2+ but you never answered that with the PinMux Tool reply. At least currently that is the way the PCB is configured for 3 sets of external resistor dividers to set the +Vref into each external analog comparator input C0+,C1+,C2+.  

    Thank you!

  • Hello BP101,

    I did. Anyways still: The Tiva Pin Mux tool is not compatible with TI Pin Mux tool, so data needs to be re-entered. Also the issue of the wrong pins has now been fixed in the TI Pin Mux tool and the good thing about the new tool is that if there is a code generation error, then a simple data file release on the forum can be used to update the Desktop version of the tool to correct such mistakes.

    Regards
    Amit
  • Hi Amit,
    That was your question to me highlight in green. I try to answer your question again hoping to get a reply. Lol

    Wasn't referring to the PinMux part of the question but --- (the wrong pins has now been fixed in the TI Pin Mux tool)? You are referring to the pin names only? In TivaPinMux Utility v1.04 C0+,C1+,C2+ are the exact same names/pin# shown in datasheet Fig 22-1. Does the fix somehow impact the actual location of the analog inputs shown in Fig 22-1?

    Your question to me about does the configuration posted above fill the requirement to have all three C0+,C1+,C2+ as independent inputs. It seems as if it should - just wanted an expert second opinion. What say Amit is Tivaware configuration posted above good for 3 independent inputs C0+,C1+,C2+ or really messed up? Sorry for being redundant, don't like re-describing (it). What does (it) actually describe and could (it) in my mind not be your (it), see what I mean (it) just don't always add up. Lol
  • Hi Amit,

    FYI:
    The new TI-PinMuxTool only has the Tm4c129XNCZAD and not the Tm4c129xNCPDT. Ran auto update and still TI-PinMux does not find NCPDT. Do like the looks of the new GUI. Will relaunch autoupdate-windows.exe in the root folder in a week or so.
  • Hello BP101,

    The only part in the 128 pin package right now available is TM4C1294NCPDT. I just checked the Cloud Version of the tool to confirm the same.

    Regarding the previous post: The fix does not affect the position of the pin only the names generated.

    Regards
    Amit
  • Hi Amit,

    The desktop version  downloaded from the link to the post does not have the Tm4c1294NCPDT in the package installer.

    Seems the assignment for external (Cn+) pins are default 0x0 (Normal) ASRCP bits all 3  control registers. We can use comparator 0 (C0+ PIN0)input assigned as a single external reference or use the default (comp_output_normal 0x0) for all 3.

    Fig 22-1 shows the (C0+) input side of Mux tie on the outside of the ANLGCMPBLK tied to alternate. Fig 22-2 shows the same tie (C0+) tied to the alternate (1) on the output of the very same Mux tie. Seem to recall grasping that back some time ago. The little tiny black dot inside yellow square.

  • Hello BP101,

    Thanks for letting us know that the desktop version does not have the 2 of the 4 units that were to be released and are on the Cloud version of the tool. I am checking the same internally.

    Regards
    Amit
  • The cloud TM4c1294NCPDT is working great as is a certain overtime very loyal TI employee!
  • Hello BP101

    Appreciate your acknowledgement. But it was a serious lapse of not having reviewed the final release of the Desktop version.

    Regards
    Amit