LPC15xx comparator large propagation delay

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC15xx comparator large propagation delay

696 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by p.h.v.heumen@gmail.com on Thu Mar 03 08:25:17 MST 2016
Hi,

While implementing a sensorless BLDC motor controller with the LPC15xx I encountered the problem that the analog comparators have a large propagation delay of several of hunderds microseconds. From the datasheet one would expect something in the order of nanoseconds instead.

The way I observe this large delay is in the following configuration:
- Inverting input is connected to the internal voltage divider.
- Non-inverting input is connected to a ADC pin and is driven by a function generator. The waveform applied is a sqaure wave from 0V to 2V with a rise-time of about 40 ns.
- The output is connected trough the switch matrix to an arbitrary pin.

For different settings for the voltage divider the delay of the output to the input square-wave varies from 50 us to 600 us.

I also tested to connect the Inverting input to a physical pin and apply a constant voltage to that pin. Here I do similar observations.

In the figure you see an example of a measurement. The yellow and blue trace is the non-inverting input and the purple trace is the comparator output.

Are there any commonly made mistakes that causes this large propagation delay?
Labels (1)
0 Kudos
11 Replies

160 Views
ianbenton
Senior Contributor I

Did your "shotgun debugging" determine whether this action depended on the setting of VLADREF - bit 22 of the comparator register?

0 Kudos

160 Views
danlhajek
Contributor II

Did not tested VLADREF bit. PCB is now under test and is running 24/7 from june. I do not want ruin that uptime. Another version of pcb will arrive next week. I will test it and let you know (changes on pcb are not related to comparator, I forget some mounting holes).

Pros: It works stable now

Cons: Undocumented "hack" on sample of 1 

0 Kudos

160 Views
danlhajek
Contributor II

Problem Solved (probably)

IMPORTANT !!!

You must power-up one strange peripherial named  VDDADIV_PD. Even in lpcxpresso is remark "what is this for ?"

Just clear SYSCON->PDRUNCFG bit nr. 19.

Defined as SYSCTL_POWERDOWN_VDDADIV_PD in lpcopen (not a single reference to this symbol in library).

For sleep modes check PDAWAKECFG register too.

No idea why...

(future testing required)

0 Kudos

160 Views
ianbenton
Senior Contributor I

Did you find that my dumb luck or was there a reason you tried it?

I've just done a text search for VDDADIV_PD in the manual and it appears NOWHERE else except in the description for bit 19 of PDRUNCFG and PDWAKECFG, and it doesn't say it has anything to do with the comparator!

It does say "Voltage ladder can be separately powered down for applications only requiring the comparator function", but doesn't tell you how to. And from the way it is worded, one would expect it to be normally powered UP.

0 Kudos

160 Views
danlhajek
Contributor II

Are you familiar with term "shotgun debugging"? Power up every analog peripherial. It is broken, you can not break it more :smileyhappy:.

0 Kudos

160 Views
ianbenton
Senior Contributor I

Thanks for the warning. I was about to use the comparators in a switched-mode supply-type application.

Did you observe any differences in changing the DLY (delay) settings?

If you read the datasheet you will see a current consumption of 38uA and a propagation delay of 24ns - doesn't that seem rather too good? The best Texas can manage in standalone comparators for that power consumption is 250ns, and most of their low-power comparators are >5us.

0 Kudos

160 Views
danlhajek
Contributor II

Limit on my setup is around 5kHz (!!!!) triangle shaped input signal. Any faster and comparator is stuck on high level. Delay settings, clock  settings, pin filter settings - no positive effect. Chip is 64pin lpc1549, comparator output is routed to to pin via swm. Interrupt from comparator is affected too. Same results on comparator #0, and #2. I am out of ideas.

0 Kudos

160 Views
ianbenton
Senior Contributor I

There seems to be quite a bit of stuff AFTER the comparator (p527 of the manual). I wonder if it's a perfectly good comparator, and this is messing it about. I seem to remember having a go with the comparators in the LPC800 and not coming across any problems, and the LPC8 and LPC15 have much the same peripherals.

How did you set CLKDIV? (and bit 30 of SYSAHBCLKCTRL0), and PDRUNCFG?

0 Kudos

160 Views
danlhajek
Contributor II

Two years later still same problem. Errata - nothing. Comparators are slow as hell and not a single word from nxp.

Do not use them.

0 Kudos

160 Views
zdravkodimitrov
Contributor I

Hello,

I would like to confirm findings of p.h.v.heumen.

I also faced large propagation delays on ACMP1 and ACMP2 with LPC1549(LQFP100). I did not make a special test setup to investigate deeper but I found that edges are missing on the ACMP1.IN3 and ACMP2.IN3.

Than I routed the ACMP output to a pin and confirmed that some of the pulses shorter than 100 us are missed.

Bypassing the ACMP solved the problem.

However in the datsheet it is specified that the propagatiopn delay of ACMP is 250 ns in the worst case.

I am also interested in finding the root cause of this behaviour.

Regards

Zdravko

0 Kudos

160 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos