View previous topic :: View next topic |
Author |
Message |
Dave_25152
Joined: 11 Dec 2010 Posts: 60
|
Repetitions of large values - PIC10F200 |
Posted: Thu Jun 14, 2012 8:50 am |
|
|
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: 19515
|
|
Posted: Thu Jun 14, 2012 9:00 am |
|
|
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
|
|
Posted: Thu Jun 14, 2012 4:42 pm |
|
|
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
|
|
Posted: Thu Jun 14, 2012 5:30 pm |
|
|
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() |
|
|
|