A company asked you to design a counter to count the apples that pass over a running belt and cross an infrared line. A pulse is
generated each time an apple cross the infrared line, which is fed into a PIC18F458. The company wants to pack 12 apples in one package, so a high signal will be activated for at least 20 ms. Follow
the next to complete your code:
1- Use the interrupt techneque to write an interrupt service routine to handle the external event by using counter1; when an apple crosses the infrared line.
2- write your 20ms delay function ( fosc = 4 MHz ).
يرجى استعمال المايكروكنترول لغة الاسمبلى pic18