ATIMER w/o 32kHz crystal

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

ATIMER w/o 32kHz crystal

901 Views
yuriivanov
Contributor I

Good day.

I have two identical custom board with LPC4357FET256.

One with 32kHz oscillator crystal connected to chip. And another w/o crystal.

But... On both board ATIMER worked. How it's possible ?

Initialize like this:

LPC_CREG->CREG0 &= ~((1 << 3) | (1 << 2));
LPC_CREG->CREG0 |= (1 << 1) | (1 << 0);

LPC_ATIMER->DOWNCOUNTER = 2048;
LPC_ATIMER->PRESET = 2048;

and put DOWNCOUNTER to LCD:

lpc_printf(10,20,"%d",LPC_ATIMER->DOWNCOUNTER);

On both board value changed identical.

UM10503 v2.1 Chapter 36:

"Alarm timer counter register (DOWNCOUNTER, see Table 866), which counts down from a preset value using the
1024 Hz signal derived from the 32 kHz oscillator."

32kHz oscillator crystal NOT present on the second board, but ATIMER is worked... :smileyshocked:

Labels (1)
0 Kudos
5 Replies

649 Views
yuriivanov
Contributor I

Are there any ideas?

P.S.: I reading last Errata (rev 6.6) for LPC43xx. Section 3.20 RTC.1 contain Work-around:

"2. If an on-chip 32.768 kHz oscillator is used..<skip>..Use an external 32.768 kHz clock source (from a host system or from an external oscillator) as an input to the RTCX1 pin to avoid noise coupling."
LPC43xx have internal 32kHz oscillator ? Where can I read more about it ?
P.P.S.: Sorry if I ask stupid questions.
0 Kudos

649 Views
soledad
NXP Employee
NXP Employee

Hello Yuri,

The LPC43xx microcontroller families supports different clock sources: internal IRC oscillator, crystal (MHz) oscillator, and 32.768 kHz (RTC) oscillator. The nominal IRC frequency is 12MHz. Upon power-up or any chip reset, the MCU always starts up with IRC as the clock source. Software may later switch to one of the other available clock sources.

Please check the datasheet for more information about the oscillator :

pastedImage_2.png

pastedImage_3.png

Regarding your issue, Is there i/O switching activity on pins near to XTAL1?


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

649 Views
yuriivanov
Contributor I

Thanks for you answer.

But my question not for clock sources for main operation and base clocks. I have no problem with IRC, external oscillator (connected to XTAL1, XTAL2), e.t.c.

I have problem with RTC oscillator. I not connected any external oscillator to RTCX1, RTCX2.

But 32kHz is present on system. ATIMER worked. And I can not find any information in manual about internal 32kHz oscillator for RTC.

0 Kudos

649 Views
jurgengeerlings
Contributor I

The user manual mentions that the 32kHz crystal oscillator is connected to the ATIMER. I am not aware of any internal 32kHz oscillator. FOr the part without crystal did you see the downcounter counting (changing value at 1kHz)?

0 Kudos

649 Views
yuriivanov
Contributor I

I'm initialize 32kHz and ATIMER like this:

LPC_CREG->CREG0 &= ~((1 << 3) | (1 << 2));
LPC_CREG->CREG0 |= (1 << 1) | (1 << 0);

LPC_ATIMER->DOWNCOUNTER = 2048;
LPC_ATIMER->PRESET = 2048;

No other register changed in ATIMER. No interupts or anything else..

and show DOWNCOUNTER to LCD:

while (!key0_press()) {

lpc_printf(10,20,"%d",LPC_ATIMER->DOWNCOUNTER);

}

Yes. DOWNCOUNTER is counted from 2048 to 0 again and again (if set PRESET to 0 it countdown 1 times).

How it's possible I not understand. :smileysad:

0 Kudos