现在想用MSPF5529做测距实验,但是输入捕获无法实现请问怎么做才能实现测量HC-SR04的高电平时间?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
现在想用MSPF5529做测距实验,但是输入捕获无法实现请问怎么做才能实现测量HC-SR04的高电平时间?
当CAP=1时,选择捕获模式。捕获模式用于记录时间事件,比如速度估计或时间测量。捕获输入CCIXA和CCLXB连接外部的引脚或内部的信号,这通过CCISX位来选择。CMX位选择捕获输入信号触发沿;上升沿、下降沿或两者都捕获。
具体您可以看一下 
18.2.4.1
The capture mode is selected when CAP = 1. Capture mode is used to record time events. It can be used for speed computations or time measurements. The capture inputs CCIxA and CCIxB are connected to external pins or internal signals and are selected with the CCIS bits. The CM bits select the capture edge of the input signal as rising, falling, or both. A capture occurs on the selected edge of the input signal. If a capture is performed: • The timer value is copied into the TBxCCRn register. • The interrupt flag CCIFG is set. The input signal level can be read at any time from the CCI bit. Devices may have different signals connected to CCIxA and CCIxB. See the device-specific data sheet for the connections of these signals.
希望对您有所帮助!