external clock configuration of S32K148 internal RTC

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

external clock configuration of S32K148 internal RTC

3,176 次查看
ambarish_hundek
Contributor II

Hi,

 

I have configured RTC with external clock .

 

I 've used a crystal oscillator of 32.768KHZ which connected to RTC_CLKIN Pin.

 

My Configuration as below.

 

1.

pastedImage_1.png

2.

pastedImage_2.png

3.

pastedImage_3.png

 

4.In addition, I have configured the PA7's mux mode to PORT_MUX_ALT4 for Enabling RTC CLK_IN.

{
        .base          = PORTA,
        .pinPortIdx    = 7u,
        .pullConfig    = PORT_INTERNAL_PULL_NOT_ENABLED,
        .passiveFilter = false,
        .driveSelect   = PORT_LOW_DRIVE_STRENGTH,
        .mux           = PORT_MUX_ALT4,
        .pinLock       = false,
        .intConfig     = PORT_DMA_INT_DISABLED,
        .clearIntFlag  = false,
        .gpioBase      = PTA,
        .direction     = GPIO_INPUT_DIRECTION,
        .digitalFilter = false,
    },

 

used the startcounter function and after some time , read the RTC time but read the RTC set value only.

RTC is not working after initialization.

please help me to resolve this.

 

Regards,

Ambarish

标签 (1)
0 项奖励
回复
5 回复数

2,861 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I did quick test using sdk sample project rtc_alarm_s32k148. I did the same modifications and it works on my side. I can see that RTC is running. The project is attached.

I used signal generator for generation of clock connected to RTC_CLKIN - square signal, 5V amplitude. What kind of oscillator did you use?

And one more note: LPOCLKS register is write-once register. If you change its settings in your project, it's necessary to turn off and turn on your board to see effect of this change.

Regards,

Lukas

0 项奖励
回复

2,860 次查看
ambarish_hundek
Contributor II

Hello Lukas,

I have cross verified all the configuration and configure the PTD13 pin as RTC clock out pin.

 RTC module is working fine but strange behavior  while reading the RTC time.

after 3 Sec , reading RTC time but it varies Second, minute and hour also.

it is reading some Junk time.

Please find below Schematic for RTC clock configuration

Hardware Engineer explains us that,  RTC clock out pins pulses given to crystal (power to Crystal ) and crystal generates 32.768Khz pulses , that is given to RTC clk input pin.

Please let us know what is the issue and help us to resolve this issue.

find the RTC configuration below

Regards,

Ambarish

0 项奖励
回复

2,860 次查看
ambarish_hundek
Contributor II

Configuration:

Schematics :

Regards,

Ambarish

0 项奖励
回复

2,860 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

you can't use crystal. RTC_CLKIN is standard GPIO pin. You are supposed to connect some kind of integrated oscillator with CMOS square output. I wrote above: "I used signal generator for generation of clock connected to RTC_CLKIN - square signal, 5V amplitude."

This is what you need to use.

Regards,

Lukas

0 项奖励
回复

2,860 次查看
ambarish_hundek
Contributor II

Hello Lukas,

Thank you.

Regards,

Ambarish

0 项奖励
回复