View previous topic :: View next topic |
Author |
Message |
srikrishna
Joined: 06 Sep 2017 Posts: 82
|
Need interrupt diagram for PIC16F684 |
Posted: Sun Feb 16, 2020 1:44 am |
|
|
Hello guys i need INTERRUPT LOGIC diagram for PIC16F684. I can not find it in the datasheet. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Sun Feb 16, 2020 3:20 am |
|
|
Each enable bit is fed into an AND gate with it's interrupt flag as the
other input. The output of each of these gates is fed into a multi input
OR gate. The output of this is then fed into an AND with the GIE to give the
PIC logic interrupt bit (actually there are a couple of inversions NOR and
NAND, but this is the 'logic' effect).
At the start of Q1 of each instruction, it tests the logic interrupt bit. If this
is set it does not start the instruction fetch.
Instead it clears the GIE, and triggers a new Q1 instruction fetch
cycle for a call instruction to the address contained in the peripheral
interrupt vector.
So the instruction pipeline gets a single cycle bubble when an
interrupt triggers.
When you perform the RETFIE at the end of the interrupt, it returns to
the instruction where the interrupt triggered, _and then sets GIE
back on_. This means that if another interrupt has triggered it'll
occur in phase 1 of the following instruction.
Because GIE is 'relied' on in the PIC to prevent interrupts triggering
inside one another, this is why you should never set GIE inside an
interrupt handler. Instead using the RETFIE instruction to do this.
This site has the logic diagram for the 16F877. Your chip has fewer
interrupts, but the basic logic is the same.
<http://www.microcontrollerboard.com/pic_interrupt.html> |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Feb 16, 2020 4:56 am |
|
|
srikrishna wrote: |
Hello guys i need INTERRUPT LOGIC diagram for PIC16F684.
I can not find it in the datasheet.
|
I don't see why you can't find it. Type into Google:
Then go to the webpage for the PIC:
https://www.microchip.com/pic16f684
Then go to the datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/41202F-print.pdf
Then go to this section:
Quote: | 12.0 SPECIAL FEATURES OF THE CPU |
In datasheets that don't have an Interrupts section, the interrupts will
be in the "Special features of the CPU" section. You just have to know this.
Then go to this section:
Quote: | FIGURE 12-7: INTERRUPT LOGIC |
and it's right there. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sun Feb 16, 2020 6:19 am |
|
|
re:
Quote: | You just have to know this... |
In the good old days, you got a huge book of PICS, then you'd flip through all 200+ pages for your PIC, scanning to see the features and see what's new. Sadly, today, you just download the individual PIC's PDF, maybe look at a couple pages seeing how the 'datasheet' has grown to 400-500 pages !
In some aspects, I prefer the good old days, like the 15 minute 'forced' coffee breaks, while the UV eraser was 'cleaning up' your less than perfect code.... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Sun Feb 16, 2020 8:35 am |
|
|
That's hilarious....
He must like me, have the older 2004 data sheet. Guess what isn't there
in this one!....
Classic. |
|
|
|