![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| can anybody tell me whats wrong with my code.. It has an error ("EXPECTING FUNCTION NAME") near rtos_msg_send(the_second_rtos_task,count); please help.. im using ccs c compiler ver. 4 Code: #include<16f877.h>
#use delay(clock=20000000)
#use rs232 (baud=9600,xmit=PIN_C6,rcv=PIN_C7)
#use rtos(timer=0,minor_cycle=100ms)
#task(rate=1000ms,max=100ms,queue=2)
void the_first_rtos_task();
#task(rate=500ms,max=100ms,queue=2)
void the_second_rtos_task();
void the_first_rtos_task()
{
int count=0;
while(true){
count++;
rtos_msg_send(the_second_rtos_task,count);
rtos_yield();
}
}
void the_second_rtos_task()
{
if (rtos_msg_poll())
{
printf("count is : %i\n\r",rtos_msg_read());
}
}
void main()
{
rtos_run();
} | |
| |
| | (permalink) |
| That's what happens when you use a RTOS. You just add 1 more level of complexity. I'm not familiar with the compiler you are using, but could it be something as simple as needing brackets after the function name so it becomes the_second_rtos_task(). Is there not a forum that deals with this RTOS as I don't think anyone here has any experience with it. Mike. | |
| |
| | (permalink) |
| hi pommie.. thanks for the reply.. anyway i tried your suggestion but it still won't work.. would you be kind enough to tell me the website where people discuss this type of stuff? thank you so much.. | |
| |
| | (permalink) |
| RTOS, try the compiler site or Microchips site. Why do you need an RTOS? They really aren't practical on teeny tiny controllers like the 16F877, interrupt driven code is the way to go. Did you ever get your seven segment thing running? | |
| |
| | (permalink) |
| hi.. yeah.. i have already got my seven segment running and have done already many things with my pic. thanks to you and the people here at electro-tech.. actually i really dont need rtos. it is just out of curiosity sake that i try to study it.. | |
| |
| | (permalink) |
| Do I have it correct that you are using the CCS supplied RTOS? IF so place to ask this question is on the CCS support forum. But Pommie was on the right track. If you are asking this question there is a very good chance you should not be uisng any RTOS. It is as he said one more layer of complexity. You need to master the other layers first. If you had you would not be asking a question that you could solve by looking in the manul. I do not mean to discourage you in anything other then using RTOS at this time. For the most part it only makes sense to use an RTOS when doing so will decrease the complexity of your code. Code you application using interrupts or even polling if possible.
__________________ search engine for electronic partsJunebug USB PIC programmer kit., USB Bit Wacker, 3v0's Homepage The 15 Minute Printed Circuit Board! (+drill time) | |
| |
| | (permalink) |
| I've used CCS quite a bit in the past. I've never used the RTOS, but I happened to have the docs open anyways for another project. I think what you need is the #TASK preprocessor directive before each of your two tasks, otherwise the functions arent registered as tasks. I suggest reading the relavent RTOS sections of the latest compiler manual from here: http://ccsinfo.com/downloads.php Also, there are a couple RTOS examples given in the examples directory: EX_RTOS_DEMO_1_TASKS.C RTOS scheduling and rtos_run EX_RTOS_DEMO_2_TERMINATION.C Introduction to rtos_terminate EX_RTOS_DEMO_3_ENABLE_DISABLE.C Introduction to rtos_enable/rtos_disable EX_RTOS_DEMO_4_MESSAGES.C RTOS messaging functions EX_RTOS_DEMO_5_YIELD.C Introduction to rtos_yield EX_RTOS_DEMO_6_SEMAPHORES.C Introduction to rtos_signal/rtos_wait EX_RTOS_DEMO_7_AWAIT.C Introduction to rtos_await EX_RTOS_DEMO_8_STATISTICS.C RTOS statistical features EX_RTOS_DEMO_9_BASIC_KERNAL.C Basic serial command line with RTOS Finally, CCS also provides a moderately active forum. I'm sure there is a plethora of RTOS threads here: http://ccsinfo.com/forum/ Good luck, and have fun! | |
| |
| | (permalink) |
| thanks guys.. i really appreciate all your help.. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Regarding the CCS Compiler | 3v0 | Micro Controllers | 5 | 24th March 2007 10:22 PM |
| Big problem!! | zezito | Electronic Projects Design/Ideas/Reviews | 4 | 29th October 2004 03:05 AM |
| Problem with My A/D readings. Any suggestions? | cubdh23 | Micro Controllers | 4 | 24th September 2004 05:22 AM |
| Mysterious Problem! | matasoft | Micro Controllers | 15 | 11th September 2004 08:50 PM |
| Analog output PLC CQM1H problem | goekgoek | General Electronics Chat | 0 | 24th June 2003 09:08 AM |