IRQ and procedure

How to start procedure from IRQ

Jest
 
Avatar
 
Subject:

IRQ and procedure

 · 
Posted: 21.09.2010 - 12:46  ·  #1
Hello,

I have situation with xMega, when there is interrupt on one of input pins and then I should start procedure - almost immediately. If the procedure is called in interrupt routine, it is not OK – system hangs from time to time. Setting flag and then checking this flag in main loop is not OK – I never knows when the procedure will be started. Now, I am lost. :(

Is there any other method to do this? And I don’t want to import multitasking.
What if I still run procedure from interrupt routine, what should be the stack? Frame? Any other settings?

Tnx for help,
Andrej
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: IRQ and procedure

 · 
Posted: 21.09.2010 - 13:46  ·  #2
Hello Andrej,

it seems that you accidently destroy some registers in your interrupt service. To avoid this use complete register saving for interrupts or manually save the used registers by PUSHs and POPs.

rolf
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   50   64 · Page-Gen-Time: 0.021268s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI