24 bit Counter

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

hai frnds

   

i am trying to read value of counter 24 bit ,

   

but some error came i.e(type error unsigned long found pointer expected to unsigned long).

   

i write the prg as below

   

unsingned long int value;

   

Counter24_1_ReadCounter(value);

   

plz solve this coding.

0 Likes
8 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Change this -

   

 

   

unsingned long int value;

   

Counter24_1_ReadCounter(value);

   

 

   

 

   

to this

   

 

   

unsingned long value;

   

Counter24_1_ReadCounter(value);

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

... or shall it be

   

value = Counter24_1_ReadCounter();

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 dana and bob

   

i already tried as same as you told but it gives same error,plz help

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

So why don't you post (attach) your project here so that we all can look for errors.

   

To do so: use the function "Archive Project... " and upload the generated .zip - archive using MS internet explorer (not Chrome!!!)

   

 

   

Bob

0 Likes
Anonymous
Not applicable

unsigned long value;

   

void main(void)

   

{

   

   Counter24_1_start();

   

  Counter24_1_ReadCounter(value);

   

}

   

   

 !W E:\YVRAO\psocexam\COUNTE~1\COUNTE~1\main.c(11):[warning] calling a function without prototype may cause runtime errors if the function does not return int or unsigned int

   

!E E:\YVRAO\psocexam\COUNTE~1\COUNTE~1\main.c(12): type error in argument 1 to `Counter24_1_ReadCounter'; found `unsigned long' expected `pointer to unsigned long'

   

C:\PROGRA~1\Cypress\Common\CYPRES~3\tools\make: *** [obj/main.o] Error 1

   

 counter24bit - 2 error(s) 1 warning(s) 19:49:52

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Sorry for the mis-understanding, I am talking about posting the complete PROJECT, not only some lines of code. The project contains all the definitions you made. Stick to my prior post to generate an archive.

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

... and it is

   

Counter24_1_Start(); // Capital "S"

   

Counter24_1_ReadCounter(&value); // Address of Value / Pointer to Value

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 thank you bob

0 Likes