Home arrow Support arrow Forums

Luminary Micro Forums

rocksoft

Expert Boarder

2008/08/08 02:22

Re:add user interrupts on future device

Hi,

Thanks for the description, I understand now. I actually do a very similar thing.

I have a circular "queue" of functions in software and a main loop to either sleep if the queue is empty or call the functions on the queue if they exists. The functions just execute and return.

Both real interrupts and user code can add themselves or other functions to the queue and there is no interrupt or context switch overhead just the addition and removal from the queue. You can also setup timers to add things to the queue for periodic events.

This maybe isn't as fast as the system you describe, it is fairly fast though as the main loop and queue addition are assembly language coded. It isn't "real time" but it's generally real time enough if you are careful to return to the main loop quickly.

What I do is if the processing is going to take a long time the function can implement a state machine where it does a little work and then re-schedules itself for more work later. I run a TCP/IP stack, a USB stack and various other tasks "concurrently" on my LM3S6965 board using this method.

The main problem is that it is quiet hard to program for complex tasks but if your system is simple it might be a suitable solution.

Perhaps other members have better ideas?

Regards,

Liam.

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