external clock configuration of S32K148 internal RTC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

external clock configuration of S32K148 internal RTC

3,174 Views
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

Labels (1)
0 Kudos
Reply
5 Replies

2,859 Views
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 Kudos
Reply

2,858 Views
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 Kudos
Reply

2,858 Views
ambarish_hundek
Contributor II

Configuration:

Schematics :

Regards,

Ambarish

0 Kudos
Reply

2,858 Views
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 Kudos
Reply

2,858 Views
ambarish_hundek
Contributor II

Hello Lukas,

Thank you.

Regards,

Ambarish

0 Kudos
Reply