View previous topic :: View next topic |
Author |
Message |
kasny.ondrej
Joined: 03 Feb 2024 Posts: 11
|
Posted: Fri Mar 15, 2024 10:23 am Post subject: ISR stacking |
|
|
Hello again,
Maybe silly question. I have multiple ISRs set. INT0, INT1, PCINT2, URXC. I am talking about simulation now. When some events trigger INT0 or INT1 program jumps to desired location do some code stuff. But another event happends (PCINT2) and raise a flag in PCIFR. I know when any ISR occurs, global interrupts are set to DISABLED until actual ISR is "done", I found in this forum one post that said that after actual ISR is done, program will execute another one waiting in front and so on, but in simulator it does not execute anything else after first ISR. It jumps back to program line where first ISR occured and continue in code as it suppose to do until I simulate desired interrupt by pressing a button second time now. Do I have to take care about it somehow different or is it simulator related problem?
(BASCOM-AVR version : 2.0.8.6 ) |
|
Back to top |
|
|
kasny.ondrej
Joined: 03 Feb 2024 Posts: 11
|
Posted: Fri Mar 15, 2024 10:49 am Post subject: |
|
|
What I found working but not so elegant becouse it has some delay until whole loop is done is to check the flag in main program loop. So if PCINT2 flag is set, reset it and gosub to desired label. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Sat Mar 16, 2024 10:16 am Post subject: Re: ISR stacking |
|
|
kasny.ondrej wrote: | I am talking about simulation now. When some events trigger INT0 or INT1 program jumps to desired location do some code stuff. |
The Bascom simulation is not the exact equivalent of the µC's hardware.
In the simulator you execute ISRs via clicking the corresponding button.
As you have to trigger interrupts manually, it is obvious that anything else, including so-called 'pending interrupts', does not work.
For a more hardware-like simulation, use AVR-, now Microchip-Studio and import the Bascom obj-file. Disadvantage is, import goes not that far to allow Bascom's variables in a 'watch'-window, the only way is then to open a memory window within Studio and interpret the byte-based results oneself.
Also 'Proteus' comes into mind, Proteus is a well known name for hardware simulation. For the hobby user it is rather the expensive kind.
Microchip Studio comes for free, using both, Bascom simulator and Studio, matches most of demands. |
|
Back to top |
|
|
laborratte
Joined: 27 Jul 2005 Posts: 299 Location: Berlin
|
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Sun Mar 17, 2024 8:03 pm Post subject: Re: ISR stacking |
|
|
Nice work, thank you. |
|
Back to top |
|
|
kasny.ondrej
Joined: 03 Feb 2024 Posts: 11
|
Posted: Mon Mar 18, 2024 6:20 am Post subject: |
|
|
Thank you all. |
|
Back to top |
|
|
|