Hi E,hi C,
Do you have a Code example to post.?
E
Edit:
Are you enabling High or Low Interrupts?
You should look at the manual in the Basic compiler window.Hi E,
I normally use ON HIGH INTERRUPT, and there's no problem, but was advised to keep it simple and use ON INTERRUPT.
We must be looking at an old help version?
C
Hi E and J,hi C,
Do you understand the purpose of High and Low interrupts.?
E
link.
https://openlabpro.com/guide/interrupt-handling-in-pic18f4550/
I kind of understand how Interrupts work, but as the CODE is HW, I wonder if we're mixing HW with SW?
Hi J, D and E,C,
In many of your posts you differentiate between HW and SW methods. I’d like to understand what YOU think is the difference? It would help in responding to your questions.
I guess I have a different perspective. Software (SW) is always necessary to communicate to hardware (HW). One needs to use appropriate software in order to perform this communication successfully.Hi J, D and E,
It's taken me a long time to understand mostly what SW and HW is.
What's confusing is mixing. (correct anything I write)
e,g, We write SW to talk to HW, I use Oshonsoft which is SW, and write to HW.
A PIC has HW modules e,g timer module built inside it. This would be set using the D/S to set the Enable BITs, flags etc.
In Oshonsoft is ON HIGH INTERRUPT, but in the D/S there is 'attached':
C.
Hi D,I guess I have a different perspective. Software (SW) is always necessary to communicate to hardware (HW). One needs to use appropriate software in order to perform this communication successfully.
So I do not see the difference other than understanding what the hardware requires from the software. In fact, I believe that your perception of a difference leads to your difficulties in controlling devices.
Imagine two automobiles. One has a manual transmission; one has an automatic transmission. Both shift gears while driving, but you use different skills. You are the software. The transmission is the hardware. You need to understand the different skills required to drive the automobile.
Just like you need to understand the different coding techniques to drive your devices. However in the microprocessor and coding language scenario, you might have the option to use multiple approaches. And you get the option of choosing the easiest technique based on your understanding.
But! Hardware and software approaches are not mutually exclusive in some cases.
hi C,It's taken me a long time to understand mostly what SW and HW is.
What's confusing is mixing. (correct anything I write)
e,g, We write SW to talk to HW, I use Oshonsoft which is SW, and write to HW.
A PIC has HW modules e,g timer module built inside it. This would be set using the D/S to set the Enable BITs, flags etc.
Hi E,hi C,
When you write in your program Code for example Enable High and Enable Low the Basic Compiler writes a block of Machine Code which sets bits in the GIEH or GIEL in the INTCON, register.
You can double-check the *.lst file the Compiler creates, in Assembly
Added a clip from the *.lst file
0453 000144 ; 175: Enable High 'ADDED from INCLUDE &
0454 000144 8EF2 BSF INTCON,GIEH
0455 000146 ; 176: Enable Low 'ADDED from INCLUDE &
0456 000146 8CF2 BSF INTCON,GIEL
0457 000148 ; 177:
-------------------------
So when writing your program Code you can use either Enable High or Enable Low
or
Set the Bits directly in the INTC0N GIEH or INTCON GIEL
E
Using interrupts -------------------------------------
Enable High
Enable Low
Disable High
Disable Low
On High Interrupt
On Low Interrupt,
Resume,
Save System,
Interrupt routines (high and low priority) should be placed as all other subroutines after the END statement.
They should begin with ON LOW INTERRUPT or ON HIGH INTERRUPT statement
and end with RESUME statement. If arithmetic operations,
arrays or any other complex statements are used in interrupt routine,
then SAVE SYSTEM statement should be placed right after ON LOW/HIGH INTERRUPT statement
to save the content of registers used by system.
ENABLE LOW,
ENABLE HIGH,
DISABLE LOW and DISABLE HIGH statements
can be used in main program to control GIEH and GIEL bits in INTCON register.
RESUME statement will set the appropriate GIEH or GIEL bit and enable new interrupts.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
![]() |
Not able to read Interrupt Status Register and reset Interrupts on MAX30102 | Microcontrollers | 0 | |
![]() |
Interrupts and SPI peripherals | Microcontrollers | 54 | |
1 | Something interrupts my electronics | Wireless & RF Design | 10 | |
![]() |
Oshonsoft programs with INTERRUPTS and PARSE | Microcontrollers | 342 | |
![]() |
Two INTERRUPTS in Oshonsoft | Microcontrollers | 18 |
by Jake Hertz
by Jake Hertz
by Robert Keim
by Jake Hertz