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

Repetitions of large values - PIC10F200

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



Joined: 11 Dec 2010
Posts: 60

View user's profile Send private message

Repetitions of large values - PIC10F200
PostPosted: Thu Jun 14, 2012 8:50 am     Reply with quote

Hello

What am I doing wrong?

I have the program below that should be repeated every 12 hours.
Actually I have a delay of 1min 30s.
Why?

How am I doing accounts 16bit, I compensei with time-based simulations. But no results.

PS: With another pic this works ....
Code:

#include <10F200.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOMCLR                   //Master Clear pin used for I/O
#FUSES NOPROTECT                //Code not protected from reading

#use delay(clock=4000000)


void main()
{
unsigned int16 conta;

output_B(0);

delay_ms(1000);

while(1)
{
output_high(PIN_B0);
output_high(PIN_B1);

   for(conta=0; conta<=23; conta++)  //25
   {
   delay_ms(1024);
   }
   
   delay_ms(422);
   
output_low(PIN_B0);
output_low(PIN_B1);   

   for(conta=0; conta<42163; conta++)  //43175
   {
   delay_ms(1024);
   }
   
   delay_ms(100);
   
}

}


Thank you
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Thu Jun 14, 2012 9:00 am     Reply with quote

Compiler version?.

Do a search here. Have a memory, that there was a bug with delays over perhaps 255mSec, on the PIC10/12 family with some compiler versions a while back.....

Best Wishes
Dave_25152



Joined: 11 Dec 2010
Posts: 60

View user's profile Send private message

PostPosted: Thu Jun 14, 2012 4:42 pm     Reply with quote

Hello

The compiler of the 4.114 version, is this error?

I already did laps of this, but I have even used a PIC 10F200 and he has no interrupts, I can not do otherwise.


Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 14, 2012 5:30 pm     Reply with quote

That is a version that has the delay_ms() error. I don't know if the
10F series is affected, but it might be. See this thread for a work-around:
http://www.ccsinfo.com/forum/viewtopic.php?t=44326

Look for the code that has: my_delay_ms()
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