DSP

影子寄存器

2019-07-13 11:22发布

影子寄存器 影子寄存器在框图表示上下面有一个阴影。
这表示在物理上这个寄存器对应2个寄存器:一个是我们可以写入或读出的寄存器,称为预装载寄存器,另一个是我们看不见的、无法真正对其读写操作的,但在使用中真正起作用的寄存器,称为影子寄存器.
数据手册介绍预装载寄存器的内容可以随时传送到影子寄存器,即两者是连通的(permanently),或者在每一次更新事件(UEV)时才把预装载寄存器的内容传送到影子寄存器。
原文如下:
The auto-reload register is preloaded. Writing to or reading from theauto-reload register accesses the preload register. The content of the preloadregister are transferred into the shadow register permanently or at each updateevent (UEV), depending on the auto-reload preload enable bit (ARPE) in TIMx_CR1register. The update event is sent when the counter reaches the overflow (orunderflow when downcounting) and if the UDIS bit equals 0 in the TIMx_CR1register. It can also be generated by software. The generation of the updateevent is described in detailed for each configuration.对应寄存器影子寄存器可以在发生更新事件时,被更新为它的预装载寄存器的内容;对应的自动重载寄存器可以产生一个更新事件(U)或更新事件中断(UI)。
设计预装载寄存器和影子寄存器的好处是,所有真正需要起作用的寄存器(影子寄存器)可以在同一个时间(发生更新事件时)被更新为所对应的预装载寄存器的内容,这样可以保证多个通道的操作能够准确地同步如果没有影子寄存器,软件更新预装载寄存器时,则同时更新了真正操作的寄存器因为软件不可能在一个相同的时刻同时更新多个寄存器,结果造成多个通道的时序不能同步,如果再加上例如中断等其它因素,多个通道的时序关系有可能会混乱,造成是不可预知的结果。