![Analog Devices ADuCM355 Hardware Reference Manual Download Page 16](http://html1.mh-extra.com/html/analog-devices/aducm355/aducm355_hardware-reference-manual_2939808016.webp)
UG-1262
Hardware Reference Manual
Rev. B | Page 16 of 312
To connect and select the AFE die 16 MHz oscillator as the external clock input for the digital die, perform the following steps:
1.
Enable AFE die Pad P2.2 as an output.
pADI_AGPIO2->OEN |= 0x4;
2.
Configure the internal digital die Pad P1.10 as an input and configure its mode as EXT_CLKIN.
DioCfgPin(pADI_GPIO1,PIN10,2); // External Clock mode for Digital die P1.10
DioIenPin(pADI_GPIO1,PIN10,1); // Enable p1.10 input path
3.
Clear CLKEN1, Bits[9:8]. The user is required to close the switch on the AFE die to connect the AFE die clock to the P2.2 pad.
pADI_AFECON->CLKEN1 &= 0x0FF; // Clear CLKEN1 bits 9:8
4.
Select the digital die clock source as the external clock from the AFE die.
DigClkSel(DIGCLK_SOURCE_AFE);
If the clock source is a 32 MHz external crystal, ensure the clock to the digital die is 16 MHz by setting CLKCON[9:6] = 2.
Hibernate Mode and AFE Die Clock Selected on Digital Die
Switch the digital die clock source back to a digital die clock before entering hibernate mode. The device does not wake up if both die are
in hibernate mode and the AFE die clock is used by both die, because, on waking from hibernate mode, the digital die wakes first. The
digital die then must read or write to an AFE die register to wake the AFE die. If the AFE die is the clock source to both die, the wake-up
sequence does not complete.
To enter hibernate mode, use the following suggested sequence:
DigClkSel(DIGCLK_SOURCE_HFOSC); // Switch digital die clock back to its own oscillator
pADI_UART0->COMDIV = 0; // Clear COMDIV to ensure UART operates after wake-up
EnterHibernateMode(); // Enter Hibernate mode
To exit hibernate mode to switch back to using only the AFE clock, use the following suggested sequence:
uiDummyRead = pADI_AFE->LPDACCON0; // Dummy read to wake-up AFE die
delay_10us(2000); // Wait 20mS
DigClkSel(DIGCLK_SOURCE_AFE);
UrtCfg(pADI_UART0,B57600, // Re-Initialize the UART
(BITM_UART_COMLCR_WLS|3),0); // Configure UART for 57600 baud rate
printf("Digital Die clocked by AFE die's 16MHz oscillator \r\n");