Search found 7 matches

by eddylau
Thu Sep 27, 2007 12:13 am
Forum: Computer Programming
Topic: Need help on using AVR CodeVision C compiler
Replies: 14
Views: 11555

According to their info, the time needed to handle parameter passing in a function call is longer than the delay provided by the function delay_us( ). So it only accept constant expression for that function to work correctly. Although they didn't help to solve my programming need, at least I know th...
by eddylau
Wed Sep 26, 2007 2:54 am
Forum: Computer Programming
Topic: Need help on using AVR CodeVision C compiler
Replies: 14
Views: 11555

I just got the answer from the support team of the CodeVision.

Anyway, thanks for all your kind concern to my problem.

:grin: :razz: :lol:
by eddylau
Mon Sep 24, 2007 12:26 am
Forum: Computer Programming
Topic: Need help on using AVR CodeVision C compiler
Replies: 14
Views: 11555

sorry for the typo error,

it shoule be:

#include <delay>
#include <mega8515>
by eddylau
Mon Sep 24, 2007 12:23 am
Forum: Computer Programming
Topic: Need help on using AVR CodeVision C compiler
Replies: 14
Views: 11555

the sample coding per your request is as follows: #include <delay> #include <mega8515> unsigned int origin = 1200; unsigned int base= 18800; void main(void) { unsigned char i; for( i = 0; i < 100; i ++) { PIND = 1; delay_us(origin); PIND = 0; delay_us(base); } }
by eddylau
Sun Sep 23, 2007 12:28 am
Forum: Computer Programming
Topic: Need help on using AVR CodeVision C compiler
Replies: 14
Views: 11555

the content of delay.h is as follows: // CodeVisionAVR C Compiler // (C) 1998-2000 Pavel Haiduc, HP InfoTech S.R.L. #ifndef _DELAY_INCLUDED_ #define _DELAY_INCLUDED_ #pragma used+ void delay_us(unsigned int n); void delay_ms(unsigned int n); #pragma used- #endif I wonder whether this is compiler bug...
by eddylau
Fri Sep 21, 2007 3:28 am
Forum: Computer Programming
Topic: Need help on using AVR CodeVision C compiler
Replies: 14
Views: 11555

the function was declared as void delay_us(unsigned int n) in the header file delay.h I need to pass a variable to this function to control the delay according to my actual need. But when I pass a variable to this function, it produce an error saying that it only accept constant expression! Just can...
by eddylau
Thu Sep 20, 2007 1:37 am
Forum: Computer Programming
Topic: Need help on using AVR CodeVision C compiler
Replies: 14
Views: 11555

Need help on using AVR CodeVision C compiler

Dear all,

Is it possible to pass a variable parameter to the function delay_us( )
which accept only constant expression?

If it's impossible, I think this function has no great use.

Thanks a lot

Eddy Lau :x