Hi,
Im trying to just enable the video1 clock to be used in other parts of the system but im having problems with it and it would be great to have some help.
Following the Figure 11-13 of the AM57x TRM at page 2617, I want to generate an output of 27 MHz. My SYS_CLK1 is 20MHz.
DPLL_VIDEO1_CLK is derived directly from SYS_CLK1 or SYS_CLK2, and I set the register CM_CLKSEL_VIDEO1_PLL_SYS to use SYS_CLK1.
Im using:
RegN + 1 = 7
RegM = 293
M4+1 = 1
M7+1 = 1
M8+1 = 1
The steps im using to configure the PLL are:
1) Configure the PLL_CTRL register (0x4A0A4000) to use:
## PLL_CTRL_REG
## HSDIV (bit 4) set to 1
## PLL_SYSRESET (bit 3) set to 1
## PLL_HALTMOD (bit 2) set to 0
## PLL_GATEMODE (bit 1) set to 0
## PLL_AUTOMODE (bit 0) set to 0
So, I wrote 0x18 to the register 0x4A0A4000
2) Configure the PLL_CONFIGURATION1 (0x4A0A400C):
## M=293: $((293 << 9))
## N+1=4: $((3 << 1))
## M4+1=1: $((0 << 21))
So, i wrote 0x24A06 to the register 0x4A0A400C
3) configure the PLL_CONFIGURATION2 (0x4A0A4010)
## M7_CLOCK_EN (bit 25) set to 1
## M6_CLOCK_EN (bit 23) set to 1
## REFSEL (bits 21 and 22) must be set to 0x3
## HSDIVBYPASS (bit 20) set to 0
## M4_CLOCK_EN (bit 16) set to 1
## BYPASSEN (bit 15) should be set to 0
## PHY_CLKINEN (bit 14) set to 1
## PLL_REFEN (bit 13) set to 1
## PLL_HIGHFREQ is not divided by 2 (bit 12 is set to 0)
## PLL_CLKSEL selects SYSCLK as PLL reference clock (set to 0)
## PLL_LOCKSETL (bits 9:10) set to 0x0
## PLL_DRIFTGUARDEN (bit 8) is set to 0
## PLL_LOWCURRSTDBY (bit 6) set to 0
## PLL_LLLLPMODE (bit 5) set to 0
## PLL_IDLE (bit 0) set to 0
I wrote 0x2E16000 to the register 0x4A0A1010
4) Configure the PLL_CONFIGURATION3 (0x4A0A4014)
## M6+1 = 1
## M7+1 = 1
I wrote 0x0 to the register 0x4A0A4014
5) Set the PLL_GO(0x4A0A4008) bit to 1
I wrote 0x1 to the register 0x4A0A4008
After these steps I read the 0x4A0A4008 and it was set to 0x0, which tells me that the sequence is completed.
But, if I read the status register (0x4A0A4004), the output is 0x18CC8, which means:
PLL_TICOPWDN is set to 1: Internal oscillator power down
PLL_LDOPWDN is set to 1: PLL internal LDO is powered up
BYPASS_ACKZ is set to 0: PHY or HSDIVIDER has switched to using the bypass clocks
SSC_EN_ACK is set to 0: SSC is disabled
M7_CLOCK_ACK is set to 1: M7 clock is active
M6_CLOCK_ACK is set to 1: M6 clock is active
BYPASSACKZ_MERGED is set to 0: PHY and HSDIVIDER have switched to using the bypass clocks
M4_CLOCK_ACK is set to 0: M4 clock is active
PLL_BYPASS is set to 1: PLL bypass
PLL_HIGHJITTER is set to 0: Normal jitter
PLL_LOSSREF is set to 1: Reference input inactive
PLL_RECAL is set to 0: Recalibration is not required
PLL_LOCK is set to 0: PLL is not locked
PLL_CTRL_RESET_DONE is set to 0: Reset is in progress
The main thing that the status register is telling me is that:
a) PLL is not locked
b) Input reference is inactive
c) reset is in progress
So, Im not sure what I am doing wrong here. I must have forgotten some step as per TRM`s description. Could anyone point me out what I am missing here?
Thank you
regards,
David