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 troubles

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



Joined: 28 May 2006
Posts: 56

View user's profile Send private message

RTOS troubles
PostPosted: Fri Feb 23, 2007 9:30 pm     Reply with quote

The following code does not seem to wait long enough between execution of BlinkLED...thoughts?

Compiler version 3.22.

Code:
#include <16F877a.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)             //clock speed
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,ERRORS)
#use rtos(timer=0)

// ***** Global VAR
int BlinkState = 1;
#define DIAG_LED PIN_A1

// Rest of program....
#task(rate=900ms)
void BlinkLED(){
   printf("Entered Task1");
   switch (BlinkState){
      case 1:
         output_high(DIAG_LED);
         BlinkState = 2;
         break;
      case 2:
         output_low(DIAG_LED);
         BlinkState = 1;
         break;
   }
}

void main(){
   rtos_run();
}
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