Hi,
How to calculate the delay time of the Programmable Delay Block (PDB) in KM34?
For example, if setting PDB0_CH0DLY0=200, how to calculate the delay time?
And I cannot find the clock source for PDB in the data sheet. Can you also tell me the clock source of PDB?
The PDB clock reference can be found at the KM34 Reference Manual Chapter 5 Clock Distribution
To calculate a PDB channel delay you need to use the configurable PDB registers bits:
PDB Clock = Bus Clock / ( Preescaler x Mult )
Preescaler -- PDBx_SC[PREESCALER]
Mult -- PDBx_SC[MULT]
Channel Delay = PDB Clock / PDBx_CHnDLY0
For example
Bus Clock = 24 MHz
Preescaler = 011 (8 times)
Mult = 01 ( factor is 10 )
PDBx_CHnDLY0 = 300
PDB Clock = 24 MHz / ( 8 x 10 ) = 300 kHz 1 PDB Count = 3.33 us
Channel Delay = 300 kHz / 300 = 1 kHz Channel timer = 1 ms