Hi
In nxp mkm34z256vll7 I removed external rtc crystal and there is no other external crystal, in this condition I am trying to read the iRtc RAM. But I am unable to see any controller register and controller behaviour also undesired.
Please tell me how to get out from this.As I want to read the iRtc ram and it's variable.
Thank & Regards,
Darshan.
Hi, Darshan,
As you know that the iRTC can function with only battery power supply and the 32KHz crystal connected to Extal32/Xtal32 pins even if cpu is power down, so the 32KHz external crystal is prerequisite to read/write iRTC_RAM. If you do not connect the external 32KHz crystal, i suggest you use internal 32KHz IRC as iRTC clock, anyway, the iRTC must have a clock.
Hope it can help you.
BR
Xiangjun Rong
Hi xiangjun,
iRtc is working very first initializations also happened, but after POR again iRtc not getting initialized.
Upto initializations code is working after coming to irtc initializations controller itself only not working.
Regards,
Darshan
Hi, Darshan,
I am sorry, I am not clear about your status, in which condition can you read iRTC RAM, in which condition can you not read the iRTC RAM..
BTW, can you populate the 32KHz external crystal?
BR
Xiangjun Rong
HI Xiangjun,
I am using following code when external crystal is removed, but after POR it's not working .
Very first time only it's coming after POR it's not coming.
Please tell for the same .
#include "drivers.h"
extern volatile uint8_t IRTC_Ram[32];
void main (void)
{
FLL_CtrlIRCLKEN(TRUE);
FLL_SelIRCSCLK(FASTCLK_SRC);
MCG_C1 |= MCG_C1_FRDIV(0x02);
SIM_SelRtcClk(SIM_RTCCLK_SRC2);
SIM_EnableModule(PORTH);
PORT_Init(PORTH,PORT_MODULE_ALT1_MODE, PIN6 );
GPIO_Init(GPIOH,GPIO_OUT_LOGIC0_MODE,PIN6);
arch_delay(250000);
GPIO_Set(GPIOH,PIN6);
SIM_Init(SIM_MODULE_CONFIG_OPTIMIZED_MODE_ONE);
PMC_Init(PMC_MODULE_LVDRE_OFF_LVDINT_OFF_LVWINT_OFF_CONFIG(PMC_LVDL,PMC_LVW1),PMC_INTREG_BGEN_OFF_BGBE_OFF_CONFIG, PRI_LVL0, (PMC_CALLBACK)NULL);
SMC_Init (SMC_MODULE_VLPS_ON_VLLS_ON_CONFIG);
SMC_SetMode(RUN);
IRTC_Init(IRTC_MODULE_COMP_OFF_CONFIG,
IRTC_TAMPER_PIN_POL_LOW_CONFIG(TAMPER_FILT_CLK_2HZ,4),
IRTC_TAMPER_PIN_DI_CONFIG,
IRTC_TAMPER_PIN_DI_CONFIG, 0);
MCG_C8 |= (MCG_C8_CME1_MASK );
MCG_C8 &= ~(MCG_C8_LOCRE1_MASK);
arch_delay(2500000);
GPIO_Clr(GPIOH,PIN6);
if((MCG_C8_LOCS1_MASK == (MCG_C8 & MCG_C8_LOCS1_MASK)))
{
FLL_Init (FLL_MODULE_FEI_20_25MHZ_CONFIG);
MCG_C8 |= MCG_C8_LOCS1_MASK;
arch_delay(25000);
}
else
{
SIM_SetClkMode (SYSCLK_MODE1);
SIM_SetClkDiv (SYSCLK_DIV1);
FLL_Init (FLL_MODULE_FEE_24MHZ_CONFIG);
arch_delay(25000);
}
while(1);
}
Help in this.,
Thanks and regards,
Darshan.