NOTICE: NXP has started migrating LPCWare.com to NXP.com. Many LPCware.com pages are being redirected to NXP.com. Please visit software and tools page for information on LPC microcontrollers.
I am trying to get the analog comparator to work on the mini kit/demo board but so far it just refuses to react on my analog input signal (I2 pin 5)
The positive input is connected to the ladder, the negative to analog in on pin 5 (which is connected to a potmeter connected between ground and Vdd). I am simply testing the output bit in the control register but it reads always as zero.
Still can not get it to work..
Both the LPC_CMP->CTRL and LPC_CMP->LAD register are stuck at zero (even after writing the appropriate bits for selecting the VP and VM inputs. Or are they write only ?
Also I think I found a typo in the manual (both PDF and online):
ACMP_I2 I PIO0_0/ACMP_I2/CLKIN Comparator input 2. Disable the CLKIN function in the PINSASSIGN1BIT0 register. PINENABLE0 SWM PINENABLE0 addressOffset = 0x1C0
Should this not be PIO0_1/ACMP_I2/CLKIN ??
Seems my analog comparator registers are non existent...
If I check PDRUNCFG it gives me 0x6d70 which should mean the comparator part is powered.
Writing (anything) in the CTRL register and reading it back gives always 0, same for the LAD register, whatever is written. Even set up my own direct pointers to the registers with the same result, always zero.
Is my LPC defective ?
Just heard that the early LPC810 had a fault in the comparator part... I think I have been bitten by that.
I done the same test as Gertk's. The comparator also can't work on my own board whose MCU is LPC810M021.
Then I downloaded the sample code bundle for http://www.lpcware.com/node/11538/256, it worked on LPC812M101FDH20, but didn't on LPC810M021.
I checked the registers on LPC810M021 and LPC812M101 when it's running via Keil MDK. The content in LPC812M101's registers had changed, but that in LPC810M101 hadn't never changed. Reading it back gives always 0 ,just as Gertk's description.
Please checked it ,thanks.
Thanks for confirming the problem.
Trying to find a replacement LPC810 DIP8 ...
Hi Gert, CaoHua,
Sorry for my late response, this thread somehow had fallen out of my scope...
I did a quick porting of the LPC812 analog comparator example from LPCOpen to the 8-pin LPC810, and indeed experienced problems with the comparator.
I need some more time to look into this, but will get back to you ASAP.
DIP 8 devices with rev. 2A are affected by this issue; indeed the analog comparator in not working on these parts.
The next device revision 4C (DIP 8 package) will have a functional comparator.
We are currently working on updating the documentation, an official errata will be published soon.
Nice to see it is officially acknowledged.
So we can expect some correct working samples 'real soon now' ?