CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RTOS not working

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Rocky



Joined: 26 Apr 2009
Posts: 22
Location: USA

View user's profile Send private message

RTOS not working
PostPosted: Thu Jul 23, 2009 5:28 pm     Reply with quote

I am using the PIC24HJ12GP202 and cannot make the rtos run.
the tasks are not doing anything.
If I uncomment the output_toggle and/or the printf statements in main, the pin is toggling and the terminal shows the serial output on the screen.
However, I would expect to see the printf and toggle statement executed once but it repeats forever like it would in a while(1) loop.

During simulation (on the chip) I see that the program goes to the rtos_run() then task1 and back to main and so on.

I did add setup_timer1 and enable_interrupts but it didn't make a difference.
If I don't use the rtos and set the toggle in the timer interrupt it will toggle the pin.
I went back from my application to the minimal example from CCS (see below) but it doesn't work either.

Here the example program modified for the PIC24. The fuses are set in main.h.
Code:

#include "C:\xxxxx\software\test3\main.h"
#use fast_io(b)
#use delay(clock=32M,internal=8M)

#use rs232(UART1,baud=9600,parity=N,bits=8, xmit = PIN_B3)

#use rtos(timer=1,minor_cycle=10ms)

#task(rate=100ms,max=5ms)

void The_first_rtos_task ( )
{
   output_low(Dig_out1);
   printf ("1\n\r") ;
   rtos_terminate () ;
}

#task(rate=100ms,max=5ms)

   VOID The_second_rtos_task ( )
   {
      output_high(Dig_out1);
      printf ("\t2 ! \n\r") ;
   }

   #task(rate=100ms,max=5ms)

      VOID The_third_rtos_task ( )
      {
         printf ("\t\t3\n\r") ;
      }

   // main is still the entry point FOR the program
   VOID main ( )
   {
      setup_timer1 (TMR_INTERNAL);
      set_tris_b (0x5ff4) ;
      set_tris_a (0x0f) ;
      enable_interrupts (INT_TIMER1) ;

      // output_toggle (Dig_out1);
      //   printf("\t\t3\n\r");
      delay_us(10);
      rtos_run ();
   }

I tried the examples from the Doggan Ibrahim book with the same results.

Any help would be appreciated.

Thanks.

Rock.
_________________
PERSEVERANCE IS THE KEY TO SUCCESS
Guest








PostPosted: Fri Jul 24, 2009 11:18 am     Reply with quote

The first problem I notice is the
Code:
rtos_terminate () ;

Inside your first task... this function will terminate the rtos, as the name says.

I don't remember if there are any need to set the timer 1, because I think that the compiler already do this when you defined the rtos parameters:
Code:
#use rtos(timer=1,minor_cycle=10ms)
Rocky



Joined: 26 Apr 2009
Posts: 22
Location: USA

View user's profile Send private message

rtos not working
PostPosted: Fri Jul 24, 2009 11:38 am     Reply with quote

Sorry, I forgot to remove that line. I was trying different things in my desperation and forgot to remove the line before posting.
I did ask CCS tech support and hope to get an answer today. If I do I'll post it.
_________________
PERSEVERANCE IS THE KEY TO SUCCESS
Rocky



Joined: 26 Apr 2009
Posts: 22
Location: USA

View user's profile Send private message

rtos not working
PostPosted: Fri Jul 24, 2009 3:05 pm     Reply with quote

I received a confirmation from CCS support that the processor is resetting. They are going to look into it but didn't say how long it will take.
I am going to try with an 18F8490 to see if I have the same problem.

Anonymous wrote:
The first problem I notice is the
Code:
rtos_terminate () ;

Inside your first task... this function will terminate the rtos, as the name says.

I don't remember if there are any need to set the timer 1, because I think that the compiler already do this when you defined the rtos parameters:
Code:
#use rtos(timer=1,minor_cycle=10ms)

_________________
PERSEVERANCE IS THE KEY TO SUCCESS
Rocky



Joined: 26 Apr 2009
Posts: 22
Location: USA

