Hello,
can anyone tell me if can I use threads and timers (like in C/C++) on LPC2361 and where can I found some demo/examples/manuals about that?
Thanks
Of course you can - if it's just software then you can "just" write it!
Any decent RTOS would provide these features - and there are plenty of RTOS available for LPC processors.
A "software" timer requires some sort of hardware "timebase" input - usually a hardware timer.
Example: www.8052.com/.../144417
Dear Andrew
the example you sent me have one big problem: when you run a function from one timer the other timers dont work. And some functions can take a long time. If an other function need to be run at very precise moment you have a problem. Basically you have only one loop actually and all is syncronized. Tell my if I am wrong.
Dorin
"when you run a function from one timer the other timers dont work"
So don't do that, then!
That was just a very simplistic example to give you the idea.
"And some functions can take a long time"
So, indeed, you would not call them direct from the timer code!
You could, just as one example, set a flag to indicate that the timer has expired - and test that flag in your main loop...
// The countdown is running if( --timer_1 == 0 ) { // The countdown has reached zero; ie, the timer has expired // Set flags and/or call functions as appropriate }
"as appropriate" is the key phrase there!
www.8052.com/.../144417
you right. The only way is to make sure that the required time is at most or less than the available time. So you must provide in time escape from any running sequence. But will be harder to program :(. That's why they invented multithreading, that you don't worry about that. No offence, I hope
Forgive me I forgot to say thanks for help. Thanks man. I appreciate your help.
Can i know how to do multithreading in it?