Page 1 of 1

Counting interrupts depending on the level

Posted: Fri Jul 08, 2016 8:06 am
by siwo278
Hello

I wrote a short program on the processor PIC 16F84A, on the basis of a program with PIC 16F648A. The program acts as a pulse-width ratio DCF77. The problem is that he loses pulses from the input. While the original program 648A of the LCD does not do that, in the case of 84A'm surprised. The program counts pulses interrupt depending on the logic level prevailing at the input and depending on the duration of a particular level of light corresponding LED. In practice, I have combined these two systems one of the 84A and LEDs, and another at 648A and LCD display. For both systems is given the same input signal systems are clocked quartz 3,2768MHz and interrupts set to 100Hz. I give as an input rectangular waves with the following parameters 70ms L level and the 930 level H. Programme 648A correctly indicates the width of the pulse and not lose (7L and 93H), and the program 84A periodically loses the input pulses. I mean, he knows that there is a change but do not measure their width - not count interrupts at this time. Is moglibymi colleagues to help sort out this problem?

Zliczanie przerwań w zależności od poziomu

Witam

Napisałam krótki program na procesor PIC 16F84A, na podstawie programu z PiC 16F648A. Program spełnia rolę wskaźnika szerokości impulsów sygnału DCF77. Problem polega na tym że gubi on impulsy z wejśćia. O ile pierwowzór programu na 648A z wyświetlaczem LCD tego nie robi, to w przypadku 84A jestem zaskoczona. Program zlicza impulsy przerwania w zależności od poziomu logicznego panującego na wejśćiu i w zależności od czasu trwania konkretnego poziomu zapala odpowiednia diodę Led. W praktyce mam połączone dwa takie układy jeden z 84A i diodami led, a drugi na 648A i wyświetlaczem LCD. Na obydwa układy podawany jest ten sam sygnał wejściowy, układy taktowane są kwarcem 3,2768MHz i przerwania ustawione na 100Hz. Jako sygnał wejściowy podaję fale prostokątną o następujących parametrach 70ms poziom L i 930 poziom H. Program na 648A poprawnie wskazuje szerokość impulsów i ich nie gubi (7L i 93H), a program na 84A co jakiś czas gubi impulsy wejściowe. To znaczy wie że zaszła zmiana ale nie zmierzy ich szerokości - nie zliczy przerwań w tym czasie. Czy moglibymi koledzy pomóc rozwikłać ten problem?