Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/03/05 11:52
Read: times


 
#104621 - LPC922 Comparator Interrupt Problems.
Dear Forum Members,

I am using P89LPC922 micros in some of my products. In one product design some functional abnormilities were reported by one of my customer. I investigated the problem in detail and found that the comparator output flag oscillating and cause interrupt to get triggered more than ones were it should ideally get triggered only once. The comparator 1 of lpc922 is used for zero cross detection of AC mains supply. The hardware connection is as shown below.



The input on right side is 2.5V AC from a step down transformer. The code for interrupt initialisation is as follows.

PT0AD=0x70;    // Disable digital inputs on comparators.
P0M2=0x00;     // All pins in port 0 made input only.
P0M1=0xFF;
CMP1=0x24;     // Comparator A Ext Ref. Output enable.
ms_delay(10);  // 10ms Delay to start comparator properly.
EC=1;          // Enable Comparator Interrupt.
EA=1;          // Enable Global Interrupt.


I have worked on this problem for couple of days and couldnt solve it. The interrupt should come every 10ms upon detecting the zero cross [ 50Hz line freq. ] but at every zero cross it comes 2 to 3 times. As a quick fix i tried putting some dummy nop in Comparator interrupt routine and the repeated interrupt problem gets fixed. I dont have a DSO to test the things. From my experimentation one thing is clear the interrupt comes again and again upto 100us after real zero cross. Please help me with this problem.

Thanks & Regards,
Prahlad Purohit



List of 35 messages in thread
TopicAuthorDate
LPC922 Comparator Interrupt Problems.            01/01/70 00:00      
   Vcc?            01/01/70 00:00      
      Vcc=3.0 to 3.3 Volts.            01/01/70 00:00      
         Possible causes            01/01/70 00:00      
            Noise could come from comparator itself            01/01/70 00:00      
               Re: Noise from Ground.            01/01/70 00:00      
                  Filter            01/01/70 00:00      
                     Exactly!            01/01/70 00:00      
                  R21 is contaminated            01/01/70 00:00      
                     Hystresis is 1.7 mV            01/01/70 00:00      
                        It's 20mV!            01/01/70 00:00      
                           oops calculation error            01/01/70 00:00      
                              waaaay too small a hysteresis..            01/01/70 00:00      
                                 Not at all !            01/01/70 00:00      
                                    there are (at least) 2 ways to skin this            01/01/70 00:00      
                                       Extreme care??            01/01/70 00:00      
                                          correct, but there has been umpteen post            01/01/70 00:00      
                     Please Suggest some filtering.            01/01/70 00:00      
                        100R plus 47µF            01/01/70 00:00      
                           Re: 100E + 47uF            01/01/70 00:00      
                              Like that...            01/01/70 00:00      
                                 Red LED.            01/01/70 00:00      
                                    Every red LED should work            01/01/70 00:00      
                                       also be aware            01/01/70 00:00      
                                          At 500µA...            01/01/70 00:00      
            Noisy ground?            01/01/70 00:00      
            Re: Possible Causes.            01/01/70 00:00      
               Mains Signalling?            01/01/70 00:00      
                  Mains filtering            01/01/70 00:00      
                     mains filtering            01/01/70 00:00      
                        Very informative!            01/01/70 00:00      
   Problem Frequency.            01/01/70 00:00      
      Filtering will help!            01/01/70 00:00      
         Problem Solved.            01/01/70 00:00      
            Nice to hear!            01/01/70 00:00      

Back to Subject List