Real-Time Clock
20-10
Élan™SC520 Microcontroller User’s Manual
20.5.4
Software Considerations
20.5.4.1
Initializing the RTC Divider Chain
An RTC reset event does not initialize either the divider chain or the Internal Oscillator
Control (OSC_CTL) bit field in the RTC Control A (RTCCTLA) register (RTC index 0Ah).
The internal RTC divider chain can be reset by writing a value of 110b or 111b to the
OSC_CTL field. Writing either of these values resets the entire divider chain and disables
the timebase updates. Resetting the divider chain is not required as part of the RTC
initialization, but can be used to provide an accurate start time after initializing the timebase.
To enable the divider chain and set the proper divisor, a value of 010b should be written to
the OSC_CTL field.
20.5.4.2
Accessing the CMOS Memory
Access to CMOS RAM can be performed without any regard for RTC operations. However,
if the RTC is disabled, the CMOS RAM will be unavailable, but not lost, unless both main
and backup power to the RTC core is removed. Re-enabling the RTC will allow access to
the CMOS RAM with its contents intact.
To access CMOS memory, first write the location of the desired byte to the RTC/CMOS
RAM Index (RTCIDX) register (Port 0070h), then read the contents of that location from
the RTC/CMOS RAM Data Port (RTCDATA) register (Port 0071h), or write the desired data
byte to this data port.
20.5.4.3
Legacy NMI Enable Bit Moved
In PC/AT-compatible systems, bit 7 of the write-only RTC/CMOS RAM Index (RTCIDX)
register (Port 0070h) is used to enable non-maskable interrupts (NMIs). On the ÉlanSC520
microcontroller, this NMI_ENB bit has been moved to bit 6 of the Interrupt Control (PICICR)
register (MMCR offset D00h). Legacy software that needs to explicitly enable or disable
interrupts should be modified accordingly. However, due to the difference in nature of the
use of NMIs in legacy systems (memory parity errors and channel check) and in the
ÉlanSC520 microcontroller (mappable to any interrupt source), compatibility issues are
minimal. Writes to bit 7 of the RTC/CMOS RAM Index (RTCIDX) register (Port 0070h) on
the ÉlanSC520 microcontroller have no effect and do not affect the index of the data
accessed at the RTC/CMOS RAM Data Port (RTCDATA) register (Port 0071h).
For example:
-mov-al, 85h
-out-70h, al
and
-mov-al, 05h
-out-70h, al
Both sequences result in the contents of the RTC Alarm Hour (RTCALMHR) register (RTC
index 05h) being accessed at the RTC/CMOS RAM Data Port (RTCDATA) register.
20.6
INITIALIZATION
The real-time clock is enabled at system reset.
1. Before initializing the internal registers, disable the time and calendar updates via the
SET bit in RTC Control B (RTCCTLB) register (RTC index 0Bh).
2. Reset the RTC divider chain by writing a value of 11xb to the OSC_CTL field in the RTC
Control A (RTCCTLA) register (RTC index 0Ah).
Содержание Elan SC520
Страница 1: ...lan SC520 Microcontroller User s Manual Order 22004A...
Страница 4: ...iv lan SC520 Microcontroller User s Manual...
Страница 28: ...Introduction xxviii lan SC520 Microcontroller User s Manual...
Страница 42: ...Architectural Overview 1 14 lan SC520 Microcontroller User s Manual...
Страница 78: ...System Initialization 3 22 lan SC520 Microcontroller User s Manual...
Страница 108: ...Clock Generation and Control 5 10 lan SC520 Microcontroller User s Manual...
Страница 118: ...Reset Generation 6 10 lan SC520 Microcontroller User s Manual...
Страница 148: ...System Arbitration 8 24 lan SC520 Microcontroller User s Manual...
Страница 214: ...SDRAM Controller 10 36 lan SC520 Microcontroller User s Manual...
Страница 230: ...Write Buffer and Read Buffer 11 16 lan SC520 Microcontroller User s Manual...
Страница 288: ...GP Bus DMA Controller 14 22 lan SC520 Microcontroller User s Manual...
Страница 316: ...Programmable Interval Timer 16 8 lan SC520 Microcontroller User s Manual...
Страница 328: ...Software Timer 18 4 lan SC520 Microcontroller User s Manual...
Страница 346: ...Real Time Clock 20 12 lan SC520 Microcontroller User s Manual...
Страница 360: ...UART Serial Ports 21 14 lan SC520 Microcontroller User s Manual...
Страница 414: ...AMDebug Technology 26 8 lan SC520 Microcontroller User s Manual...