can i use a variable flag as trigger like high priority Interrupt

Status
Not open for further replies.

thannara123

Advanced Member level 5
Joined
Jan 7, 2010
Messages
1,601
Helped
122
Reputation
244
Reaction score
116
Trophy points
1,353
Activity points
10,611
Its hard to understand what i am asking please am sorry ,

Can I use a variable like interrupt trigger with high priority ?
.
Or Interrupt funtion is only applicatple for peripherals and external interrupt ?
 

Hi,

An interrupt usually is hardware based
A variable usually is software based.
So: NO, I don´t think it´s possible.
I even don´t think it´s useful. Because if you want to software trigger for an ISR to be xecuted, then why not simply call a function instead.?

Klaus
 

    thannara123

    Points: 2
    Helpful Answer Positive Rating
Typically you can use a GPIO pin as a flag, and use its interrupt capability
to do an interrupt when you write to the GPIO. Thats more of a standard
HW approach.

Or use Verilog solution to manage monitoring of a bit in a variable and
trigger an interrupt. ARM and appropriate IDE can handle that, like a
PSOC. The compiler/linker has to know the address of the variable, thats
easily handled.

In PSOC could use a control reg (it can be 8 bit) as a variable and do this :



The compare is multi compare selectable>,<, <=......

Could even add HW between Control reg and ISR to logically qualify it.



Could replace digital comp with a LUT and implemented it as a state machine or
a simple PLA to qualify ISR from the variable.


Regards, Dana.
 

Attachments

  • 1696080614851.png
    1.7 KB · Views: 92
Last edited:
Can I use a variable like interrupt trigger with high priority ?
Since by definition both ISR and Main() are functions asynchronous to each other, it is necessary that the value of the variables manipulated by the interrupt service have a specific entry point into the main program.

In other words, the ISR update specific temporary global variable(s), and the Main() read them at a specific interval/function.
 

To trigger an exception procedure, ARM processor, e.g. STM32 has a special SWI (software interrupt) instruction. I don't see a purpose of using a flag instead.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…