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 support@ccsinfo.com

please,problem calculating delays in a pic.

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







please,problem calculating delays in a pic.
PostPosted: Sun May 17, 2009 4:39 am     Reply with quote

Hi

i did a beautiful system with the pic16f690 but now i was required to low my pwm to 2 hertz so i changed the OSC to 31khz with:
setup_oscillator(osc_31khz) and its worked fine BUT:

BUT MY DELAYS BECAME LONGER THAN THEY SHOULD BE !
when i do delay_ms(1000) he waits for couple of seconds..

at the start i did : use delay(clock=31000).

why does my delays became longer ??

thanks a lot.
Ttelmah
Guest







PostPosted: Sun May 17, 2009 8:01 am     Reply with quote

They probably didn't.
Remember that at 31KHz, the chip is only executing 7750 instructions per second. Something simple like just multiplying two 16 bit integers together, will take over 31mSec. I'd guess you have other things going on, which at the higher speed, only take a few mSec to complete, which at this slow rate, are 'adding up' to give the extra time....

Best Wishes
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