Multitasking with MikroC?

General discussion on mikroC.
Post Reply
Author
Message
spookyrufus
Posts: 71
Joined: 10 Jun 2006 13:45

Multitasking with MikroC?

#1 Post by spookyrufus » 01 Nov 2006 18:25

Hi Everybody :o,

I was wondering if is there a way for creating a multitasking environment in MikroC.
A kind of external library which, once loaded, would permit writing things like these:

Create_Task(*Pointer_to_my_function_1)
Create_Task(*Pointer_to_my_function_2)

And these tasks start to run simoultaneously.
What I can't understand is how to restart a function previously interrupted EXACTLY from where it has been interrupted.

I mean:

task_1 (){


do_something
do_something_else
print_something

}

If my 'scheduler' interrupts this function just before it executes 'do_something_else', i want that next time it becomes active, it starts EXACTLY from 'do_something_else' and not from 'do_something'.

I hope anybody can help, because I've read tons of material on this topic, but I cant find the solution for implementig such things in MikroC.

Thanks for reading this long post :D.

Code_Nerd
Posts: 353
Joined: 29 Jul 2006 14:53
Location: Newcastle.. Australia

#2 Post by Code_Nerd » 02 Nov 2006 00:27

RTOS isnt available with MikroC..

The last I heard was that the mE guys are going to incorporate it in v7.0!

Regards
Code

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#3 Post by LGR » 02 Nov 2006 00:32

Code_Nerd wrote:The last I heard was that the mE guys are going to incorporate it in v7.0!
That's the first time I've heard that rumor. For PIC, or dsPIC (/PIC24)? I would think that it would be much easier and more flexible on the 16-bit platform, because of the multiple interrupts (and stack pointer, etc.). I don't think attempting it for 8-bit would be worth the effort.
If you know what you're doing, you're not learning anything.

Code_Nerd
Posts: 353
Joined: 29 Jul 2006 14:53
Location: Newcastle.. Australia

#4 Post by Code_Nerd » 02 Nov 2006 03:51

Yeah I asked the question when I first started using mC and I think Zristic said they are trying to get it into 7.0..

I have used Salvo on the 8 bit PICs and thought it was great :)

spookyrufus
Posts: 71
Joined: 10 Jun 2006 13:45

thanks :-)

#5 Post by spookyrufus » 02 Nov 2006 16:27

Thanks a lot for reply.

Any further help would be appreciated :wink:

Code_Nerd
Posts: 353
Joined: 29 Jul 2006 14:53
Location: Newcastle.. Australia

Re: thanks :-)

#6 Post by Code_Nerd » 03 Nov 2006 00:08

spookyrufus wrote:Thanks a lot for reply.

Any further help would be appreciated :wink:
what further help can we give you?

mC doesnt have multitasking..

egomez
Posts: 10
Joined: 15 Oct 2006 19:31
Location: Slovenia, Europe

#7 Post by egomez » 03 Nov 2006 19:50

Code_Nerd wrote: I have used Salvo on the 8 bit PICs and thought it was great :)
And why have you switched to mC which doesn't support multitasking?

Do you have easier projects now? Or are you doing smaller projects with mC, and other with some other compiler and Salvo?

Code_Nerd
Posts: 353
Joined: 29 Jul 2006 14:53
Location: Newcastle.. Australia

#8 Post by Code_Nerd » 04 Nov 2006 02:20

egomez wrote:
Code_Nerd wrote: I have used Salvo on the 8 bit PICs and thought it was great :)
And why have you switched to mC which doesn't support multitasking?

Do you have easier projects now? Or are you doing smaller projects with mC, and other with some other compiler and Salvo?
I realised that many of the tasks that may require multitasking can still be achieved the "normal" way with some clever coding / use of delays etc.. I also found mC to be much easier to use in regards to LCD, USART etc than the C18 libraries. So I sacrificed the RTOS for ease of use.. ;)

Regards
Code

ugurvar
Posts: 6
Joined: 23 Sep 2011 07:45

Re: Multitasking with MikroC?

#9 Post by ugurvar » 22 Dec 2011 19:51

Hi everyone!
i want to an application multitasking.

for example:

i want to a basic pattern generator.
but i have a timing algoritm,because,
when i use a delay() function, all the pins are effected of this...
plc help me!!!

Post Reply

Return to “mikroC General”