Microchip
直播中

李子跃

7年用户 200经验值
私信 关注
[问答]

PIC16F877a需要读取特定的波形图案

你好,william hill官网 ,我想对如何使用PIC16F87A单片机读取特定波形图提出建议/建议。我知道有2个CCP模块。我能用这些来捕获和比较脉冲持续时间吗?请参阅从EV1527解码器IC发送的附加图像。我想用MCU编码这一点。请建议我需要使用RB0/INT中断引脚或CCP1引脚并捕获每个脉冲的上升沿。

以上来自于百度翻译


      以下为原文

    Hello Forum,

I would like to get advice/suggestion on how to read a specific waveform pattern using pic16f877a MCU.
I know that there are 2 CCP modules. can i use those to capture and compare the pulse duration.

Please refer the attached image of signal which is sent from ev1527 decoder IC. I want to encode this using MCU.

Please suggest should i need to use RB0/INT interrupt pin or CCP1 Pin and capture the rising edge of each pulse.

Thanks
Kiran
   Attached Image(s)

回帖(18)

陈晨

2019-4-17 11:19:07
受到警告
提示: 作者被禁止或删除 内容自动屏蔽
举报

王境滨

2019-4-17 11:29:05
设置CCP模块在每一个上升沿捕获。允许中断发生。在ISR存储器中,CCPRX寄存器的值在一对辅助寄存器中,然后将CCP模块设置为在每个下降沿上捕获。它会产生另一个中断。这一次,你必须计算CCPRX寄存器的新值与存储在辅助寄存器中的旧值之间的差值。计算值乘以Ty-WIL给出信号停留在高电平的时间。因此,您可以确定比特值是0还是1。

以上来自于百度翻译


      以下为原文

    Set the CCP module to capture on every rising edge. Allow for interrupts to occur. At the ISR store the value of the CCPRx register in a pair of auxiliary registers, then set the CCP module to capture on every falling edge. It will generate another interrupt. This time you have to calculate the difference between the new value of the CCPRx registers and the old value stored in the auxiliary registers. The calculated value multiplied by TCy wil give the time the signal stayed at the high level. So you can determine if the bit value is 0 or 1.
举报

tijing忽忽

2019-4-17 11:35:05
你也可以使用两个CCP模块,一组在上升时触发,一个在下降。在从下降沿CCP中断(不使用上升沿上的Its)之后,计算两个捕获的计时器读数从CCP寄存器中的差值,即脉冲宽度(在定时器时钟周期中)。

以上来自于百度翻译


      以下为原文

    You can also use two CCP modules, one set to trigger on the rise and one on the fall. After the interrupt from the falling edge CCP (do not use ints on rising edge) then calculate the difference in the two captured timer readings from the CCP registers and that is the pulse width (in timer clock cycles).
举报

陈晨

2019-4-17 11:53:27
这也可以用外部中断来完成。

以上来自于百度翻译


      以下为原文

   
This can also be done with the external interrupt.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分