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

Bug_3.200 and 3.191 ... delay_us

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







Bug_3.200 and 3.191 ... delay_us
PostPosted: Sat May 22, 2004 6:58 am     Reply with quote

PCH 3.191 and 3.200 both failed under the following simple test !

delay_us() is broken ! !

>> 3.191 An accuracy problem in the delay functions is fixed

It is NOT fully tested ! Evil or Very Mad

#include <18F458.H>
#fuses HS, OSCSEN, NOWDT, BORV27, PUT, STVREN, NODEBUG, NOLVP
#use delay(clock= 20000000)
#use RS232(baud = 115200, xmit= PIN_C6, rcv= PIN_C7)
void main()
{
int16 i; int8 k= 0;
while ( 1 )
{
// for(i=0;i<10000;i++) delay_us(100); <-- this is ok
for(i=0;i< 5000;i++) delay_us(200); // <-- crashed in this case !

printf("%u ", ++k);
}
}

Shocked what can I say? throw out a new release on Friday, pick up beta test report on Monday morning ? Twisted Evil it is not good, NOT at all.
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

Re: Bug_3.200 and 3.191 ... delay_us
PostPosted: Sat May 22, 2004 5:17 pm     Reply with quote

C-H Wu wrote:
PCH 3.191 and 3.200 both failed under the following simple test !

delay_us() is broken ! !

>> 3.191 An accuracy problem in the delay functions is fixed

It is NOT fully tested ! Evil or Very Mad

#include <18F458.H>
#fuses HS, OSCSEN, NOWDT, BORV27, PUT, STVREN, NODEBUG, NOLVP
#use delay(clock= 20000000)
#use RS232(baud = 115200, xmit= PIN_C6, rcv= PIN_C7)
void main()
{
int16 i; int8 k= 0;
while ( 1 )
{
// for(i=0;i<10000;i++) delay_us(100); <-- this is ok
for(i=0;i< 5000;i++) delay_us(200); // <-- crashed in this case !

printf("%u ", ++k);
}
}

Shocked what can I say? throw out a new release on Friday, pick up beta test report on Monday morning ? Twisted Evil it is not good, NOT at all.


I just copy/pasted your code and compiled it using Version 3.19 and it did not crash.
When you say "crashed in this line" I assume you mean the compiler crashed ! or did you mean the code on the PIC crashed ?

Best regards
Hans Wedemeyer
C-H Wu
Guest







delay_us(200) delays less than 5 usec
PostPosted: Sat May 22, 2004 8:48 pm     Reply with quote

Sorry for the term 'crashed', what happened is the numbers generated by printf("%u ", ++k) run so fast on the terminal instead of poping out once every second, it seems that delay_us(200) delays less than 5 usec !

delay_us(n) works fine for n < 154.

What really crashed is my delay_us() based simple beeper routine. Shocked

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