AnsweredAssumed Answered

PDB continuous mode timing

Question asked by billnd on Jul 29, 2014
Latest reply on Aug 5, 2014 by Robin_Shen

Running the PDB in continuous mode, how do I calculate the timebase? ie the periodicity of the PDB interrupt.


I'm on a K10, with a 92.16MHz core, 46.08MHz bus, and 23.04MHz flash.


PDB set with PRESCALER = 0, MULT = 0, MOD 1920.


With these settings I was assuming the PDB would have a cycle time of 46.08MHz / 1920 = 24.000kHz. What I actually get is a cycle time of slightly longer, so a lower frequency, something like 23.98kHz.


I had assumed that when PDBx_CNT reached MOD - 1, it wrapped to zero and continued without additional delay. This seems not to be the case.


The manual says...


     "Trigger input event to pre-trigger m = (prescaler X multiplication factor X delay m) +

          2 peripheral clock cycles"


...which suggests that maybe there could be a 2 clk delay when the wrap round occurs, if this is treated as a trigger input event every time. So investigating this gives...


MOD: 1920, PDB F: 23.98kHz

MOD: 1919, PDB F: 24.00kHz

MOD: 1918, PDB F: 24.02kHz


If there was 2 clock cycles added, I would have thought 1918 would give the closest match.


So what am I missing, any suggestions welcome.