Home/Support/Support Forum/Input capture
New and improved user forum site going live on 12/6 (All users will need to reset their password when the new forum is active)
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Input capture

0 votes
hello all,

I have a RCM3900 and I attack with input capture. I helped one of the sample (IC_Test.c) but I missed one little thing. it is written:

WrPortI (ICS1R, NULL, 0xCC) / / //PG1 is pulse capture pin for channel 1

I know that ICS1R is Input Capture Source 1 Register. But I do not understand why 0xCC means PG1.
In addition, this program uses the switch S3. How did you it connected to PG1


Thank you.
asked May 6, 2011 in Rabbit by Termi New to the Community (42 points)

Please log in or register to answer this question.

27 Answers

0 votes
More:
capture_status RdPortI = (ICCSR);
if (capture_status & 0x10)

We read and put away the state of the input capture. Then I do not understand why it is compared to 0x10?

Thank you
answered May 6, 2011 by Termi New to the Community (42 points)
0 votes
You need to read the R3000 users manual more carefully and see what the settings for these registers mean.

Looking at the circuit diagram for the RCM3900 prototype board shows S3 is connected to G1.

Regards,
Peter
answered May 6, 2011 by petermcs Veteran of the Digi Community (1,132 points)
0 votes
Hi ,
WrPortI (ICS1R, NULL, 0xCC) means setting the register ICS1R,To use parallel port G for start and stop conditions.
answered May 6, 2011 by cpigilam Veteran of the Digi Community (655 points)
0 votes
Yes I understood this. But I do not see why we use the 0xCC because R3000 user manual 0xCC is the port E ...
answered May 9, 2011 by Termi New to the Community (42 points)
0 votes
Hi,
OxCC means (MSB)11001100(LSB),
here 6,7 bits for Parallel Port G used for Start condition input,
2,3 bits for Parallel Port G used for Stop condition input.

I think you can understand.

For the registers details see the R3000 processor manual.
answered May 9, 2011 by cpigilam Veteran of the Digi Community (655 points)
0 votes
Hy,

Thank you for your quick and accurate response.

Friendly,
answered May 10, 2011 by Termi New to the Community (42 points)
0 votes
Just one last question, I should replace 0xCC whereby if I want to use the switch S2?

Thank you!
answered May 10, 2011 by Termi New to the Community (42 points)
0 votes
Hi,

In RCM3900, the PG1 using the switch S2.
In Rabbit 3000 processor , the input capture channel can accept input from one of the following parallel port pins:
PC1, PC3, PC5, PC7, PD1, PD3, PD5, PD7, PF1, PF3, PF5, PF7, PG1, PG3, PG5, PG7.

On the RCM3900 board S2 connected at PG1.
answered May 10, 2011 by cpigilam Veteran of the Digi Community (655 points)
0 votes
I also thought that S2 was connected to PG1 but when I test the program IC_TEST.c when I press S2 nothing happens .... Must I press S3 !!!!!
So I think S3 is connected to PG1
answered May 10, 2011 by Termi New to the Community (42 points)
0 votes
Could you please send the IC_TEST.c file.
answered May 10, 2011 by cpigilam Veteran of the Digi Community (655 points)
...