R EM MICROELECTRONIC-MARIN SA A3024 Very Low Power 8-Bit 32 kHz RTC with Digital Trimming, User RAM and High Level Integration Features Typical Operating Configuration WR or R/W RD or DS IRQ n Digital trimming and temperature compensation facilities n Can be synchronized to 50 Hz or nearest s/min n 50 ns access time with 50 pF load capacitance n Standby on power down typically 1.2 mA n Universal interface compatible with both Intel and Motorola n Simple 8 bit interface with no delays or busy flags n 16 bytes of user RAM n Power fail input disables during power up / down or reset n Bus can be tri-state in power fail mode n Wide voltage range, 2.0 V to 5.5 V n 12 or 24 hour data formats n Time to 1/100 of a second n Leap year correction and week number calculation n Alarm and timer interrupts n Programmable interrupts: 10 ms, 100 ms, s or min n Sleep mode capability n Alarm programmable up to one month n Timer measures elapsed time up to 24 hours n Temperature range -40 to +85 OC n Packages DIP20 and SO220 CPU CS IRQ RD X in WR A3024 A/D X out AD0 to AD7 Address Bus Data Bus Address Decoder Description CS RD WR The A3024 is a low power CMOS real time clock. Standby current is typically 1.2 mA and the access time is 50 ns. The interface is 8 bits with multiplexed address and data bus. Multiplexing of address and data is handled by the input line A/D. There are no busy flags in the A3024, internal time update cycles are invisible to the user's software. Time data can be read from the A3024 in 12 or 24 hour data formats. An external signal puts the A3024 in standby mode. Even in standby, the A3024 pulls the IRQ pin active low on an internal alarm interrupt. Calendar functions include leap year correction and week number calculation. Time precision can be achieved by digital triming. The A3024 can be synchronized to an external 50 Hz signal or to the nearest second or minute. Fig. 1 Pin Assignment DIP20 / SO20 SYNC PF AD0 AD1 AD2 AD3 A/D IRQ VSS XIN Applications n n n n n RAM Industrial controllers Alarm systems with periodic wake up PABX and telephone systems Point of sale terminals Automotive electronics A3024 NC AD7 AD6 AD5 AD4 RD WR CS VDD XOUT Fig. 2 1 R A3024 Absolute Maximum Ratings Parameter Symbol Conditions Maximum voltage at VDD VDDmax Vmax Vmin TSTOmax TSTOmin Max. voltage at remaining pins Min. voltage on all pins Maximum storage temperature Minimum storage temperature Maximum electrostatic discharge to MIL-STD-883C method 3015 Maximum soldering conditions VSmax TSmax or electric fields; however, it is advised that normal precautions must be taken as for any other CMOS component. Unless otherwise specified, proper operation can only occur when all terminal voltages are kept within the supply voltage range. Unused inputs must always be tied to a defined logic voltage level. VSS + 7.0V VDD + 0.3V VSS - 0.3V +125OC -55OC Operating Conditions Parameter 1000V Symbol Min. Typ. Max. Units Operating temperature Logic supply voltage Supply voltage dv/dt (power-up & down) Decoupling capacitor Crystal Characteristics Frequency Load Capacitance Series resistance 250OC x 10s Table 1 Stresses above these listed maximum ratings may cause permanent damage to the device. Exposure beyond specified operating conditions may affect device reliability or cause malfunction. Handling Procedures TA VDD -40 2.0 V/ms nF 32.768 8.2 30 35 50 kHz pF kW 100 7 C V 6 dv/dt f CL RS O +85 5.0 5.5 This device has built-in protection against high static voltages Table 2 Electrical Characteristics VDD = 5.0V 10%, VSS = 0 V, TA = -40 to +85OC, unless otherwise specified Parameter Symbol Test Conditions 1) Standby current 2) IDD IRQ (open drain) Output low voltage Output low voltage VOL VOL IOL = 8 mA IOH = 1 mA, VDD = 2 V VIL VIH VOL VOH VPFL VH ILS IIN ITS TA = +250C TA = +250C IOL = 6 mA IOH = 6 mA Start-up time Frequency Characteristics Frequency tolerance Frequency stability Temperature stability 2) 3) 4) VDD = 3 V, PF = 0 VDD = 5 V, PF = 0 CS = 4 MHz, RD = VSS, WR = VDD Dynamic current Inputs and Outputs Input logic low Input logic high Output logic low Output logic high PF activation voltage PF hysteresis Pullup on SYNC Input leakage Output tri-state leakage Oscillator Characteristics Starting voltage 1) IDD Min. Typ. Max. Units 1.2 2 10 15 1.5 mA mA mA 0.4 0.4 V V 0.2 x VDD V V V V V mV mA nA nA 0.8 x VDD 0.4 2.4 0.5 x VDD 100 TA = +250C VILS = 0.8 V VSS 50, the seconds register is incremented. Synchronization to the nearest minute implies that the seconds are cleared to zero and if the contents were > 30, the minutes register is incremented. Fractions of seconds are cleared. An alarm date and time may be preset in RAM addresses 30 to 34 hex. The alarm function can be activated by setting the alarm enable / disable bit (addr. 00 hex, bit 2). Once enabled the preset alarm time and date are compared, every internal time update cycle (10 ms), with the clock parameters in the reserved clock area. When the clock parameters equal the alarm parameters the alarm flag (addr. 01 hex, bit 5) is set. If the alarm mask bit (addr. 01 hex, bit 1) is set, the IRQ pin goes active. The alarm flag indicates to software the source of the interrupt. IRQ will remain active until software acknowledges the interrupt by clearing the alarm flag. If the alarm is enabled, and an alarm address set to FF hex, this parameter is not compared with the associated clock parameter. Thus it is possible to achieve a repeat feature where an alarm occurs every programmed number of seconds, or seconds and minutes, or seconds, minutes and hours. The A3024 pulls the open drain IRQ line active low during standby when an alarm interrupt occurs. If the 12/24 hour mode is changed then the alarm hours must be re-initialised. Note: The user should ensure that a time lapse of at least 60 microseconds exists between the falling edge of the IRQ and the clearing of the alarm flag. Pulse There are 4 programmable pulse frequencies available on the A3024, these are every 10 ms, 100 ms, second or minute. The pulse feature is activated by setting the pulse enable / disable bit at address 00, bit 1. The pulse frequency is selected by setting one of the bits 0 to 3 at address 02 hex (see Table 8). If more than one of the pulse bits are set then the feature is disabled. At the selected interval the pulse flag bit (addr. 01 hex, bit 4) is set. If the pulse mask bit (addr. 01 hex, bit 0) is set then the IRQ pin goes active. The pulse flag indicates to software the source of the interrupt. IRQ will remain active until software acknowledges the interrupt by clearing the pulse flag. The pulse feature is disabled while in standby. Upon power restoration the pulse feature is enabled if enabled prior to standby. See also the section "Frequency Tuning". IRQ The IRQ output is used by 4 of the A3024's features. These are: 1) Pulse, to provide periodic interrupts to the microprocessor at preprogrammed intervals; Note: The user should ensure that a time lapse of at least 60 microseconds exists between the falling edge of the IRQ and the clearing of the pulse flag. 2) Alarm to provide an interrupt to the microprocessor at a preprogrammed time and date; Time Set Lock 3) Timer, to provide an interrupt to the microprocessor when the timer rolls over from 23:59:59:99 to 00:00:00:00; and The time set lock control bit is located at address 00 hex, bit 5 (see Table 6). When set by software, this bit disables any transfer from the RAM to the reserved clock and timer area as well as inhibiting any write to the digital trimming register at address 10 hex. When the time set lock bit is set the following transfer operations are disabled: 4) Frequency trimming (see section "Frequency Trimming"). The first 3 features listed are similar in the way they provide interrupts to the microprocessor. Each of the 3 has an enable / disable bit, a flag bit, and an interrupt mask bit. The enable / disable bit allows software to select a feature or not. A set flag bit indicates that an enable feature has reached its interrupt condition. Software must clear the flag bit. The interrupt mask bit allows or disallows the IRQ output to become active when the flag bit is set. The IRQ output becomes active whenever any interrupt flag is set which also has its mask bit set. For all sources of maskable interrupts within the A3024, the IRQ output will remain active until software clears the interrupt flag. The IRQ output is the logical OR of all the unmasked interrupt flags. The IRQ output is open drain so an external pullup to VDD is needed. In standby (PF active) the IRQ output will be active if the alarm mask bit (addr. 01 hex, bit 1) is set and the alarm flag is also set. The timer or the pulse feature cannot cause the IRQ output to become active while in standby. The clock command followed by write, the timer command followed by write, the clock and timer command followed by write, and writing to the digital trimming register. A set bit prevents unauthorized overwriting of the reserved clock and timer area. Reading of the reserved clock and timer area, using the commands, is not affected by the time set lock bit. Clearing the time set lock bit by software will re-enable the above listed commands. On initialisation the time set lock bit is cleared. The time set lock bit does not affect the user RAM (addr. 50 to 5F hex). Frequency Tuning The A3024 offers a key feature called "Digital Trimming", which is used for the clock accuracy adjustment. Unlike the traditional capacitor trimming method, which tunes the crystal oscillator, the digital trimming acts on the divider chain, allowing the clock adjustment by software. The oscillator frequency itself is not affected. Synchronization There are 3 ways to synchronize the A3024. It can be synchronized to 50 Hz, the nearest second, or the nearest minute. Synchronization mode is selected by setting one of the 12 R A3024 (210 - 209.97) / 210 x 1E + 06 = 142.857 ppm. The value for the digital trimming register is: 142.857 / 0.984 = 145.18, rounded to 145 ppm (91 hex). The Principle of Digital Trimming With the digital trimming disabled (i.e. digital trimming register set to 00 hex), the oscillator and the first stages of the divider chain will run slightly too fast (typ. 210 ppm: ppm = parts per million), and will generate a 100 Hz signal with a frequency of typically 100.021 Hz. To correct this frequency, the digital trimming logic will inhibit every 31 seconds, a number of clock pulses, as set in the digital trimming register. Since the duration of 31 seconds corresponds to 1'015'808 oscillator cycles, the digital trimming has a resolution of 0.984 ppm. In other words, every increment by1 of the digital trimming value will slow down the clock by 0.984 ppm, which permits the accuray of 0.5 ppm to be reached. Note that a 1 ppm error will result in a 1 second difference after 11.5 days, or a 1 minute difference after 694 days! The trimming range of the A3024 is from 0 to 251 ppm. The 251 ppm correction is obtained by writing 255 (FFhex) into the digital trimming register. Time Correction with Change of Temperature If the mean temperature on site is known to be 45 C, the frequency error determined at room temperature has to be modified, using the graphs or the equation on Fig. 5. 2 Df/f = -0.038 x (45 - 25) = 15.2 ppm The trimming value for 45 OC will be: (142.857 ppm - 15.2 ppm) / 0.984 = 129.73, rounded to 130 (82 hex). 12 / 24 Hour Data Format The A3024 can run in 12 hour or 24 hour data format. On initialisation the 12/24 hour bit ad addr. 00 bit 4 is cleared putting the A 3024 in 24 hour data format. If the 12 hour data format is required then bit 4 at addr. 00 must be set. In the 12 hour data format the AM/PM indicator is the MSB of the hours register addr. 23 bit 7. A set bit indicates PM. When reading the hours in the 12 hour data format software should mask the MSB of the hours register. In the 24 hour data format the MSB is always zero. The internal clock registers change automatically between 12 and 24 hour mode when the 24/12 hour bit is changed. The alarm hours however must be rewritten. How to Determine the Digital Trimming Value The value to write into the di gital trimming register has to be determined by the following procedure: 1. Initialise the A3024 by writing a 1 and then a 0 into the "Initialisation Bit" of the status register 2 (addr. 02 hex, bit 4). This activates the frequency tuning mode in status register 0 (addr. 00 hex, bit 1) and clears the other status bits. 2. Write the value 00 hex into the digital trimming register (addr. 10 hex). From now, the IRQ output (open drain) will deliver the 100 Hz signal, which has a 20% duty cycle. 3. Measure the duration of 21 pulses at the IRQ output, with the trigger set for the falling edge. It is possible also to divide the IRQ frequency by 21, using a TTL or CMOS external circuit. 4. Compute the frequency error in ppm: Test From the various test features added to the A3024 some may be activated by the user. Table 6 shows the test bits. Table 10 shows the three available modes and how they may be activated. The first accelerates the incrementing of the parameters in the reserved clock and timer area by 32. The second causes all clock and timer parameters, in the reserved clock and timer area, to be incremented in parallel at 100 Hz with no carry over, ie. independently of each other. The third test mode combines the previous two resulting in parallel incrementing at 3.2 kHz. While test bit 1 is set (addr. 00 hex, bit 7) the digital trimming action is disabled and no pulses are removed from the divider chain. Test bit 0 (addr. 00 hex, bit 6) can be combined with digital trimming (see section "Frequency Tuning"). To leave test, the test bits (addr. 00 hex, bits 6 and 7) must be cleared by software. Test corrupts the clock and timer parameters and so all parameters should be re-initialised after a test session. Test Modes 6 210 ms - measured value in ms x 10 210 ms 5. Compute the corrective value to write into the digital trimming register. Digital trimming value = frequency error / 0.984 6. Write this value into the digital trimming register. 7. Switch off the frequency tuning mode in status 0 (addr. 00 hex, bit 0 set to 0). The Real Time Clock circuit will now run accurately at an operating temperature equal to the calibration temperature. If the operating temperature differs from the one at calibration time, the graphs shown on Fig. 4 and 5 will help in determining the definitive value. If the mean operating temperature of the equipment is not known at calibration time, the equipment user will do the final correction with a software provided by the system designer. To avoid the calibration procedure, it is possible also to set the digital trimming register to 210 (D2 hex) as a standard starting value, and let the final equipment user perform the final adjustment on site, which will take the real temperature into account. freq. error = Addr. Addr. 00hex bit 7 00hex bit 6 Time Correction at Room Temperature Let us consider that the duration of 21 pulses of the IRQ signal is 209.97 ms at room temperature. The frequency error is: 0 0 1 0 1 0 1 1 Function Normal Operation Acceleration by 32 Parallel increment of all clock and timer parameters at 100 Hz with no carry over; dependent on the status of bit 3 at address 00 hex Parallel increment of all clock and timer parameters at 3.2 kHz with no carry over; dependent on the status of bit 3 at address 00 hex Table 10 13 R A3024 Battery or Supercap Connection Note : The diodes must have a forward voltage drop of less than 0.3 V. BAT 85 s are recommended. VDD Power fail (low for standby) PF VDD A3024 + or + Battery Supercap VSS VSS Fig. 11 Typical Applications A 3024 Interfaced with Intel CPU (RD and WR pulse) Address Address Bus 0 - 7 Latch A0 A/D Bus 0 - 7 CPU Address Bus A8 - A15 to other peripherals and memory Decoder WR RD CS RD WR A/D D 0-7 A3024 Fig. 12 A 3024 Interfaced with Motorola CPU (DS or RD pin tied to CS, and R/W) Data Bus CPU Address Bus to other peripherals and memory A0 Decoder R/W DS RD CS A/D WR AD 0-7 A3024 Fig. 13 14 R A3024 Process Application 2) average on time for the valve - 2 bytes 3) maximum temperature ever encountered together with the time and date - 6 bytes 4) date of last service and service man's ID - 4 bytes 5) identification code for the controller - 1 byte Temperature sensor Crystal Layout In order to ensure proper oscillator operation we recommend the following standard practices: - Keep traces as short as possible. - Use a guard ring around the crystal. Controller Solenoid valve Fig. 15 shows the recommended layout. Fig. 14 Oscillator Layout - The formula in Fig. 5 is used by software to continually update the digital trimming register and so compensate the A3024 for the ambient temperature. - The timer is used to measure the duration the valve is on. - The alarm feature is used to turn the controller power on and off at the time programmed by software. The A3024 pulls IRQ active low on an alarm even in standby and thus can control the power on/off switch for the controller. - The user RAM provides the controller with non volatile RAM for vital parameters. For example : 1) the total on time for the valve to enable software to compute energy usage and also to identify when service is needed - 3 bytes VSS XIN VDD XOUT Fig. 15 15 R A3024 External Clock Ordering Information An external signal generator can be used to drive the divider chain of the A 3024. Fig. 16a and 16b show how to connect the signal generator. The A3024 is available in the following packages: DIP20 pin plastic package SO20 pin plastic package Signal Generator A3024 20P A3024 20S When ordering, please specify the complete part number and package. XIN 1- 2 V peak to peak A3024 XOUT VSS Fig. 16a Note : The peak value of the signal provided by the signal generator should not exceed 2 V on X OUT. 0 - 5.5 V XIN 1) 100 kW A3024 XOUT 1) 56 kW VSS 1) indicative values Fig. 16b Note : The peak value of the signal provided by the signal generator should not exceed 2 V on XOUT. EM Microelectronic-Marin SA cannot assume responsibility for use of any circuitry described other than circuitry entirely embodied in an EM Microelectronic-Marin SA product. EM Microelectronic-Marin SA reserves the right to change circuitry and specifications without notice at any time. You are strongly urged to ensure that the information given has not been superthe seded by a more up-toO 2000 EM Microelectronic-Marin SA, 10/00, Rev. C/321 16