View user's profile Send private message

RTOS NOT WORKING
PostPosted: Fri Jul 24, 2009 4:05 pm     Reply with quote

I did try the same program on a 18F8490 board and it works.

What could make a PIC24 reset while it doesn't with the 18F?
Is there a bug in the watch dog timer that prevent it to be disabled?
An error interrupt?
Any suggestions?

Thanks
_________________
PERSEVERANCE IS THE KEY TO SUCCESS
Rocky



Joined: 26 Apr 2009
Posts: 22
Location: USA

View user's profile Send private message

Re: RTOS NOT WORKING
PostPosted: Fri Jul 24, 2009 6:56 pm     Reply with quote

here is the answer from CCS:


This message is a reply to CCS e-mail id: 9G5689

Hey,

RTOS is not supported for PCD. Is there somewhere on our website that documents that it is? Thanks.

CCS Tech Support

Neither does it say it doesn't, at least I didn't find it. Too bad the code is not available.
Thanks to everybody that answered.

Rocky wrote:
I did try the same program on a 18F8490 board and it works.

What could make a PIC24 reset while it doesn't with the 18F?
Is there a bug in the watch dog timer that prevent it to be disabled?
An error interrupt?
Any suggestions?

Thanks

_________________
PERSEVERANCE IS THE KEY TO SUCCESS
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jul 24, 2009 7:05 pm     Reply with quote

Actually they do say it is supported in PCWHD and PCDIDE.
Look at this table:
http://www.ccsinfo.com/content.php?page=ideoverview

It's also documented in the PCD manual.
http://www.ccsinfo.com/downloads/PCDReferenceManual.pdf

You could inform them about this.
Rocky



Joined: 26 Apr 2009
Posts: 22
Location: USA

View user's profile Send private message

RTOS not working
PostPosted: Sat Jul 25, 2009 10:09 am     Reply with quote

Thank you PCM I will.
It is a pity because it is working really well on the 18F. At least for this project.
Again, I'll post any news I get on this subject.

PCM programmer wrote:
Actually they do say it is supported in PCWHD and PCDIDE.
Look at this table:
http://www.ccsinfo.com/content.php?page=ideoverview

It's also documented in the PCD manual.
http://www.ccsinfo.com/downloads/PCDReferenceManual.pdf

You could inform them about this.

_________________
PERSEVERANCE IS THE KEY TO SUCCESS
Rocky



Joined: 26 Apr 2009
Posts: 22
Location: USA

View user's profile Send private message

rtos not working
PostPosted: Sat Jul 25, 2009 10:16 am     Reply with quote

PCM in fact I should have think about that too as I have been consulting the manual. Embarassed

I did notify CCS and I am curious to see their answer.

PCM programmer wrote:
Actually they do say it is supported in PCWHD and PCDIDE.
Look at this table:
http://www.ccsinfo.com/content.php?page=ideoverview

It's also documented in the PCD manual.
http://www.ccsinfo.com/downloads/PCDReferenceManual.pdf

You could inform them about this.

_________________
PERSEVERANCE IS THE KEY TO SUCCESS
Rocky



Joined: 26 Apr 2009
Posts: 22
Location: USA

View user's profile Send private message

Re: rtos not working
PostPosted: Sat Aug 15, 2009 6:31 pm     Reply with quote

After several emails, the last one copying the CEO of the company I received this answer on 8/3/09:


It seems there is a bug in the 24 bit RTOS even though it is our intention for it to work. I will make sure someone debugs the problem and we will let you know when it is fixed.




Rocky wrote:
PCM in fact I should have think about that too as I have been consulting the manual. Embarassed

I did notify CCS and I am curious to see their answer.

PCM programmer wrote:
Actually they do say it is supported in PCWHD and PCDIDE.
Look at this table:
http://www.ccsinfo.com/content.php?page=ideoverview

It's also documented in the PCD manual.
http://www.ccsinfo.com/downloads/PCDReferenceManual.pdf

You could inform them about this.

_________________
PERSEVERANCE IS THE KEY TO SUCCESS
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group