Hey guys, I've been tasked in class to use a pic16f877a and create a circuit where there is a certain pattern of LEDs, basically the LED travels down a row, so its like one on, and one off
And when i press the push button, the pattern changes to something slower, so the LED moves slower.
eg 1st pattern, LED 1 second on, 1 second off
2nd pattern, LED 2 seconds on, 2 seconds off
3rd pattern, LED 8 seconds on, 8 seconds off
and the back to the first pattern with every push of the push button
(attached a picture of the circuit )
I've figure out that i need to use two interrupts, timer0 and External interrupt RB0.Timer0 for the clocking and RB for the button. What i dont understand is when i have two interrupt functions MP Lab gives me an error that i cannot use both, and can only have one. (using C programming)
i get that i should have one ISR, but i dont get how do i keep both functioning in just 1 ISR?? I'm new to this so please bear with me.
And when i press the push button, the pattern changes to something slower, so the LED moves slower.
eg 1st pattern, LED 1 second on, 1 second off
2nd pattern, LED 2 seconds on, 2 seconds off
3rd pattern, LED 8 seconds on, 8 seconds off
and the back to the first pattern with every push of the push button
(attached a picture of the circuit )
I've figure out that i need to use two interrupts, timer0 and External interrupt RB0.Timer0 for the clocking and RB for the button. What i dont understand is when i have two interrupt functions MP Lab gives me an error that i cannot use both, and can only have one. (using C programming)
i get that i should have one ISR, but i dont get how do i keep both functioning in just 1 ISR?? I'm new to this so please bear with me.
Attachments
-
60.4 KB Views: 35