Mexpost
Newbie level 4
RB0/INT pin Interrupt Handling Using PIC16F877A
Hello world; I just joined this forum in hope of learning something important ... just starting and learning the hard way (no emulation software yet) .
Q: If I program an interrupt service routine to respond to an external generated high input on the RB0/INT pin, can I use this pin *as an input* if PORTB already has an LCD displaying the time continually refreshed by the 877A? I am using higher numbered RB outputs and PORTB is configured in the main program as the LCD 1602 output, but RBO/INT can be made an unused pin since only six of the eight (RB0, ..., RB7) are necessary and the Lcd can go on 2-7, for example. I've got a lot to go to get a better feel for this, but if the main program generally uses PORTB as an output (LCD refreshes fast in a while(1) loop).
Can my routine use the unused RB0/INT pin on the 16f877A to detect an input signal and would I make PORTB an input inside the "ISR"? Or is this all wrong. I don't want to try it since writing code is difficult for me at this stage to chase something wrong, and then I don't want to risk applying 5V to RBO//INT for fear of a problem with the MCU or LCD. It's ok in my project if the LCD display skips a little when the interrupt happens, as long as it goes back to continue to update time in the display after the interrupt 'returns'. OK, please, anyone (like Tahmid if he is here because I saw some advice he gave on 877A interrupts) who can give me some appreciated help?
Thanks
Mex
Hello world; I just joined this forum in hope of learning something important ... just starting and learning the hard way (no emulation software yet) .
Q: If I program an interrupt service routine to respond to an external generated high input on the RB0/INT pin, can I use this pin *as an input* if PORTB already has an LCD displaying the time continually refreshed by the 877A? I am using higher numbered RB outputs and PORTB is configured in the main program as the LCD 1602 output, but RBO/INT can be made an unused pin since only six of the eight (RB0, ..., RB7) are necessary and the Lcd can go on 2-7, for example. I've got a lot to go to get a better feel for this, but if the main program generally uses PORTB as an output (LCD refreshes fast in a while(1) loop).
Can my routine use the unused RB0/INT pin on the 16f877A to detect an input signal and would I make PORTB an input inside the "ISR"? Or is this all wrong. I don't want to try it since writing code is difficult for me at this stage to chase something wrong, and then I don't want to risk applying 5V to RBO//INT for fear of a problem with the MCU or LCD. It's ok in my project if the LCD display skips a little when the interrupt happens, as long as it goes back to continue to update time in the display after the interrupt 'returns'. OK, please, anyone (like Tahmid if he is here because I saw some advice he gave on 877A interrupts) who can give me some appreciated help?
Thanks
Mex
Last edited: