嗨,在CCP比较模式设置中做了一些额外的实验。我抱怨消息2中的硬件问题,更多的是因为我缺乏阅读能力。在一些实验中,它似乎是这样工作的:在CCP和ECP硬件模块中,“软件中断”模式和“特殊事件”。触发器的模式,是明显不同的操作模式,这两种模式都可用于所有的CCP和ECP模块的硬件。特殊事件触发模式不限于CCP5,特殊事件触发模式将设置中断标志,CCPxIF,对于启用该模式的每个模块,区别在于CCP5,除了中断标志之外,该模式还将为ADC发出GO信号。特殊事件触发模式将重置所使用的计时器,使得触发周期将是计时器从0到CPRXH和CCPRXL的值的时间。软件中断模式似乎与特殊事件触发模式完全不同。相反,软件中断模式,功能与比较模式2, 8和9相同,唯一的区别是没有输出引脚操作。在比较模式中:2, 8, 9和10,从定时器再装入值运行的定时器寄存器,从0xFFF到0x0的定时器滚动,然后触发定时器中断,可用于重新加载定时器寄存器。当比较寄存器CCPRXH和CCPRXL与计时器寄存器TMRXH和TMRXL相匹配时,比较中断被提出。CCP的MCC轻松设置框中的引用:“请参阅指定的定时器来调整比较跳闸点”是误导性的。这是可以在指定的计时器设置中设置的重复周期。比较跳闸时间必须在寄存器窗口中设置:CCPRxH和CCPRXL,或者调用MCC创建的运行时设置函数。MCC应为CCP触发器提供设置计算,将所选择的计时器时钟频率和计时器再装入值计入计费。CCPRX寄存器设置应大于计时器重载值,以便在使用除事件触发器以外的比较模式时进行比较匹配。当选择事件触发模式时,不应使用定时器重载。
以上来自于百度翻译
以下为原文
Hi,
Did some additional experimentation with CCP Compare mode settings.
What I complained about hardware problem in message #2, is more due to my lacking ability to read.
With some experimentation, it seem to work like this:
In CCP and ECCP hardware modules,
'Software Interrupt' mode, and
'Special Event Trigger' mode,
are distinctly different modes of operation, and both these modes are available in hardware for All CCP and ECCP modules.
Special Event Trigger mode is not exclusively for CCP5,
Special Event Trigger mode will set Interrupt flag, CCPxIF,
for every module where this mode is enabled,
the distinction is that for CCP5, this mode will also make a GO signal for the ADC in addition to the interrupt flag.
Special Event Trigger mode will then Reset the timer used,
such that Trigger period will be time used for Timer to count from 0 to value of CCPRxH and CCPRxL.
Software Interrupt mode seem to be completely different from Special Event Trigger Mode.
Instead, Software Interrupt mode, function the same as Compare modes 2, 8 and 9, the only difference is that there is no output pin manipulation.
In Compare modes: 2, 8, 9 and 10, Timer register running from Timer Reload value, to Timer rolling around from 0xFFFF to 0x0, then it trigger Timer interrupt, which may be used to Reload Timer register.
Compare interrupt is raised when Compare registers CCPRxH and CCPRxL match with Timer registers TMRxH and TMRxL.
The reference in MCC Easy Setup box for CCP:
'Please refer to the assigned timer to adjust the Compare trip point'
is misleading.
It is the repeat period that may be set in the assigned Timer Setup.
Compare trip time will have to be set in Registers window: CCPRxH and CCPRxL
or by calling runtime setting function created by MCC.
MCC should provide Setup calculation for CCP trigger, taking the selected Timer clocking frequency and Timer Reload value into account.
CCPRx register setting should be larger than Timer Reload value,
for compare match to occur, when Compare modes other than Event Trigger is used.
When Event Trigger mode is selected, Timer Reload should not be used.
Regards,
Mysil