Home arrow Support arrow Forums

Luminary Micro Forums

ppz2005

Junior Boarder

2008/08/07 21:54

Re:add user interrupts on future device

I mean I can construct a real time system to use a interrupt as a 'task'.For example:

int0:GPIO int handle,just a normal int handle
int1:other int handle
...
userint0:'task0',just like a task in an OS
userint1:'task1'
...
main routine:'empty task',typically making MCU sleepping

Here,a 'task' is the same as a task in an system with an OS,but it would return when it complete.The interrupts for peripheral have the highest priority,and userint0 is higher than userint1,...,main routine has the lowest priority.
An interrupt routine can send a software interrupt pending to any other interrupt handler or 'task',and then interrupt controler would schedule 'tasks' according to their interrupt priority with no time. And context switch is in fact a real interrupt switch,so it is very fast.
Now,I get a complete system with task schedule,context switch,and no task stack has to be used.Code is compact.
Maybe,it is a very little system,and it cannot complete large application,but little application is more.
In a typical application with OS,context switch time is more than 5 us(assume main clock is 50MHz),but it is only less than 1 us in such a interrupt drive system.For many litte application,speed is important.Speed means more ability,less power dissipation,etc..
Just as rocksoft discribed,we can use an interrupt of an unused peripheral as an user interrupt,but we have to turn this peripheral on,and it would infect other signal somehow,and such interrupts are too less.All reserve interrupt is not available too.
Thank you for concerning this subject.
And maybe I cannot express myself very accurately,or more,correctly,for English is not my native language.
regards,

login or register to reply

      Topics Author Date
    thread link
add user interrupts on future device
ppz2005 2008/07/31 02:57
    thread link
thread linkthread link Re:add user interrupts on future device
rocksoft 2008/07/31 08:46
    thread link
thread linkthread linkthread link Re:add user interrupts on future device
ppz2005 2008/08/06 22:22
    thread link
thread linkthread linkthread linkthread link Re:add user interrupts on future device
rocksoft 2008/08/07 02:03
    thread link
thread linkthread linkthread linkthread linkthread link Re:add user interrupts on future device
cb1 2008/08/07 17:36
    thread link
thread linkthread linkthread linkthread linkthread linkthread link Re:add user interrupts on future device
ppz2005 2008/08/07 21:54
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread link Re:add user interrupts on future device
rocksoft 2008/08/08 02:22
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:add user interrupts on future device
dereksoftstuff 2008/08/08 03:13
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:add user interrupts on future device
rocksoft 2008/08/08 04:21
    thread link
thread linkthread link Re:add user interrupts on future device
awneil 2008/08/06 16:04
    thread link
thread linkthread linkthread link Re:add user interrupts on future device
ppz2005 2008/08/06 21:26
    thread link
thread linkthread linkthread linkthread link Re:add user interrupts on future device
ppz2005 2008/08/06 22:06
    thread link
thread linkthread linkthread linkthread link Re:add user interrupts on future device
ppz2005 2008/08/06 22:26
    thread link
thread linkthread link Re:add user interrupts on future device
dereksoftstuff 2008/08/09 03:24