Home/Support/Support Forum/How can I reset the latched register (ICLxR and ICMxR) on input capture?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How can I reset the latched register (ICLxR and ICMxR) on input capture?

0 votes
Hi, I try yo use the input capture on Rabbit 4000.
The idea is to count pulses of a radar for specific time.
I am using the Rabbit 4000.
I am using two input captures once as a counter and the other one as a capturer.
The idea is count pulses while the other input capture is activate. So, when the input capture is ON the second input capture start counting pulses of a radar until the first one stop.

I made it, but I have a problem when the first input capture is activated and there are no pulses on the radar. Because there is not reset on the count register, so it send by serial the last counted number.

I don´t know if you understand my problem. But I only need to reset the latched count of the input capture.

Thanks
asked Jun 1, 2014 in Rabbit Software by ptruffa New to the Community (0 points)

Please log in or register to answer this question.

2 Answers

0 votes
You need to configure a timer to reset the input capture counter and send that to a serial port. For radar you probably want to know the time between pulses. Without knowing the specifics of your application, it's difficult to say what needs to be done.
answered Jun 2, 2014 by MargaretK Veteran of the Digi Community (545 points)
0 votes
Writing a 1 to bit 2 of the ICCSR register does the following:

Reset Input Capture 1 counter to all zeros and clears the rollover latch.
Writing a 1 to bit 3:

Reset Input Capture 2 counter to all zeros and clears the rollover latch.

To clear both channels:
WrPortI(ICCSR, NULL, 0x0C); // zero out counters

See samples\Rabbit4000\ic_test.c. Also, full details on input capture are in Chapter 21 of the Rabbit 4000 processor manual.
answered Jun 3, 2014 by trooper2 Veteran of the Digi Community (589 points)
...