Interrupts 🔴 PIC Microcontroller Programming Tutorial #5 MPLAB in C

preview_player
Показать описание
In this PIC programming tutorial I will demonstrates how to setup the high and low priority interrupt with external inputs via buttons. Using the XC8 compiler with MPLAB X and a PIC18F4520 PIC microcontroller.

Git Repository

➥➥➥ SUBSCRIBE FOR MORE VIDEOS ➥➥➥

☕Coffee Funds☕
Shekels
Patreon
Bitcoin
19nohZzWXxVuZ9tZvw8Pvhajt5khG5mspW
Ethereum
0x5fe29789CDaE8c73C9791bEe36c7ad5db8511D39

00:00 Intro
00:06 PIC Microcontroller Schematic
00:26 Code Setup
01:30 Interrupt Vectors
01:49 Interrupt Logic
02:17 INTCON Register 1
02:26 INTCON Code
02:42 RCON Register
02:58 RCON code
03:09 Exturnal Interrupt 0
04:07 Interrupt Service Routine Code
05:03 Exturnal Interrupt 0 Demo
05:22 Low Priority Interrupt Code
06:06 INT1 Setup
07:45 Low Priority Interrupt Demo
08:00 Code Recap
09:51 Outro

#picprogramming #picmicrocontroller #MPLAB
Рекомендации по теме
Комментарии
Автор


Under compiler XC8 v2.00 and up the ISR functions change to:

- #include <pic18f4520>
- void __interrupt() high_isr(void);
- void __interrupt(low_priority) low_isr(void);

Credit to user Peng of for informing me of this.

BinderTronics
Автор

Hey man I really appreciate you making this series. I will be referencing it many times over the next few months during my UMN EE microcontrollers class!

L.Lagrange
Автор

nice Explanation sir. please make more video on interrupt examples.

muhammadfaizan
Автор

Hi
Excelent explination on interrupts

stanholmes
Автор

Hello. Thanks for video. Can you tell me the benefit of using interrupts instead of doing the same just with normal digital inputs? Thanks

elless
Автор

I have been enjoying this playlist so far, but I have two questions.

1. Around 6:51, you use INT1E and INT1P instead of INT1IE and INT1IP like the datasheet says. Is that like a shorthand that means the same thing?

2. What is the purpose of using low priority vs high priority in this example? In both cases they did the same task. I believe this only matters when both buttons are pressed since the high priority would be the only LED on, but is this the case or no? I apologize if you mentioned this already, but after swiping through the video a few times, I could not find this addressed.

lukev
Автор

Great videos and love your accent mate. Are you South African?

willashland
Автор

Outstanding tutorial. It would be nice to have a parallel one on mpasm though. Bravo!

DanielCharry
Автор

Can you explain, why does "GIEL" and "GIEH" need to be set HIGH in the main code? Great video by the way! :)

lukagacnik
Автор

we didn't write the function of rb0 and rb1 in the main function how did the microcontroller identify while giving input from the switch?

gunalann
Автор

If we want to have the INT2 interrupt, will we need to add another isr or will need another if statement in the high_isr(){...} ?

mrafayshams
Автор

I get an error: variable has incomplete type 'void' when I try to name the isr function as
void interrupt highISR(void).

How to find what is a way to name the ISR function?

mrafayshams
Автор

Can pic18's family do everything, including motor control, because I have seen pic 32 of a university, its applications are so great that I'm bewildered. , I watch the project about pic 32 via Bruce Land's Youtube channel

toysandgames
Автор

Hi, Do some example program ON LED blinking continuously after one press on the button and OFF LED blinking after one press on the button.

littlekarthick
Автор

Hi, Great job!
Is it possible to put in e.g.--- __delay_ms(200);---- to somewhere to avoid debouncing?
Thanks!

Tom-k-tech
Автор

Hi,
Sir I just need ur help I hope u will be biggest help sir I'm currently doing a project in which I'm interfacing pic16F877a microcontroller with Max7219 dot matrix module. Can u guide me sir regarding this
Regards

StoriesoftheSoul
Автор

@binder tronics
sir i am using PIC18F47Q10 for my project i am currently facing an issue that my main function is repeating itself infinitely i am using internal oscillator at 8MHZ and beside this i am not able to use interrupts i have set all the bits required for generating interrupt but i am not able to use interrupt flag for Rx and Tx in EUSART please guide me

vaibhavkapadia
Автор

Hi, i added delays as debouncing. But I'm getting an error of "interruptsmain.c:12:6: error: variable has incomplete type 'void'
void interrupt high_priority high_isr(void)"

sailfromsurigao
Автор

But how does the PIC know where there is going to be a rising/falling Edge?

LeonardCotrimFreundl
Автор

Hi, I tried simulating the circuit in proteus and loaded the hex file of the code but LED's are not turning on. Please help

sailfromsurigao
welcome to shbcf.ru