Re: Question about the MAVRIC Controller

I am interested in the MAVRIC controller. I have a question about the

> I/O update rate. How fast can the controller sample inputs? In other > words, if I had a pulse coming into a discrete input, with what accuracy > could I measure the pulse width? Within 1 microsecond?

Assuming a 16 MHz crystal frequency, the MAVRIC board can measure a pulse width with a resolution down to 1 / 16000000 of a second, or about .063 microseconds.

You do this by setting up one of the input lines to function as an input capture. What happens is, the MCU monitors the state of the line and when it changes, it captures the value of one of the free-running timers which can be clocked at up to the CPU frequency, which in this case is 16 MHz. Say that is the rising edge of the line. You store that value off somewhere, call it T1.

The MCU continues to monitor the state of the line, and when it changes again (the falling edge), the MCU again captures the value of the free running timer. Now store that off to T2.

Your pulse width is T2 - T1, in increments of 1 / crystal_freqency. Thus, if T1 happend to be 20, and T2 happened to be 27412, the pulse width would be 27412 - 20 = 27392 clock ticks, which at 16 MHz operation corresponds to 1.7120 milliseconds.

Excuse my newbie ignorance. I'm new to the world of microcontrollers, > and I'm trying to get a feel for their real-world performance.

Not at all. This is a perfectly reasonable question.

Cheers,

-Brian

Reply to
Brian Dean
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.