Old Company Name in Catalogs and Other Documents
|
|
|
- Alban Sparks
- 10 years ago
- Views:
Transcription
1 To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over all the business of both companies. Therefore, although the old company name remains in this document, it is a valid Renesas Electronics document. We appreciate your understanding. Renesas Electronics website: April 1 st, 2010 Renesas Electronics Corporation Issued by: Renesas Electronics Corporation ( Send any inquiries to
2 Notice 1. All information included in this document is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas Electronics products listed herein, please confirm the latest product information with a Renesas Electronics sales office. Also, please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website. 2. Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or others. 3. You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part. 4. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software, and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits, software, or information. 5. When exporting the products or technology described in this document, you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations. You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military, including but not limited to the development of weapons of mass destruction. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. 6. Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics does not warrant that such information is error free. Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein. 7. Renesas Electronics products are classified according to the following three quality grades: Standard, High Quality, and Specific. The recommended applications for each Renesas Electronics product depends on the product s quality grade, as indicated below. You must check the quality grade of each Renesas Electronics product before using it in a particular application. You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics. Further, you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics. Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics. The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books, etc. Standard : Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots. High Quality : Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anticrime systems; safety equipment; and medical equipment not specifically designed for life support. Specific : Aircraft; aerospace equipment; submersible repeaters; nuclear reactor control systems; medical equipment or systems for life support (e.g. artificial life support devices or systems), surgical implantations, or healthcare intervention (e.g. excision, etc.), and any other applications or purposes that pose a direct threat to human life. 8. You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges. 9. Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further, Renesas Electronics products are not subject to radiation resistance design. Please be sure to implement safety measures to guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas Electronics product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system manufactured by you. 10. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive. Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations. 11. This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written consent of Renesas Electronics. 12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products, or if you have any other inquiries. (Note 1) Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majorityowned subsidiaries. (Note 2) Renesas Electronics product(s) means any product developed or manufactured by or for Renesas Electronics.
3 Application Note 78K0/Kx2-L Sample Program (Real-Time Counter) Fixed-Interval Interrupts and Alarm Interrupts This document describes an operation overview of the sample program and how to use it, as well as how to set up and use the real-time counter. In the sample program, LEDs (LED1 and LED2) are controlled by using the real-time counter to generate fixed-interval interrupts and alarm interrupts. Target device 78K0/KC2-L microcontroller CONTENTS CHAPTER 1 OVERVIEW... 3 CHAPTER 2 CIRCUIT DIAGRAM Circuit Diagram Used Device Other than Microcontroller... 5 CHAPTER 3 SOFTWARE Included Files Internal Peripheral Functions to Be Used Initial Settings and Operation Overview Flow Charts... 8 CHAPTER 4 SETTING METHODS Setting up Real-Time Counter Software Coding Example Time Adjustment CHAPTER 5 RELATED DOCUMENTS APPENDIX A PROGRAM LIST APPENDIX B USING 78K0/KC2-L 44-PIN PRODUCTS APPENDIX C REVISION HISTORY Document No. U19692EJ1V0AN00 (1st edition) Date Published September 2009 N Printed in Japan 2009
4 The information in this document is current as of May, The information is subject to change without notice. For actual design-in, refer to the latest publications of NEC Electronics data sheets, etc., for the most up-to-date specifications of NEC Electronics products. Not all products and/or types are available in every country. Please check with an NEC Electronics sales representative for availability and additional information. No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may appear in this document. NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from the use of NEC Electronics products listed in this document or any other liability arising from the use of such products. No license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others. Descriptions of circuits, software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples. The incorporation of these circuits, software and information in the design of a customer's equipment shall be done under the full responsibility of the customer. NEC Electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits, software and information. While NEC Electronics endeavors to enhance the quality and safety of NEC Electronics products, customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. In addition, NEC Electronics products are not taken measures to prevent radioactive rays in the product design. When customers use NEC Electronics products with their products, customers shall, on their own responsibility, incorporate sufficient safety measures such as redundancy, fire-containment and anti-failure features to their products in order to avoid risks of the damages to property (including public or social property) or injury (including death) to persons, as the result of defects of NEC Electronics products. NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and "Specific". The "Specific" quality grade applies only to NEC Electronics products developed based on a customerdesignated "quality assurance program" for a specific application. The recommended applications of an NEC Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of each NEC Electronics product before using it in a particular application. "Standard": Computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots. "Special": Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life support). "Specific": Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems and medical equipment for life support, etc. The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to determine NEC Electronics' willingness to support a given application. (Note) (1) "NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its majority-owned subsidiaries. (2) "NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as defined above). M8E0904E 2 Application Note U19692EJ1V0AN
5 CHAPTER 1 OVERVIEW This sample program shows an example of using the real-time counter. In the sample program, LEDs (LED1 and LED2) are controlled by using the real-time counter to generate fixed-interval interrupts and alarm interrupts. (1) Primary initial settings <Option byte settings> Allowing the internal low-speed oscillator to be programmed to stop Disabling the watchdog timer Setting the internal high-speed oscillation clock frequency to 8 MHz Disabling LVI from being started by default <Settings during initialization immediately after a reset ends> Specifying the ROM and RAM sizes Setting up I/O ports Specifying P00 and P01 to be used to control the LEDs (LED1 and LED2) Checking whether VDD is 2.7 V or more by using the low-voltage detector Note 1 Specifying that the CPU clock runs on the internal high-speed oscillation clock (8 MHz) Specifying the XT1 oscillation mode for the subsystem clock pin Stopping the internal low-speed oscillator Disabling peripheral hardware not to be used Setting up the real-time counter Making the system wait until the subsystem clock stabilizes by using 8-bit timer H0 Note 2 (about 1 second) Note 3 Specifying 8:59:50 a.m. as the count start time and 9:00:00 a.m. as the alarm time Setting fixed-interval interrupts (generated at 0.5 second intervals) and alarm interrupts Enabling interrupts Notes 1. For details about the low-voltage detector, refer to the 78K0/Kx2-L User s Manual. 2. For details about 8-bit timer H0, refer to the 78K0/Kx2-L User s Manual. 3. Adjust the oscillation stabilization time for the subsystem clock according to the resonator used. (2) Processing after main loop After specifying the initial settings, control the LEDs (LED1 and LED2) by using the real-time counter to generate fixed-interval interrupts and alarm interrupts. LED1 blinks every second based on interrupts generated at fixed intervals. LED2 turns on 10 seconds after the initial settings have been specified based on the generated alarm interrupt. Application Note U19692EJ1V0AN 3
6 CHAPTER 2 CIRCUIT DIAGRAM This chapter provides a circuit diagram and describes the devices used in this sample program other than the microcontroller. 2.1 Circuit Diagram A circuit diagram is shown below. VDD VDD 0.47 to 1 μf VDD REGC VSS XT2 78K0/Kx2-L microcontroller RESET P01 VDD LED2 VDD khz XT1 P00 LED1 Cautions 1. Use the microcontroller at a voltage in the range of 2.94 V VDD 5.5 V. 2. Connect the AVREF pin directly to VDD. 3. Connect the AVSS pin directly to GND. 4. Connect REGC to VSS via a capacitor (0.47 to 1 μf). 5. Handle unused pins that are not shown in the circuit diagram as follows: I/O ports: Set them to output mode and leave them open (unconnected). Input ports: Connect them independently to VDD or VSS via a resistor. 6. When using the XT1 oscillator, wire as follows in the area enclosed by the broken lines in the above figure to avoid an adverse effect from wiring capacitance. Keep the wiring length as short as possible. Do not cross the wiring with the other signal lines. Do not route the wiring near a signal line through which a high fluctuating current flows. Always make the ground point of the oscillator capacitor the same potential as VSS. Do not ground the capacitor to a ground pattern through which a high current flows. Do not fetch signals from the oscillator. 7. The XT1 oscillator is designed as a low-amplitude circuit for reducing power consumption, and is more prone to malfunction due to noise than the X1 oscillator. Particular care is therefore required with the wiring method when the XT1 clock is used. 8. In this sample program, the P121/X1/TOOLC0 and P122/X2/EXCLK/TOOLD0 pins are used for onchip debugging. Remark For the resonator selection and oscillator constant, customers are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation. 4 Application Note U19692EJ1V0AN
7 CHAPTER 2 CIRCUIT DIAGRAM 2.2 Used Device Other than Microcontroller The following device is used in addition to the microcontroller: (1) LEDs (LED1 and LED2) LEDs receive output signals and support fixed-interval and alarm interrupts. Application Note U19692EJ1V0AN 5
8 CHAPTER 3 SOFTWARE This chapter describes the files included in the compressed file to be downloaded, internal peripheral functions of the microcontroller to be used, and initial settings and provides an operation overview of the sample program and the flow charts. 3.1 Included Files The following table shows the files included in the compressed file to be downloaded. File Name Description Compressed (*.zip) File Included main.asm (Assembly language version) Source file for hardware initialization processing and main processing of microcontroller Note Note main.c (C language version) op.asm Assembler source file for setting the option byte (This file is used for setting up the watchdog timer and internal low-speed oscillator and selecting the internal high-speed oscillation clock frequency.) Kx2-L_RTC.prw Work space file for integrated development environment PM+ Kx2-L_RTC.prj Project file for integrated development environment PM+ Note main.asm is included with the assembly language version, and main.c with the C language version. Remark : Only the source file is included. : The files to be used with integrated development environment PM+ are included. 3.2 Internal Peripheral Functions to Be Used The following internal peripheral functions of the microcontroller are used in this sample program. Real-time counter: Used to generate fixed-interval interrupts and alarm interrupts. P00 and P01: Used to control the LEDs (LED1 and LED2). Low-voltage detector: Checks whether VDD is 2.7 V or more. 8-bit timer H0: Used to make the system wait until the subsystem clock stabilizes. 6 Application Note U19692EJ1V0AN
9 CHAPTER 3 SOFTWARE 3.3 Initial Settings and Operation Overview In this sample program, initial settings including the selection of the clock frequency and setting of the I/O ports, interrupts, and real-time counter are performed. After specifying the initial settings, control the LEDs (LED1 and LED2) by using the real-time counter to generate fixedinterval interrupts and alarm interrupts. LED1 blinks every second based on interrupts generated at fixed intervals. LED2 turns on 10 seconds after the initial settings have been specified based on the generated alarm interrupt. The details are described in the state transition diagram shown below. Initial settings <Option byte settings> Allowing the internal low-speed oscillator to be programmed to stop Disabling the watchdog timer Setting the internal high-speed oscillation clock frequency to 8 MHz Disabling LVI from being started by default <Settings during initialization immediately after a reset ends> Specifying the ROM and RAM sizes Setting up I/O ports Specifying P00 and P01 to be used to control the LEDs (LED1 and LED2) Checking whether VDD is 2.7 V or more by using the low-voltage detector Specifying that the CPU clock runs on the internal high-speed oscillation clock (8 MHz) Specifying the XT1 oscillation mode for the subsystem clock pin Stopping the internal low-speed oscillator Disabling peripheral hardware not to be used Setting up the real-time counter Making the system wait until the subsystem clock stabilizes by using 8-bit timer H0 (about 1 second) Specifying 8:59:50 a.m. as the count start time and 9:00:00 a.m. as the alarm time Setting fixed-interval interrupts (generated at 0.5 second intervals) and alarm interrupts Enabling interrupts Wait for an interrupt. INTRTC interrupt LED1 blinks. No alarm time match Check for an alarm time match. An alarm time match is detected. LED2 turns on. Application Note U19692EJ1V0AN 7
10 CHAPTER 3 SOFTWARE 3.4 Flow Charts The flow charts for the sample program are shown below. <Initialization immediately after a reset ends> Start Disable interrupts. Set up the register bank. Specify the ROM and RAM sizes. Specify the stack pointer. Set up I/O ports. Set the low-voltage detection level of the low-voltage detector (VLVI) to 2.84 ±0.1 V. Enable low-voltage detection. Note 2 The option byte is referenced. Note 1 1 Supply the real-time counter control clock signal. Stop the real-time counter. Set up fixed-interval interrupts (generated at 0.5 second intervals) by using the real-time counter. Specify the real-time counter to start at 8:59:50 a.m. Specify 9:00:00 a.m. as the alarm time for the real-timer counter. Set up the alarm interrupts generated using the real-time counter. Initial settings for the realtime counter No VLVI VDD? Yes Enable the INTRTC interrupt. Start the real-time counter. Note 4 Stop low-voltage detection. Specify that the CPU clock run on the internal high-speed oscillation clock (8 MHz). Initialization immediately after a reset ends Enable interrupts. Enter the STOP mode. Main loop Specify the XT1 oscillation mode for the subsystem clock pin. <INTRTC interrupt servicing> Stop the internal low-speed oscillator. Start Disable peripheral hardware not to be used. Switch the register bank. Specify that 8-bit timer H0 is used to make the system wait until the subsystem clock stabilizes (about 1 second). Toggle LED1. No Start 8-bit timer H0. Has about 1 second elapsed? Note 3 Yes Stop 8-bit timer H0. No Has an alarm time match been detected? Yes Clear the alarm time match detection status flag. Turn on LED2. 1 Return 8 Application Note U19692EJ1V0AN
11 CHAPTER 3 SOFTWARE Notes 1. The option byte is automatically referenced by the microcontroller immediately after a reset ends. In this sample program, the following settings are specified using the option byte: Allowing the internal low-speed oscillator to be programmed to stop Disabling the watchdog timer Setting the internal high-speed oscillation clock frequency to 8 MHz Disabling LVI from being started by default 2. The low-voltage detector is enabled, and then the system is made to wait at least 10 μs until the low-voltage detector stabilizes. 3. Adjust the oscillation stabilization time for the subsystem clock according to the resonator used. 4. If the STOP mode is entered before the real-time counter stabilizes, the real-time counter might be disabled. Therefore, in this sample program, the system is made to wait for two cycles of the subsystem clock (about 62 μs) before starting the real-time counter. Application Note U19692EJ1V0AN 9
12 CHAPTER 4 SETTING METHODS This chapter describes how to set up the real-time counter and adjust the time, and provides a software coding example. For other initial settings, refer to the 78K0/Kx2-L Sample Program (Initial Settings) LED Lighting Switch Control Application Note. For how to set registers, refer to the 78K0/Kx2-L User s Manual. For assembler instructions, refer to the 78K/0 Series Instructions User s Manual. 4.1 Setting up Real-Time Counter The real-time counter is controlled by the following 13 registers: Peripheral enable register 0 (PER0) Real-time counter control register 0 (RTCC0) Real-time counter control register 1 (RTCC1) Second count register (SEC) Minute count register (MIN) Hour count register (HOUR) Day count register (DAY) Week count register (WEEK) Month count register (MONTH) Year count register (YEAR) Alarm minute register (ALARMWM) Alarm hour register (ALARMWH) Alarm week register (ALARMWW) 10 Application Note U19692EJ1V0AN
13 CHAPTER 4 SETTING METHODS [Example of the setup procedure when using fixed-interval interrupts (generated at 0.5 second intervals) and alarm interrupts generated using the real-time counter] (The same procedure is used in the sample program.) <1> Set bit 7 (RTCEN) of PER0 to 1 (to supply the real-time counter control clock signal). Note 1 <2> Clear bit 7 (RTCE) of RTCC0 to 0 (to stop the real-time counter). <3> Use bit 3 (AMPM) of RTCC0 to select between the 12-hour system and 24-hour system. <4> Use bits 2 to 0 (CT2 to CT0) of RTCC0 to select the interval at which to generate a fixed-interval interrupt (INTRTC). <5> Specify the count start time for SEC, MIN, HOUR, WEEK, DAY, MONTH, and YEAR. <6> Clear bit 7 (WALE) of RTCC1 to 0 (to disable alarm time matching). <7> Set bit 6 (WALIE) of RTCC1 to 1 (to generate an interrupt upon an alarm time match). <8> Specify the alarm time for ALARMWM, ALARMWH, and ALARMWW. <9> Set bit 7 (WALE) of RTCC1 to 1 (to enable alarm time matching). <10> Clear the INTRTC interrupt request (RTCIF = 0). <11> Enable the INTRTC interrupt (RTCMK = 0). <12> Set bit 7 (RTCE) of RTCC0 to 1 (to enable the real-time counter). Note 2 Notes 1. Set RTCEN to 1 while the subsystem clock (fsub) is stable. 2. When entering the STOP mode immediately after setting RTCE to 1, first wait for two cycles of the subsystem clock (fsub) (about 62 μs) or more. Remarks 1. ALARMWM, ALARMWH, and ALARMWW may be written in any order. 2. Fixed-interval interrupts and alarm match interrupts use the same interrupt source (INTRTC). When using these two types of interrupts at the same time, which interrupt occurred can be judged by checking the fixed-interval interrupt status flag (RIFG) and the alarm detection status flag (WAFG) upon INTRTC occurrence. Application Note U19692EJ1V0AN 11
14 CHAPTER 4 SETTING METHODS (1) Peripheral enable register 0 (PER0) This register controls the supply of the real-time counter control clock. Figure 4-1. Format of Peripheral Enable Register 0 (PER0) RTCEN RTCEN Control of real-time counter (RTC) control clock Note 0 Stops supply of control clock. SFR used by the real-time counter cannot be written (can be read). Operation of the real-time counter continues. 1 Supplies control clock. SFR used by the real-time counter can be read and written. Note The control clock supply stopped by clearing RTCEN to 0 is the clock to be used when write-accessing the registers (such as the RTCC0 register) to be used for the real-time counter (RTC) from the CPU. The RTC operating clock (fsub) does not stop, even if RTCEN is cleared to 0. Caution Be sure to clear bits 6 to 0 to 0. Remark The values written in red in the above figure are specified in this sample program. 12 Application Note U19692EJ1V0AN
15 CHAPTER 4 SETTING METHODS (2) Real-time counter control register 0 (RTCC0) The RTCC0 register is an 8-bit register that is used to start or stop the real-time counter operation, control the RTCCL and RTC1HZ pins, and set a 12- or 24-hour system and the fixed-interval interrupt function. Figure 4-2. Format of Real-Time Counter Control Register 0 (RTCC0) RTCE 0 RCLOE1 RCLOE0 AMPM CT2 CT1 CT0 CT2 CT1 CT0 Fixed-interval interrupt (INTRTC) selection Does not use fixed-interval interrupt function Once per 0.5 s (synchronized with second count up) Once per 1 s (same time as second count up) Once per 1 m (second 00 of every minute) Once per 1 hour (minute 00 and second 00 of every hour) Once per 1 day (hour 00, minute 00, and second 00 of every day) 1 1 x Once per 1 month (Day 1, hour 00 a.m., minute 00, and second 00 of every month) AMPM Selection of 12-/24-hour system 0 12-hour system (a.m. and p.m. are displayed.) 1 24-hour system RCLOE0 Note RTCCL pin output control 0 Disables output of RTCCL pin ( khz). 1 Enables output of RTCCL pin ( khz). RCLOE1 RTC1HZ pin output control 0 Disables output of RTC1HZ pin (1 Hz). 1 Enables output of RTC1HZ pin (1 Hz). RTCE Real-time counter operation control 0 Stops counter operation. 1 Starts counter operation. Note RCLOE0 and RCLOE2 of real-time counter control register 2 (RTCC2) must not be enabled at the same time. Cautions 1. To change the value of AMPM, set RWAIT (bit 0 of RTCC1) to 1, and re-set the hour count register (HOUR). 2. After changing the values of CT2 to CT0, clear the interrupt request flag. 3. Be sure to clear bit 6 to 0. Remarks 1. x: don t care 2. The values written in red in the above figure are specified in this sample program. Application Note U19692EJ1V0AN 13
16 CHAPTER 4 SETTING METHODS (3) Real-time counter control register 1 (RTCC1) The RTCC1 register is an 8-bit register that is used to control the alarm interrupt function and the wait time of the counter. Figure 4-3. Format of Real-Time Counter Control Register 1 (RTCC1) WALE WALIE 0 WAFG RIFG 0 RWST RWAIT RWAIT Wait control of real-time counter 0 Sets counter operation. 1 Stops SEC to YEAR counters. Mode to read or write counter value RWST Wait status flag of real-time counter 0 Counter is operating. 1 Mode to read or write counter value RIFG Fixed-interval interrupt status flag 0 Fixed-interval interrupt is not generated. 1 Fixed-interval interrupt is generated. WAFG Alarm detection status flag 0 Alarm mismatch 1 Detection of matching of alarm WALIE Control of alarm interrupt (INTRTC) function operation 0 Does not generate interrupt on matching of alarm. 1 Generates interrupt on matching of alarm. WALE Alarm operation control 0 Match operation is invalid. 1 Match operation is valid. 14 Application Note U19692EJ1V0AN
17 CHAPTER 4 SETTING METHODS Cautions 1. To set the registers of alarm (WALIE flag of RTCC1, ALARMWM register, ALARMWH register, and ALARMWW register), disable WALE (clear it to 0 ). 2. WAFG is a status flag that indicates detection of matching with the alarm. It is valid only when WALE = 1 and is set to 1 one clock ( khz) after matching of the alarm is detected. This flag is cleared when 0 is written to it. Writing 1 to it is invalid. 3. RIFG indicates the status of generation of the fixed-interval interrupt. When the fixed-interval interrupt is generated, it is set to 1. This flag is cleared when 0 is written to it. Writing 1 to it is invalid. 4. RWST indicates the status whether the setting of RWAIT is valid. Before reading or writing the counter value, confirm that the value of this flag is WALE controls the operation of the counter. Be sure to write 1 to it to read or write the counter value. Because RSUBC continues operation, complete reading or writing of it in 1 second, and clear this bit back to 0. When RWAIT = 1, it takes up to 1 clock ( khz) until the counter value can be read or written. If RSUBC overflows when RWAIT = 1, it counts up after RWAIT = 0. If the second count register is written, however, it does not count up because RSUBC is cleared. 6. If writing is performed to the RTCC1 register with a 1-bit manipulation instruction, the RIFG flag and WAFG flag may be cleared. Therefore, to perform writing to the RTCC1 register, be sure to use an 8-bit manipulation instruction. To prevent the RIFG flag and WAFG flag from being cleared during writing, disable writing by setting 1 to the corresponding bit. If the RIFG flag and WAFG flag are not used and the value may be changed, the RTCC1 register may be written by using a 1- bit manipulation instruction. 7. Be sure to clear bits 5 and 2 to 0. Remarks 1. Fixed-interval interrupts and alarm match interrupts use the same interrupt source (INTRTC). When using these two types of interrupts at the same time, which interrupt occurred can be judged by checking the fixed-interval interrupt status flag (RIFG) and the alarm detection status flag (WAFG) upon INTRTC occurrence. 2. The values written in red in the above figure are specified in this sample program. Application Note U19692EJ1V0AN 15
18 CHAPTER 4 SETTING METHODS (4) Second count register (SEC) The SEC register is an 8-bit register that takes a value of 0 to 59 (decimal) and indicates the count value of seconds. It counts up when the sub-count register (RSUBC) Note that counts 1 second with a clock of khz overflows. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks ( khz) later. Set a decimal value of 00 to 59 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. Figure 4-4. Format of Second Count Register (SEC) 0 SEC40 SEC20 SEC10 SEC8 SEC4 SEC2 SEC1 Note For details about the sub-count register (RSUBC), refer to the 78K0/Kx2-L User s Manual. Remark In this sample program, 50H is specified as the initial value. (5) Minute count register (MIN) The MIN register is an 8-bit register that takes a value of 0 to 59 (decimal) and indicates the count value of minutes. It counts up when the second counter overflows. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks ( khz) later. Set a decimal value of 00 to 59 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. Figure 4-5. Format of Minute Count Register (MIN) 0 MIN40 MIN20 MIN10 MIN8 MIN4 MIN2 MIN1 Remark In this sample program, 59H is specified as the initial value. 16 Application Note U19692EJ1V0AN
19 CHAPTER 4 SETTING METHODS (6) Hour count register (HOUR) The HOUR register is an 8-bit register that takes a value of 00 to 23 or 01 to 12, 21 to 32 (decimal) and indicates the count value of hours. It counts up when the minute counter overflows. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks ( khz) later. Set a decimal value of 00 to 23, 01 to 12, or 21 to 32 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. Figure 4-6. Format of Hour Count Register (HOUR) 0 0 HOUR20 HOUR10 HOUR8 HOUR4 HOUR2 HOUR1 Caution Bit 5 (HOUR20) of HOUR indicates AM(0)/PM(1) if AMPM = 0 (if the 12-hour system is selected). The details are shown in the table below. 24-Hour Display (AMPM Bit = 1) 12-Hour Display (AMPM Bit = 0) Time HOUR Register Time HOUR Register 0 00H 0 a.m. 12H 1 01H 1 a.m. 01H 2 02H 2 a.m. 02H 3 03H 3 a.m. 03H 4 04H 4 a.m. 04H 5 05H 5 a.m. 05H 6 06H 6 a.m. 06H 7 07H 7 a.m. 07H 8 08H 8 a.m. 08H 9 09H 9 a.m. 09H 10 10H 10 a.m. 10H 11 11H 11 a.m. 11H 12 12H 0 p.m. 32H 13 13H 1 p.m. 21H 14 14H 2 p.m. 22H 15 15H 3 p.m. 23H 16 16H 4 p.m. 24H 17 17H 5 p.m. 25H 18 18H 6 p.m. 26H 19 19H 7 p.m. 27H 20 20H 8 p.m. 28H 21 21H 9 p.m. 29H 22 22H 10 p.m. 30H 23 23H 11 p.m. 31H Remark In this sample program, 08H is specified as the initial value. Application Note U19692EJ1V0AN 17
20 CHAPTER 4 SETTING METHODS (7) Day count register (DAY) The DAY register is an 8-bit register that takes a value of 1 to 31 (decimal) and indicates the count value of days. It counts up when the hour counter overflows. This counter counts as follows: 01 to 31 (January, March, May, July, August, October, December) 01 to 30 (April, June, September, November) 01 to 29 (February, leap year) 01 to 28 (February, normal year) When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks ( khz) later. Set a decimal value of 01 to 31 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. Figure 4-7. Format of Day Count Register (DAY) 0 0 DAY20 DAY10 DAY8 DAY4 DAY2 DAY1 Remark In this sample program, 01H is specified as the initial value. (8) Week count register (WEEK) The WEEK register is an 8-bit register that takes a value of 0 to 6 (decimal) and indicates the count value of weekdays. It counts up in synchronization with the day counter. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks ( khz) later. Set a decimal value of 00 to 06 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. Figure 4-8. Format of Week Count Register (WEEK) WEEK4 WEEK2 WEEK1 Caution Values corresponding to the month count register and day count register are not automatically stored to the week count register. Set the week count register as follows, after reset release: Day Sunday Monday Tuesday Wednesday Thursday Friday Saturday WEEK Register 00H 01H 02H 03H 04H 05H 06H Remark In this sample program, 06H is specified as the initial value. 18 Application Note U19692EJ1V0AN
21 CHAPTER 4 SETTING METHODS (9) Month count register (MONTH) The MONTH register is an 8-bit register that takes a value of 1 to 12 (decimal) and indicates the count value of months. It counts up when the day counter overflows. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks ( khz) later. Set a decimal value of 01 to 12 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. Figure 4-9. Format of Month Count Register (MONTH) MONTH10 MONTH8 MONTH4 MONTH2 MONTH1 Remark In this sample program, 01H is specified as the initial value. (10) Year count register (YEAR) The YEAR register is an 8-bit register that takes a value of 0 to 99 (decimal) and indicates the count value of years. It counts up when the month counter overflows. Values 00, 04, 08,, 92, and 96 indicate a leap year. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks ( khz) later. Set a decimal value of 00 to 99 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. Figure Format of Year Count Register (YEAR) YEAR80 YEAR40 YEAR20 YEAR10 YEAR8 YEAR4 YEAR2 YEAR1 Remark In this sample program, 00H is specified as the initial value. (11) Alarm minute register (ALARMWM) This register is used to set minutes of alarm. Figure Format of Alarm Minute Register (ALARMWM) 0 WM40 WM20 WM10 WM8 WM4 WM2 WM1 Caution Set a decimal value of 00 to 59 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. Remark In this sample program, 00H is specified as the initial value. Application Note U19692EJ1V0AN 19
22 CHAPTER 4 SETTING METHODS (12) Alarm hour register (ALARMWH) This register is used to set hours of alarm. Figure Format of Alarm Hour Register (ALARMWH) 0 0 WH20 WH10 WH8 WH4 WH2 WH1 Cautions 1. Set a decimal value of 00 to 23, 01 to 12, or 21 to 32 to this register in BCD code. If a value outside the range is specified, the value is incremented and the counter returns to 00H when an overflow occurs. 2. Bit 5 (WH20) of ALARMWH indicates AM(0)/PM(1) if AMPM = 0 (if the 12-hour system is selected). Remark In this sample program, 09H is specified as the initial value. (13) Alarm week register (ALARMWW) This register is used to set date of alarm. Figure Format of Alarm Week Register (ALARMWW) 0 WW6 WW5 WW4 WW3 WW2 WW1 WW0 Remarks 1. Here is an example of setting the alarm. Time of Alarm Day 12-Hour Display 24-Hour Display Sunday WW0 Monday WW1 Tuesday Wednesday Thursday Friday Saturday WW2 WW3 WW4 WW5 WW6 Hour 10 Hour 1 Minute 10 Minute 1 Hour 10 Hour 1 Minute 10 Minute 1 Every day, 0:00 a.m Every day, 1:30 a.m Every day, 11:59 a.m Monday through Friday, 0:00 p.m Sunday, 1:30 p.m Monday, Wednesday, Friday, 11:59 p.m In this sample program, 7FH is specified as the initial value. 20 Application Note U19692EJ1V0AN
23 CHAPTER 4 SETTING METHODS 4.2 Software Coding Example The settings specified for the real-time counter in the sample program are shown below as a software coding example. (1) Assembly language XMAIN CSEG UNIT RESET_START: Specify supplying the real-time...(omitted)... counter control clock signal....(omitted)......(omitted)... MOV PER0, # B CLR1 RTCE MOV RTCC0, # B Stop the real-time counter. Specify 8:59:50 a.m. as the count start time. MOV SEC, #50H ; seconds: 50 MOV MIN, #59H ; minutes: 59 MOV HOUR, #08H ; hours: 08 MOV WEEK, #06H ; day of the week: Saturday MOV DAY, #01H ; day: 01 MOV MONTH, #01H ; month: 01 MOV YEAR, #00H ; year: 00...(Omitted)... Disable alarm Set up the alarm time matching. interrupt. CLR1 WALE ; Disable matching SET1 WALIE ; Generate an interrupt upon an alarm time match...(omitted)... Specify 9:00:00 a.m. as the alarm time. MOV ALARMWM,#00H ; minutes: 00 MOV ALARMWH,#09H ; hours: 09 MOV ALARMWW,# B ; day of the week: all days Select the 12-hour system and specify an interrupt (INTRTC) to be generated at 0.5 second intervals. Enable alarm time matching. SET1 WALE ; Enable alarm time matching Clear the INTRTC interrupt request. CLR1 RTCIF ; Clear the INTRTC interrupt request CLR1 RTCMK ; Enable the INTRTC interrupt Enable the SET1 RTCE ; Start the real-time counter INTRTC interrupt Start the real-time counter. Application Note U19692EJ1V0AN 21
24 CHAPTER 4 SETTING METHODS (2) C language void hdwinit(void) { Specify supplying the real-time counter control clock signal....(omitted)... Stop the real-time counter....(omitted)... PER0 = 0b ; Select the 12-hour system and specify an interrupt (INTRTC) to be generated at 0.5 second intervals. RTCE = 0; /* Stop the real-time counter */ RTCC0 = 0b ;...(Omitted)... Specify 8:59:50 a.m. as the count start time. SEC = 0x50; /* seconds: 50 */ MIN = 0x59; /* minutes: 59 */ HOUR = 0x08; /* hours: 08 */ WEEK = 0x06; /* day of the week: Saturday */ DAY = 0x01; /* day: 01 */ MONTH = 0x01; /* month: 01 */ YEAR = 0x00; /* year: 00 */...(Omitted)... Disable alarm time matching. WALE = 0; /* Disable matching */ WALIE = 1; /* Generate an interrupt upon an alarm time match */ Set up the alarm interrupt....(omitted)... Specify 9:00:00 a.m. as the alarm time. ALARMWM = 0x00; /* minutes: 00 */ ALARMWH = 0x09; /* hours: 09 */ Enable ALARMWW = 0b ; /* day of the week: all days */ alarm time matching. WALE = 1; Clear the INTRTC /* Enable alarm time matching */ RTCIF = 0; interrupt request. /* Clear the INTRTC interrupt request */ RTCMK = 0; Enable the /* Enable the INTRTC interrupt */ RTCE = 1; INTRTC interrupt. /* Start the real-time counter */ Start the real-time counter. 22 Application Note U19692EJ1V0AN
25 CHAPTER 4 SETTING METHODS 4.3 Time Adjustment This section describes how to adjust the time for the real-time counter. (1) Watch error correction register (SUBCUD) Use the watch error correction register (SUBCUD) to adjust the time for the real-time counter. This register is used to correct the watch with high accuracy when it is slow or fast by changing the value that overflows from the subcount register (RSUBC) to the second count register (reference value: 7FFFH). Figure Format of Watch Error Correction Register (SUBCUD) DEV F6 F5 F4 F3 F2 F1 F0 F6 Setting of watch error correction value 0 Increases by {(F5, F4, F3, F2, F1, F0) 1} 2 1 Decreases by {(/F5, /F4, /F3, /F2, /F1, /F0) + 1} 2 Note DEV 0 1 Setting of watch error correction timing Corrects watch error when the second digits are at 00, 20, or 40 (every 20 seconds). Corrects watch error only when the second digits are at 00 (every 60 seconds). Note /F5 to /F0 are the inverted values of the corresponding bits ( when ). Cautions 1. When (F6, F5, F4, F3, F2, F1, F0) = (*, 0, 0, 0, 0, 0, *), the watch error is not corrected. (* is 0 or 1.) Range of correction value: (When F6 = 0) 2, 4, 6, 8,, 120, 122, 124 (When F6 = 1) 2, 4, 6, 8,, 120, 122, The range of value that can be corrected by using the watch error correction register (SUBCUD) is shown below. DEV = 0 (Correction Every 20 Seconds) DEV = 1 (Correction Every 60 Seconds) Correctable range ppm to ppm 63.1 ppm to 63.1 ppm Maximum quantization error ±1.53 ppm ±0.51 ppm Minimum resolution ±3.05 ppm ±1.02 ppm 3. When adjusting the time, the correction values to set to F6 to F0 (2, 4, 6,, 124, or 2, 4, 6,, 124) can be calculated using the following equation: (If DEV is 0) Correction value = number of correction counts per minute 3 = (oscillation frequency target frequency 1) 32, (If DEV is 1) Correction value = number of correction counts per minute = (oscillation frequency target frequency 1) 32, Oscillation frequency: Subsystem clock (fsub) value Target frequency: The frequency corrected using the watch error correction register Remark If a correctable range is 63.1 ppm or lower and 63.1 ppm or higher, set 0 to DEV. Application Note U19692EJ1V0AN 23
26 CHAPTER 4 SETTING METHODS (2) Example of adjusting the time An example of adjusting the time for the real-time counter is shown below. [Example of adjusting the time if the oscillation frequency is 32,772.3 Hz (32,768 Hz ppm)] <1> Use the RTCCL pin or RTC1HZ pin Note 1 to output the oscillation frequency (32,772.3 Hz) to outside the microcontroller. <2> Measure the output oscillation frequency outside the microcontroller by using a measuring instrument and calculate the correction value based on the difference with the target frequency (32,768 Hz). Note 2 <3> Receive the correction values via a serial interface and set these values to the watch error correction register (SUBCUD). Note 3 Notes 1. For how to set the output of the RTC1HZ and RTCCL pins, refer to the 78K0/Kx2-L User s Manual. 2. In this case, the time must be adjusted every 20 seconds. Therefore, the equation for calculating the correction value is as follows: Correction value = number of correction counts per minute 3 = (number of counts per minute at the oscillation frequency number of counts per minute at the target frequency) 3 = (oscillation frequency target frequency 32, ,768 60) 3 = (oscillation frequency target frequency 1) 32, = (32, ,768 1) 32, = Set the following values to the watch error correction register (SUBCUD): Bit 7 (DEV) Clear DEV to 0 because the time must be adjusted every 20 seconds. Bits 6 to 0 (F6 to F0) If the correction value is 0 or more (when delaying the time), clear F6 to 0. Calculate F5, F4, F3, F2, F1, and F0 based on the correction value. {(F5, 4, F3, F2, F1, F0) 1} 2 = 86 (F5, F4, F3, F2, F1, F0) = 44 (F5, F4, F3, F2, F1, F0) = (1, 0, 1, 1, 0, 0) 24 Application Note U19692EJ1V0AN
27 CHAPTER 5 RELATED DOCUMENTS The related documents indicated in this publication may include preliminary versions. However, preliminary versions are not marked as such. Document Name English 78K0/Kx2-L User s Manual PDF 78K/0 Series Instructions User s Manual PDF RA78K0 Assembler Package User s Manual CC78K0 C Compiler User s Manual PM+ Project Manager User s Manual Language Operation Language Operation PDF PDF PDF PDF PDF 78K0/Kx2-L Application Note Sample Program (Initial Settings) LED Lighting Switch Control PDF Application Note U19692EJ1V0AN 25
28 APPENDIX A PROGRAM LIST As a program list example, the 78K0/KC2-L microcontroller source program is shown below. main.asm (assembly language version) ;******************************************************************************* ; ; NEC Electronics 78K0/KC2-L Series ; ;******************************************************************************* ; 78K0/KC2-L Series Sample Program (Real-Time Counter) ;******************************************************************************* ; Fixed-Interval Interrupts and Alarm Interrupts ;******************************************************************************* ;<<History>> ; Release ;******************************************************************************* ; ;<<Overview>> ; ; This sample program presents an example of using the real-time counter. In the ; sample program, LEDs (LED1 and LED2) are controlled by using the real-time counter ; to generate fixed-interval interrupts and alarm interrupts. ; ; ; <Primary initial settings> ; ; (Option byte settings) ; - Allowing the internal low-speed oscillator to be programmed to stop ; - Disabling the watchdog timer ; - Setting the internal high-speed oscillation clock frequency to 8 MHz ; - Disabling LVI from being started by default ; (Settings during initialization immediately after a reset ends) ; - Specifying the ROM and RAM sizes ; - Setting up I/O ports ; Specifying P00 and P01 to be used to control the LEDs (LED1 and LED2) ; - Checking whether VDD is 2.7 V or more by using the low-voltage detector ; - Specifying that the CPU clock runs on the internal high-speed oscillation clock (8 MHz) ; - Specifying the XT1 oscillation mode for the subsystem clock pin ; - Stopping the internal low-speed oscillator ; - Disabling peripheral hardware not to be used ; - Setting up the real-time counter ; Making the system wait until the subsystem clock stabilizes by using 8-bit timer H0 (about 1 second) ; Specifying 8:59:50 a.m. as the count start time and 9:00:00 a.m. as the alarm time ; Setting fixed-interval interrupts (generated at 0.5 second intervals) and alarm 26 Application Note U19692EJ1V0AN
29 APPENDIX A PROGRAM LIST interrupts ; - Enabling interrupts ; ; ; <LED control timing> ; ; ; LED LED control timing ; ; LED1 (P00) Blink every second. ; LED2 (P01) Turn on at the alarm time. ; ; * The LEDs turn off if 1 is output from the ports and turn on if 0 is output from the ports. ; ; ; <I/O port settings> ; Output: P00, P01 ; * Set all unused ports that can be specified as output ports as output ports. ; ;******************************************************************************* ;=============================================================================== ; ; Vector table ; ;=============================================================================== XVECT1 CSEG AT 0000H DW RESET_START ;0000H RESET input, POC, LVI, WDT XVECT2 CSEG AT 0004H DW IINIT ;0004H INTLVI DW IINIT ;0006H INTP0 DW IINIT ;0008H INTP1 DW IINIT ;000AH INTP2 DW IINIT ;000CH INTP3 DW IINIT ;000EH INTP4 DW IINIT ;0010H INTP5 DW IINIT ;0012H INTSRE6 DW IINIT ;0014H INTSR6 DW IINIT ;0016H INTST6 DW IINIT ;0018H INTCSI10 DW IINIT ;001AH INTTMH1 DW IINIT ;001CH INTTMH0 DW IINIT ;001EH INTTM50 DW IINIT ;0020H INTTM000 DW IINIT ;0022H INTTM010 DW IINIT ;0024H INTAD Application Note U19692EJ1V0AN 27
30 APPENDIX A PROGRAM LIST DW IINIT ;0026H INTP6 DW IINIT ;0028H INTRTCI DW IINIT ;002AH INTTM51 DW IINIT ;002CH INTKR DW IINIT ;002EH INTRTC DW IINIT ;0030H INTP7 DW IINIT ;0032H INTP8 DW IINIT ;0034H INTIICA0 DW IINIT ;0036H INTCSI11 DW IINIT ;0038H INTP9 DW IINIT ;003AH INTP10 DW IINIT ;003CH INTP11 DW IINIT ;003EH BRK ;=============================================================================== ; ; Define the memory stack area ; ;=============================================================================== DSTK DSEG IHRAM STACKEND: DS 20H ; Memory stack area = 32 bytes STACKTOP: ; Start address of the memory stack area ;******************************************************************************* ; ; Servicing interrupts by using unnecessary interrupt sources ; ;******************************************************************************* XMAIN CSEG UNIT IINIT: ; If an unnecessary interrupt occurred, the processing branches to this line. ; The processing then returns to the initial original processing because no processing is performed here. RETI ;******************************************************************************* ; ; Initialization after RESET ; ;******************************************************************************* RESET_START: ; Disable interrupts 28 Application Note U19692EJ1V0AN
31 APPENDIX A PROGRAM LIST DI ; Disable interrupts ; Set up the register bank SEL RB0 ; Set up the register bank ; Specify the ROM and RAM sizes ; Note that the values to specify vary depending on the model. ; Enable the settings for the model to use. (The upd78f0588 is the default model.) ; Setting when using upd78f0581 or upd78f0586 ;MOV IMS, #042H ; Specify the ROM and RAM sizes ; Setting when using upd78f0582 or upd78f0587 ;MOV IMS, #004H ; Specify the ROM and RAM sizes ; Setting when using upd78f0583 or upd78f0588 MOV IMS, #0C8H ; Specify the ROM and RAM sizes ; Initialize the stack pointer MOVW SP, #STACKTOP ; Initialize the stack pointer ; Initialize port 0 MOV P0, # B ; Set the P00 and P01 output latches to high level ; Set the P02 output latch to low level MOV PM0, # B ; Specify P00 to P02 as output ports ; P00: Used to control LED1 ; P01: Used to control LED2 ; P02: Unused ; Initialize port 1 MOV ADPC1, # B ; Specify P10 to P12 as digital I/O ports MOV P1, # B ; Set the P10 to P17 output latches to low level MOV PM1, # B ; Specify P10 to P17 as output ports ; P10 to P17: Unused ; Initialize port 2 Application Note U19692EJ1V0AN 29
32 APPENDIX A PROGRAM LIST MOV ADPC0, # B ; Specify P20 to P27 as digital I/O ports MOV P2, # B ; Set the P20 to P27 output latches to low level MOV PM2, # B ; Specify P20 to P27 as output ports ; P20 to P27: Unused ; Initialize port 3 MOV P3, # B ; Set the P30 to P33 output latches to low level MOV PM3, # B ; Specify P30 to P33 as output ports ; P30 to P33: Unused ; Initialize port 4 MOV P4, # B ; Set the P40 to P42 output latches to low level MOV PM4, # B ; Specify P40 to P42 as output ports ; P40 to P42: Unused ; Initialize port 6 MOV P6, # B ; Set the P60 to P63 output latches to low level MOV PM6, # B ; Specify P60 to P63 as output ports ; P60 to P63: Unused ; Initialize port 7 MOV P7, # B ; Set the P70 to P75 output latches to low level MOV PM7, # B ; Specify P70 to P75 as output ports ; P70 to P75: Unused ; Initialize port 12 MOV P12, # B ; Set the P120 output latch to low level MOV PM12, # B ; Specify P120 as an output port ; P120 to P125: Unused ; Low-voltage detection ; The low-voltage detector is used to check whether VDD is 2.7 V or more. ; Set up the low-voltage detector SET1 LVIMK ; Disable the INTLVI interrupt CLR1 LVISEL ; Specify VDD as the detection voltage 30 Application Note U19692EJ1V0AN
33 APPENDIX A PROGRAM LIST MOV LVIS, # B ; Set the low-voltage detection level (VLVI) to 2.84 ±0.1 V CLR1 LVIMD ; Specify that an interrupt signal is generated when a low voltage is detected SET1 LVION ; Enable low-voltage detection ; Make the system wait until the low-voltage detector stabilizes (10 us or more) MOV B, #5 ; Specify the number of counts HINI100: NOP DBNZ B, $HINI100 ; Has the wait period ended? No, ; Make the system wait until VLVI is less than or equal to VDD HINI110: NOP BT LVIF, $HINI110 ; VDD < VLVI? Yes, CLR1 LVION ; Stop the low-voltage detector ; Specify the clock frequency ; Specify the clock frequency so that the device can run on the internal high-speed oscillation clock. ; The XT1 oscillation mode is specified for the subsystem clock pin. MOV OSCCTL,# B ; Clock operation mode ; Be sure to clear this bit to 0 ; RSWOSC/AMPHXT ; [XT1 oscillator oscillation mode selection] ; 00: Low power consumption oscillation ; 01: Normal oscillation ; 1x: Ultra-low power consumption oscillation ; EXCLKS/OSCSELS ; [Subsystem clock pin operation setting] ; (P123/XT1,P124/XT2/EXCLKS) ; Specify the use of the pin in XT1 oscillation mode by specifying 001 by also using XTSTART ; EXCLK/OSCSEL ; [High-speed system clock pin operation setting] ; (P121/X1,P122/X2/EXCLK) ; 00: Input port ; 01: X1 oscillation mode ; 10: Input port ; 11: External clock input mode MOV PCC, # B ; Select the CPU clock (fcpu) ; CSS/PCC2/PCC1/PCC0 ; [CPU clock (fcpu) selection] Application Note U19692EJ1V0AN 31
34 APPENDIX A PROGRAM LIST ; 0000:fXP ; 0001:fXP/2 ; 0010:fXP/2^2 ; 0011:fXP/2^3 ; 0100:fXP/2^4 ; 1000:fSUB/2 ; 1001:fSUB/2 ; 1010:fSUB/2 ; 1011:fSUB/2 ; 1100:fSUB/2 ; (Other than the above: Setting prohibited) ; Be sure to clear this bit to 0 ; CLS ; [CPU clock status] ; XTSTART ; [Subsystem clock pin operation setting] ; Specify the use of the pin by also using EXCLKS and OSCSELS ; Be sure to clear this bit to 0 MOV RCM, # B ; Select the operating mode of the internal oscillator ; RSTOP ; [Internal high-speed oscillator oscillating/stopped] ; 0: Internal high-speed oscillator oscillating ; 1: Internal high-speed oscillator stopped ; LSRSTOP ; [Internal low-speed oscillator oscillating/stopped] ; 0: Internal low-speed oscillator oscillating ; 1: Internal low-speed oscillator stopped ; Be sure to clear this bit to 0 ; RSTS ; [Status of internal high-speed oscillator] MOV MOC, # B ; Select the operating mode of the high-speed system clock ; Be sure to clear this bit to 0 ; MSTOP ; [Control of high-speed system clock operation] ; 0: X1 oscillator operating/external clock from ; EXCLK pin is enabled ; 1: X1 oscillator stopped/external clock from ; EXCLK pin is disabled MOV MCM, # B ; Select the clock to supply ; XSEL/MCM0 ; [Clock supplied to main system and ; peripheral hardware] ; 00: Main system clock (fxp) 32 Application Note U19692EJ1V0AN
35 APPENDIX A PROGRAM LIST ; = internal high-speed oscillation clock (fih) ; Peripheral hardware clock (fprs) ; = internal high-speed oscillation clock (fih) ; 01: Main system clock (fxp) ; = internal high-speed oscillation clock (fih) ; Peripheral hardware clock (fprs) ; = internal high-speed oscillation clock (fih) ; 10: Main system clock (fxp) ; = internal high-speed oscillation clock (fih) ; Peripheral hardware clock (fprs) ; = high-speed system clock (fih) ; 11: Main system clock (fxp) ; = high-speed system clock (fih) ; Peripheral hardware clock (fprs) ; = high-speed system clock (fih) ; MCS ; [Main system clock status] ; Be sure to clear this bit to 0 ; Disable peripheral hardware not to be used ; 16-bit timer/event counter 00 MOV TMC00, # B ; Disable the counter ; 8-bit timer/event counters 50 and 51 MOV TMC50, # B ; Disable timer 50 MOV TMC51, # B ; Disable timer 51 ; 8-bit timer H1 MOV TMHMD1, # B ; Stop the timer ; Clock output controller MOV CKS, # B ; Stop the clock frequency divider ; A/D converter MOV ADM0, # B ; Stop A/D conversion ; Operational amplifiers MOV AMP0M, # B ; Stop operational amplifier 0 MOV AMP1M, # B ; Stop operational amplifier 1 ; Serial interface UART6 MOV ASIM6, # B ; Disable the interface ; Serial interface IICA MOV IICACTL0,# B ; Disable the interface Application Note U19692EJ1V0AN 33
36 APPENDIX A PROGRAM LIST ; Serial interfaces CSI10 and CSI11 MOV CSIM10, # B ; Disable CSI10 MOV CSIM11, # B ; Disable CSI11 ; Interrupts (The interrupts to be used are enabled later) MOVW MK0, #0FFFFH ; Disable all interrupts MOVW MK1, #0FFFFH ; MOV EGPCTL0,# B ; Disable the detection of all external interrupts MOV EGPCTL1,# B ; ; Key interrupts MOV KRM, # B ; Disable all key interrupts ; Set up the real-time counter ; - Making the system wait until the subsystem clock stabilizes by using 8-bit timer H0 (about 1 second) ; - Specifying 8:59:50 a.m. as the count start time and 9:00:00 a.m. as the alarm time ; - Setting fixed-interval interrupts (generated at 0.5 second intervals) and alarm interrupts ; Make the system wait until the subsystem clock stabilizes by using 8-bit timer H0 (about 1 second) MOV TMHMD0, # B ; Count clock: fprs/2^10 MOV CMP00, #(245-1) ; Interval time: ms (= 245 / fprs/2^10) MOV B, #32 ; Oscillation stabilization time: About 1 second (= ms * 32) CLR1 TMIFH0 ; Clear the INTTMH0 interrupt request SET1 TMMKH0 ; Disable the INTTMH0 interrupt SET1 TMHE0 ; Start 8-bit timer H0 HINI200: NOP BF TMIFH0, $HINI200 ; Has an INTTMH0 interrupt request been issued? No, CLR1 TMIFH0 ; Clear the INTTMH0 interrupt request DBNZ B, $HINI200 ; Has the oscillation stabilization time elapsed? No, CLR1 TMHE0 ; Stop 8-bit timer H0 ; Control of real-time counter control clock MOV PER0, # B ; Be sure to clear this bit to 0 ; RTCEN ; [Real-time counter control clock] ; 0: Stop supply of control clock ; 1: Supply control clock ; Real-time counter operation setting 34 Application Note U19692EJ1V0AN
37 APPENDIX A PROGRAM LIST CLR1 RTCE ; Stop real-time counter operation MOV RTCC0, # B ; CT2/CT1/CT0 ; [Fixed-interval interrupt (INTRTC) selection] ; 000: Does not use fixed-interval interrupt function ; 001: Once per 0.5 s (synchronized with second count up) ; 010: Once per 1 s (same time as second count up) ; 011: Once per 1 m (second 00 of every minute) ; 100: Once per 1 hour (minute 00 and second 00 of every hour) ; 101: Once per 1 day (hour 00, minute 00, and second 00 of every day) ; 11x: Once per 1 month (Day 1, hour 00 a.m., minute 00, and second 00 of every month) ; AMPM ; [Selection of 12-/24-hour system] ; 0: 12-hour system (a.m. and p.m. are displayed) ; 1: 24-hour system ; RCLOE0 ; [RTCCL pin output control] ; 0: Disable output of RTCCL pin ( khz) ; 1: Enable output of RTCCL pin ( khz) ; RCLOE1 ; [RTC1HZ pin output control] ; 0: Disable output of RTC1HZ pin (1 Hz) ; 1: Enable output of RTC1HZ pin (1 Hz) ; Be sure to clear this bit to 0 ; RTCE ; [Real-time counter operation control] ; 0: Stop counter operation ; 1: Start counter operation ; Specify the count start time (January 1st, 2000, Saturday, 8:59:50 a.m.) MOV SEC, #50H ; seconds: 50 MOV MIN, #59H ; minutes: 59 MOV HOUR, #08H ; hours: 08 MOV WEEK, #06H ; day of the week: Saturday MOV DAY, #01H ; day: 01 MOV MONTH, #01H ; month: 01 MOV YEAR, #00H ; year: 00 ; Set up the generation of alarm interrupts CLR1 WALE ; Disable matching SET1 WALIE ; Generate an interrupt upon an alarm time match ; Specify the alarm time (9:00 a.m. every day) MOV ALARMWM,#00H ; minutes: 00 Application Note U19692EJ1V0AN 35
38 APPENDIX A PROGRAM LIST MOV ALARMWH,#09H ; hours: 09 MOV ALARMWW,# B ; day of the week: all days SET1 WALE ; Enable alarm time matching CLR1 RTCIF ; Clear the INTRTC interrupt request CLR1 RTCMK ; Enable the INTRTC interrupt SET1 RTCE ; Start the real-time counter ; Make the system wait before entering the STOP mode immediately after starting the real-time counter MOV B, #62 ; * When entering the STOP mode immediately HINI210: ; after setting RTCE to 1, first wait for NOP ; two cycles of the subsystem clock (about 62 us) DBNZ B, $HINI210 ; or more. ; Enable interrupts EI ; Enable interrupts BR MMAIN_LOOP ; Go to the main loop ;******************************************************************************* ; ; Main loop ; ;******************************************************************************* MMAIN_LOOP: ; Make the system wait for an interrupt STOP ; Enter the STOP mode (Exit the STOP mode by generating an INTRTC interrupt) BR MMAIN_LOOP ; Go to the start of the main loop ;******************************************************************************* ; ; INTRTC interrupt servicing ; (by using the fixed-interval signal of the real-time counter or alarm time match detection) ; ;******************************************************************************* IINTRTC: SEL RB1 ; Switch the register bank XOR P0, # B ; Toggle LED1 BF WAFG, $HRTC800 ; Has an alarm time match been detected? No, ; If an alarm time match is detected 36 Application Note U19692EJ1V0AN
39 APPENDIX A PROGRAM LIST CLR1 WAFG ; Clear the alarm detection status flag CLR1 P0.1 ; Turn on LED2 ; * To add other processing when an alarm time match has been detected, ; specify it here. HRTC800: RETI end Application Note U19692EJ1V0AN 37
40 APPENDIX A PROGRAM LIST main.c (C language version) /******************************************************************************* NEC Electronics 78K0/KC2-L Series ******************************************************************************** 78K0/KC2-L Series Sample Program (Real-Time Counter) ******************************************************************************** Fixed-Interval Interrupts and Alarm Interrupts ******************************************************************************** <<History>> Release ******************************************************************************** <<Overview>> This sample program presents an example of using the real-time counter. In the sample program, LEDs (LED1 and LED2) are controlled by using the real-time counter to generate fixed-interval interrupts and alarm interrupts. <Primary initial settings> (Option byte settings) - Allowing the internal low-speed oscillator to be programmed to stop - Disabling the watchdog timer - Setting the internal high-speed oscillation clock frequency to 8 MHz - Disabling LVI from being started by default (Settings during initialization immediately after a reset ends) - Specifying the ROM and RAM sizes - Setting up I/O ports Specifying P00 and P01 to be used to control the LEDs (LED1 and LED2) - Checking whether VDD is 2.7 V or more by using the low-voltage detector - Specifying that the CPU clock runs on the internal high-speed oscillation clock (8 MHz) - Specifying the XT1 oscillation mode for the subsystem clock pin - Stopping the internal low-speed oscillator - Disabling peripheral hardware not to be used - Setting up the real-time counter Making the system wait until the subsystem clock stabilizes by using 8-bit timer H0 (about 1 second) Specifying 8:59:50 a.m. as the count start time and 9:00:00 a.m. as the alarm time Setting fixed-interval interrupts (generated at 0.5 second intervals) and alarm interrupts - Enabling interrupts <LED control timing> 38 Application Note U19692EJ1V0AN
41 APPENDIX A PROGRAM LIST LED LED control timing LED1 (P00) Blink every second. LED2 (P01) Turn on at the alarm time * The LEDs turn off if 1 is output from the ports and turn on if 0 is output from the ports. <I/O port settings> Output: P00, P01 * Set all unused ports that can be specified as output ports as output ports. *******************************************************************************/ /*============================================================================== Preprocessing directive (#pragma) ==============================================================================*/ #pragma SFR /* SFR names can be described at the C source level */ #pragma DI /* DI instructions can be described at the C source level */ #pragma EI /* EI instructions can be described at the C source level */ #pragma NOP /* NOP instructions can be described at the C source level */ #pragma STOP /* STOP instructions can be described at the C source level */ #pragma interrupt INTRTC fn_intrtc RB1 /* Declare the interrupt function: INTRTC */ /******************************************************************************* Initialization after RESET *******************************************************************************/ void hdwinit( void ) { unsigned char uccounter; /* Count variable */ /* Disable interrupts */ DI(); /* Disable interrupts */ /* Specify the ROM and RAM sizes Application Note U19692EJ1V0AN 39
42 APPENDIX A PROGRAM LIST Note that the values to specify vary depending on the model. Enable the settings for the model to use. (The upd78f0588 is the default model.) */ /* Setting when using upd78f0581 or upd78f0586 */ /*IMS = 0x42;*/ /* Specify the ROM and RAM sizes */ /* Setting when using upd78f0582 or upd78f0587 */ /*IMS = 0x04;*/ /* Specify the ROM and RAM sizes */ /* Setting when using upd78f0583 or upd78f0588 */ IMS = 0xC8; /* Specify the ROM and RAM sizes */ /* Initialize port */ P0 = 0b ; /* Set the P00 and P01 output latches to high level */ /* Set the P02 output latch to low level */ PM0 = 0b ; /* Specify P00 to P02 as output ports */ /* P00: Used to control LED1 */ /* P01: Used to control LED2 */ /* P02: Unused */ /* Initialize port */ ADPC1 = 0b ; /* Specify P10 to P12 as digital I/O ports */ P1 = 0b ; /* Set the P10 to P17 output latches to low level */ PM1 = 0b ; /* Specify P10 to P17 as output ports */ /* P10 to P17: Unused */ /* Initialize port */ ADPC0 = 0b ; /* Specify P20 to P27 as digital I/O ports */ P2 = 0b ; /* Set the P20 to P27 output latches to low level */ PM2 = 0b ; /* Specify P20 to P27 as output ports */ /* P20 to P27: Unused */ /* Initialize port */ P3 = 0b ; /* Set the P30 to P33 output latches to low level */ PM3 = 0b ; /* Specify P30 to P33 as output ports */ /* P30 to P33: Unused */ /* Initialize port */ 40 Application Note U19692EJ1V0AN
43 APPENDIX A PROGRAM LIST P4 = 0b ; /* Set the P40 to P42 output latches to low level */ PM4 = 0b ; /* Specify P40 to P42 as output ports */ /* P40 to P42: Unused */ /* Initialize port */ P6 = 0b ; /* Set the P60 to P63 output latches to low level */ PM6 = 0b ; /* Specify P60 to P63 as output ports */ /* P60 to P63: Unused */ /* Initialize port */ P7 = 0b ; /* Set the P70 to P75 output latches to low level */ PM7 = 0b ; /* Specify P70 to P75 as output ports */ /* P70 to P75: Unused */ /* Initialize port */ P12 = 0b ; /* Set the P120 output latch to low level */ PM12 = 0b ; /* Specify P120 as an output port */ /* P120 to P125: Unused */ /* Low-voltage detection The low-voltage detector is used to check whether VDD is 2.7 V or more */ /* Set up the low-voltage detector */ LVIMK = 1; /* Disable the INTLVI interrupt */ LVISEL = 0; /* Specify VDD as the detection voltage */ LVIS = 0b ; /* Set the low-voltage detection level (VLVI) to 2.84 ±0.1 V */ LVIMD = 0; /* Specify that an interrupt signal is generated when a low voltage is detected */ LVION = 1; /* Enable low-voltage detection */ /* Make the system wait until the low-voltage detector stabilizes (10 us or more) */ for( uccounter = 0; uccounter < 2; uccounter++ ){ NOP(); } /* Make the system wait until VLVI is less than or equal to VDD */ while(lvif){ NOP(); } LVION = 0; /* Stop the low-voltage detector */ Application Note U19692EJ1V0AN 41
44 APPENDIX A PROGRAM LIST /* Specify the clock frequency Specify the clock frequency so that the device can run on the internal high-speed oscillation clock. The XT1 oscillation mode is specified for the subsystem clock pin */ OSCCTL = 0b ; /* Clock operation mode */ /* Be sure to clear this bit to 0 */ /* RSWOSC/AMPHXT */ /* [XT1 oscillator oscillation mode selection] */ /* 00: Low power consumption oscillation */ /* 01: Normal oscillation */ /* 1x: Ultra-low power consumption oscillation */ /* EXCLKS/OSCSELS */ /* [Subsystem clock pin operation setting] */ /* (P123/XT1,P124/XT2/EXCLKS) */ /* Specify the use of the pin in XT1 oscillation mode by specifying 001 by also using XTSTART */ /* EXCLK/OSCSEL */ /* [High-speed system clock pin operation setting] */ /* (P121/X1,P122/X2/EXCLK) */ /* 00: Input port */ /* 01: X1 oscillation mode */ /* 10: Input port */ /* 11: External clock input mode */ PCC = 0b ; /* Select the CPU clock (fcpu) */ /* CSS/PCC2/PCC1/PCC0 */ /* [CPU clock (fcpu) selection] */ /* 0000:fXP */ /* 0001:fXP/2 */ /* 0010:fXP/2^2 */ /* 0011:fXP/2^3 */ /* 0100:fXP/2^4 */ /* 1000:fSUB/2 */ /* 1001:fSUB/2 */ /* 1010:fSUB/2 */ /* 1011:fSUB/2 */ /* 1100:fSUB/2 */ /* (Other than the above: Setting prohibited) */ /* Be sure to clear this bit to 0 */ /* CLS */ /* [CPU clock status] */ /* XTSTART */ /* [Subsystem clock pin operation setting] */ /* Specify the use of the pin by also using EXCLKS and OSCSELS */ 42 Application Note U19692EJ1V0AN
45 APPENDIX A PROGRAM LIST /* Be sure to clear this bit to 0 */ RCM = 0b ; /* Select the operating mode of the internal oscillator */ /* RSTOP */ /* [Internal high-speed oscillator oscillating/stopped] */ /* 0: Internal high-speed oscillator oscillating */ /* 1: Internal high-speed oscillator stopped */ /* LSRSTOP */ /* [Internal low-speed oscillator oscillating/stopped] */ /* 0: Internal low-speed oscillator oscillating */ /* 1: Internal low-speed oscillator stopped */ /* Be sure to clear this bit to 0 */ /* RSTS */ /* [Status of internal high-speed oscillator] */ MOC = 0b ; /* Select the operating mode of the high-speed system clock */ /* Be sure to clear this bit to 0 */ /* MSTOP */ /* [Control of high-speed system clock operation] */ /* 0: X1 oscillator operating/external clock from EXCLK pin is enabled */ /* 1: X1 oscillator stopped/external clock from EXCLK pin is disabled */ MCM = 0b ; /* Select the clock to supply */ /* XSEL/MCM0 */ /* [Clock supplied to main system and peripheral hardware] */ /* 00: Main system clock (fxp) */ /* = internal high-speed oscillation clock (fih) */ /* Peripheral hardware clock (fprs) */ /* = internal high-speed oscillation clock (fih) */ /* 01: Main system clock (fxp) */ /* = internal high-speed oscillation clock (fih) */ /* Peripheral hardware clock (fprs) */ /* = internal high-speed oscillation clock (fih) */ /* 10: Main system clock (fxp) */ /* = internal high-speed oscillation clock (fih) */ /* Peripheral hardware clock (fprs) */ /* = high-speed system clock (fih) */ /* 11: Main system clock (fxp) */ /* = high-speed system clock (fih) */ /* Peripheral hardware clock (fprs) */ /* = high-speed system clock (fih) */ /* MCS */ /* [Main system clock status] */ /* Be sure to clear this bit to 0 */ /* Application Note U19692EJ1V0AN 43
46 APPENDIX A PROGRAM LIST Disable peripheral hardware not to be used */ /* 16-bit timer/event counter 00 */ TMC00 = 0b ; /* Disable the counter */ /* 8-bit timer/event counters 50 and 51 */ TMC50 = 0b ; /* Disable timer 50 */ TMC51 = 0b ; /* Disable timer 51 */ /* 8-bit timer H1 */ TMHMD1 = 0b ; /* Stop timer H1 */ /* Clock output controller */ CKS = 0b ; /* Stop the clock frequency divider */ /* A/D converter */ ADM0 = 0b ; /* Stop A/D conversion */ /* Operational amplifiers */ AMP0M = 0b ; /* Stop operational amplifier 0 */ AMP1M = 0b ; /* Stop operational amplifier 1 */ /* Serial interface UART6 */ ASIM6 = 0b ; /* Disable the interface */ /* Serial interface IICA */ IICACTL0 = 0b ; /* Disable the interface */ /* Serial interfaces CSI10 and CSI11 */ CSIM10 = 0b ; /* Disable CSI10 */ CSIM11 = 0b ; /* Disable CSI11 */ /* Interrupts (The interrupts to be used are enabled later) */ MK0 = 0xFFFF; /* Disable all interrupts */ MK1 = 0xFFFF; EGPCTL0 = 0b ; /* Disable the detection of all external interrupts */ EGPCTL1 = 0b ; /* Key interrupts */ KRM = 0b ; /* Disable all key interrupts */ /* Set up the real-time counter Making the system wait until the subsystem clock stabilizes by using 8-bit timer H0 (about 1 second) - Specifying 8:59:50 a.m. as the count start time and 9:00:00 a.m. as the alarm time - Setting fixed-interval interrupts (generated at 0.5 second intervals) and alarm 44 Application Note U19692EJ1V0AN
47 APPENDIX A PROGRAM LIST interrupts */ /* Make the system wait until the subsystem clock stabilizes by using 8-bit timer H0 (about 1 second) */ TMHMD0 = 0b ; /* Count clock: fprs/2^10 */ CMP00 = (245-1); /* Interval time: ms (= 245 / fprs/2^10) */ TMIFH0 = 0; /* Clear the INTTMH0 interrupt request */ TMMKH0 = 1; /* Disable the INTTMH0 interrupt */ TMHE0 = 1; /* Start 8-bit timer H0 */ /* Oscillation stabilization time: About 1 second (= ms * 32) */ for( uccounter = 0; uccounter < 32; uccounter++ ){ /* Make the system wait for an interrupt */ while(!tmifh0 ){ NOP(); } TMIFH0 = 0; /* Clear the INTTMH0 interrupt request */ } TMHE0 = 0; /* Stop 8-bit timer H0 */ /* Control of real-time counter control clock */ PER0 = 0b ; /* Be sure to clear this bit to 0 */ /* RTCEN: */ /* [Real-time counter control clock] */ /* 0: Stop supply of control clock */ /* 1: Supply control clock */ /* Real-time counter operation setting */ RTCE = 0; /* Stop real-time counter operation */ RTCC0 = 0b ; /* CT2/CT1/CT0 */ /* [Fixed-interval interrupt (INTRTC) selection] */ /* 000: Does not use fixed-interval interrupt function */ /* 001: Once per 0.5 s (synchronized with second count up) */ /* 010: Once per 1 s (same time as second count up) */ /* 011: Once per 1 m (second 00 of every minute) */ /* 100: Once per 1 hour (minute 00 and second 00 of every hour) */ /* 101: Once per 1 day (hour 00, minute 00, and second 00 of every day) */ /* 11x: Once per 1 month (Day 1, hour 00 a.m., minute 00, and second 00 of every month) */ /* AMPM */ /* [Selection of 12-/24-hour system] */ /* 0: 12-hour system (a.m. and p.m. are displayed) */ /* 1: 24-hour system */ /* RCLOE0 */ /* [RTCCL pin output control] */ Application Note U19692EJ1V0AN 45
48 APPENDIX A PROGRAM LIST /* 0: Disable output of RTCCL pin ( khz) */ /* 1: Enable output of RTCCL pin ( khz) */ /* RCLOE1 */ /* [RTC1HZ pin output control] */ /* 0: Disable output of RTC1HZ pin (1 Hz) */ /* 1: Enable output of RTC1HZ pin (1 Hz) */ /* Be sure to clear this bit to 0 */ /* RTCE */ /* [Real-time counter operation control] */ /* 0: Stop counter operation */ /* 1: Start counter operation */ /* Specify the count start time (January 1st, 2000, Saturday, 8:59:50 a.m.) */ SEC = 0x50; /* seconds: 50 */ MIN = 0x59; /* minutes: 59 */ HOUR = 0x08; /* hours: 08 */ WEEK = 0x06; /* day of the week: Saturday */ DAY = 0x01; /* day: 01 */ MONTH = 0x01; /* month: 01 */ YEAR = 0x00; /* year: 00 */ /* Set up the generation of alarm interrupts */ WALE = 0; /* Disable matching */ WALIE = 1; /* Generate an interrupt upon an alarm time match */ /* Specify the alarm time (9:00 a.m. every day) */ ALARMWM = 0x00; /* minutes: 00 */ ALARMWH = 0x09; /* hours: 09 */ ALARMWW = 0b ; /* day of the week: all days */ WALE = 1; /* Enable alarm time matching */ RTCIF = 0; /* Clear the INTRTC interrupt request */ RTCMK = 0; /* Enable the INTRTC interrupt */ RTCE = 1; /* Start the real-time counter */ /* Make the system wait before entering the STOP mode immediately after starting the real-time counter */ /* * When entering the STOP mode immediately after setting */ /* RTCE to 1, first wait for two cycles of the subsystem */ /* clock (about 62 us) or more. */ for( uccounter = 0; uccounter < 22; uccounter++ ){ NOP(); } /* Enable interrupts 46 Application Note U19692EJ1V0AN
49 APPENDIX A PROGRAM LIST */ EI(); /* Enable interrupts */ } /******************************************************************************* Main loop *******************************************************************************/ void main(void) { while (1){ STOP(); /* Enter the STOP mode (Exit the STOP mode by generating an INTRTC interrupt) */ } } /******************************************************************************* INTRTC interrupt servicing (by using the fixed-interval signal of the real-time counter or alarm time match detection) *******************************************************************************/ interrupt void fn_intrtc(void) { P0 ^= 0b ; /* Toggle LED1 */ /* If an alarm time match is detected */ if( WAFG ){ WAFG = 0; /* Clear the alarm detection status flag */ P0.1 = 0; /* Turn on LED2 */ } } /* * To add other processing when an alarm time match has been detected, */ /* specify it here. */ Application Note U19692EJ1V0AN 47
50 APPENDIX B USING 78K0/KC2-L 44-PIN PRODUCTS All 78K0/KC2-L sample programs are intended for 48-pin products. To use a 78K0/KC2-L sample program for a 44- pin product, specify the following settings: (1) Initial settings of ports Setting up port 0 Change the value of bit 2 of port mode register 0 (PM0) from 0 to 1. Setting up port 4 Change the value of bit 2 of port mode register 4 (PM4) from 0 to 1. Setting up port 7 Change the values of bits 5 and 4 of port mode register 7 (PM7) from 00 to 11. (2) Disabling unused peripheral hardware Delete the instruction used to set up the clock output selection register (CKS). 48 Application Note U19692EJ1V0AN
51 APPENDIX C REVISION HISTORY Edition Date Published Page Revision 1st edition September 2009 Application Note U19692EJ1V0AN 49
52 For further information, please contact: NEC Electronics Corporation 1753, Shimonumabe, Nakahara-ku, Kawasaki, Kanagawa , Japan Tel: [America] NEC Electronics America, Inc Scott Blvd. Santa Clara, CA , U.S.A. Tel: [Europe] NEC Electronics (Europe) GmbH Arcadiastrasse Düsseldorf, Germany Tel: Hanover Office Podbielskistrasse 166 B Hannover Tel: Munich Office Werner-Eckert-Strasse München Tel: Stuttgart Office Industriestrasse Stuttgart Tel: United Kingdom Branch Cygnus House, Sunrise Parkway Linford Wood, Milton Keynes MK14 6NP, U.K. Tel: Succursale Française 9, rue Paul Dautier, B.P Velizy-Villacoublay Cédex France Tel: Sucursal en España Juan Esplandiu, Madrid, Spain Tel: Tyskland Filial Täby Centrum Entrance S (7th floor) Täby, Sweden Tel: Filiale Italiana Via Fabio Filzi, 25/A Milano, Italy Tel: Branch The Netherlands Steijgerweg HS Eindhoven The Netherlands Tel: [Asia & Oceania] NEC Electronics (China) Co., Ltd 7th Floor, Quantum Plaza, No. 27 ZhiChunLu Haidian District, Beijing , P.R.China Tel: Shanghai Branch Room , Bank of China Tower, 200 Yincheng Road Central, Pudong New Area, Shanghai, P.R.China P.C: Tel: Shenzhen Branch Unit 01, 39/F, Excellence Times Square Building, No Yi Tian Road, Futian District, Shenzhen, P.R.China P.C: Tel: NEC Electronics Hong Kong Ltd. Unit , 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong Tel: NEC Electronics Taiwan Ltd. 7F, No. 363 Fu Shing North Road Taipei, Taiwan, R. O. C. Tel: NEC Electronics Singapore Pte. Ltd. 238A Thomson Road, #12-08 Novena Square, Singapore Tel: NEC Electronics Korea Ltd. 11F., Samik Lavied or Bldg., 720-2, Yeoksam-Dong, Kangnam-Ku, Seoul, , Korea Tel: G0706
Old Company Name in Catalogs and Other Documents
To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took
Old Company Name in Catalogs and Other Documents
To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took
Old Company Name in Catalogs and Other Documents
To our customers, Old Company Name in Catalogs and Other Documents On April st,, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over all
V850. Application Note. 32-Bit Single-Chip Microcontrollers AES 128 Encryption/Decryption. Document No. U19668EE1V0AN00 Date Published January 2009
Application Note V850 32-Bit Single-Chip Microcontrollers AES 128 Encryption/Decryption Document No. U19668EE1V0AN00 Date Published January 2009 NEC Electronics (Europe) GmbH DISCLAIMER The related documents
Old Company Name in Catalogs and Other Documents
To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took
PoNET kbd48cnc. User s manual
PoNET kbd48cnc User s manual Version: 16/10/2012 SAFETY INFORMATION! This product is intended for integration by the user into a computer numerical control (CNC) machine. It is the user's responsibility
BIPOLAR ANALOG INTEGRATED CIRCUIT
DATA SHEET BIPOLAR ANALOG INTEGRATED CIRCUIT μpc8tk SiGe:C LOW NOISE AMPLIFIER FOR GPS/MOBILE COMMUNICATIONS DESCRIPTION The μpc8tk is a silicon germanium carbon (SiGe:C) monolithic integrated circuit
BIPOLAR ANALOG INTEGRATED CIRCUIT
DATA SHEET BIPOLAR ANALOG INTEGRATED CIRCUIT μpc823tu SiGe:C LOW NOISE AMPLIFIER FOR GPS DESCRIPTION The μpc823tu is a silicon germanium carbon (SiGe:C) monolithic integrated circuit designed as low noise
DPDT SWITCH FOR 2.4 GHz AND 6 GHz DUAL-BAND WIRELESS LAN
GaAs INTEGRATED CIRCUIT PG2164T5N DPDT SWITCH FOR 2.4 GHz AND 6 GHz DUAL-BAND WIRELESS LAN DESCRIPTION The PG2164T5N is a GaAs MMIC DPDT (Double Pole Double Throw) switch which was developed for 2.4 GHz
TOSHIBA Bipolar Linear Integrated Circuit Silicon Monolithic TAR5SB15~TAR5SB50
TOSHIBA Bipolar Linear Integrated Circuit Silicon Monolithic TARSB~TARSB Point Regulators (Low-Dropout Regulator) TARSB~TARSB The TARSBxx Series is comprised of general-purpose bipolar single-power-supply
DATA SHEET PNP SILICON EPITAXIAL TRANSISTOR FOR HIGH-VOLTAGE HIGH-SPEED SWITCHING
DATA SHEET SILICON POWER TRANSISTOR 2SA1010 PNP SILICON EPITAXIAL TRANSISTOR FOR HIGH-VOLTAGE HIGH-SPEED SWITCHING The 2SA1010 is a mold power transistor developed for highvoltage high-speed switching,
µpd6379, 6379A, 6379L, 6379AL
DATA SHEET MOS INTEGRATED CIRCUIT µpd6379, 6379A, 6379L, 6379AL 2-CHANNEL 16-BIT D/A CONVERTER FOR AUDIO APPLICATION The µpd6379 and 6379A are 2-channel 16-bit D/A converters for digital audio signal demodulation.
Old Company Name in Catalogs and Other Documents
To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took
DATA SHEET. The information in this document is subject to change without notice.
DATA SHEET AUTOMOTIVE RELAYS EP2/EP1 SERIES DESCRIPTION The NEC TOKIN EP2 / EP1 series are PC-board mount type automotive relays suitable for various motor controls and other applications that require
Pulse Output Forced Cutoff Using the Clock Alarm Function and ELC CC-RL
78/G14 Abstract APPLICATION NOTE R01AN2782EJ0100 Rev. 1.00 Pulse Output Forced Cutoff Using the Clock Alarm Function and ELC CC- This document describes how to forcibly cut off the pulse output using a
TOSHIBA Transistor Silicon PNP Epitaxial Type (PCT Process) 2SA1020
2SA12 TOSHIBA Transistor Silicon PNP Epitaxial Type (PCT Process) 2SA12 Power Amplifier Applications Power Switching Applications Unit: mm Low Collector saturation voltage: V CE (sat) =.5 V (max) (I C
Connection Cable for LED Driver Board
Connection Cable for LED Driver Board 2CBL03 DATA SHEET DOD-PP-07 (st edition) All information is subject to change without notice. Please confirm the sales representative before starting to design your
HG2 Series Product Brief
Solid State Drives Product Brief - 1 - Rev.2 1. SCOPE T his document describes the specifications of the following model 1.1 2.5inch Case Type Product Number THNS064GG2BB THNS128GG4BB THNS256GG8BB THNS512GG8BB
Section 29. Real-Time Clock and Calendar (RTCC)
Section 29. Real-Time Clock and Calendar (RTCC) HIGHLIGHTS This section of the manual contains the following topics: 29.1 Introduction... 29-2 29.2 Status and Control Registers... 29-3 29.3 Modes of Operation...
EM3242. Angle Sensor IC [EM3242]
EM3242 Angle Sensor IC Applications Small absolute rotary encoder Small input device (mode selector, volume control, and soon) Potentiometer Rotary switch Features Si monolithic rotary position sensor
SSM3K335R SSM3K335R. 1. Applications. 2. Features. 3. Packaging and Pin Configuration. 2012-07-19 Rev.3.0. Silicon N-Channel MOS (U-MOS -H)
MOSFETs Silicon N-Channel MOS (U-MOS-H) SSM3K335R SSM3K335R 1. Applications Power Management Switches DC-DC Converters 2. Features (1) 4.5-V gate drive voltage. (2) Low drain-source on-resistance : R DS(ON)
AN974 APPLICATION NOTE
AN974 APPLICATION NOTE Real time clock with ST7 Timer Output Compare By MCD Application Team 1 INTRODUCTION The purpose of this note is to present how to use the ST7 Timer output compare function. As an
DATA SHEET COMPACT AND LIGHTWEIGHT, SMALL MOUNTING SIZE, HIGH BREAKDOWN VOLTAGE
DATA SHEET MINIATURE SIGNAL RELAY EC SERIES COMPACT AND LIGHTWEIGHT, SMALL MOUNTING SIZE, HIGH BREAKDOWN VOLTAGE DESCRIPTI The EC series has reduced mounting space but sustained high-performance of NEC
Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB
APPLICATION NOTE M16C/26 1.0 Abstract The following article describes using a synchronous serial port and the FoUSB (Flash-over-USB ) Programmer application to program the user flash memory of the M16C/26
8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA
Features Compatible with MCS-51 products On-chip Flash Program Memory Endurance: 1,000 Write/Erase Cycles On-chip EEPROM Data Memory Endurance: 100,000 Write/Erase Cycles 512 x 8-bit RAM ISO 7816 I/O Port
TPN4R712MD TPN4R712MD. 1. Applications. 2. Features. 3. Packaging and Internal Circuit. 2014-12 2015-04-21 Rev.4.0. Silicon P-Channel MOS (U-MOS )
MOSFETs Silicon P-Channel MOS (U-MOS) TPN4R712MD TPN4R712MD 1. Applications Lithium-Ion Secondary Batteries Power Management Switches 2. Features (1) Low drain-source on-resistance: R DS(ON) = 3.8 mω (typ.)
Silicon Planar Zener Diode for Surge Absorption and Stabilizer
Silicon Planar Zener Diode for Surge Absorption and Stabilizer Features These diodes are delivered taped. Ultra small Resin Package (URP) is suitable for surface mount design. Ordering Information REJ3G1512-2
Digital-Output Magnetic Sensor (Hall IC)
TOSHIBA Semiconductor Application Note Digital-Output Magnetic Sensor (Hall IC) 1. Introduction The digital-output magnetic sensor is essentially a sensor which detects the magnetic flux density of a magnet
TOSHIBA Transistor Silicon NPN Epitaxial Type (PCT Process) 2SC2383
TOSHIBA Transistor Silicon NPN Epitaxial Type (PCT Process) SC8 Color TV Vertical Deflection Output Applications Color TV Class-B Sound Output Applications Unit: mm High breakdown voltage: V CEO = 6 V
Part Number Decoder for Toshiba NAND Flash
Part Number Decoder for Toshiba NAND Flash Revision 1.3 Memory Application Engineering Dept. Memory Division, TOSHIBA CORPORATION Semiconductor Company Sep.24 th 2010 Copyright 2006, Toshiba Corporation.
PAC52XX Clock Control Firmware Design
APPLICATION NOTE PAC52XX Clock Control Firmware Design TM Marc Sousa Senior Manager, Systems and Firmware www.active-semi.com Copyright 2014 Active-Semi, Inc. TABLE OF CONTENTS APPLICATION NOTE... 1 Table
Implementing a Real-Time Clock on the MSP430
Application Report SLAA076A - January 2001 Implementing a Real-Time Clock on the MSP430 Mike Mitchell Mixed Signal Products ABSTRACT This application report describes the implementation of a real-time
APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.
APPLICATION NOTE Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer Introduction Atmel AVR 8-bit Microcontroller This application note describes how to implement a real time counter (RTC)
HANDLING SUSPEND MODE ON A USB MOUSE
APPLICATION NOTE HANDLING SUSPEND MODE ON A USB MOUSE by Microcontroller Division Application Team INTRODUCTION All USB devices must support Suspend mode. Suspend mode enables the devices to enter low-power
Software Real Time Clock Implementation on MC9S08LG32
Freescale Semiconductor Document Number: AN4478 Rev. 0, 03/2012 Software Real Time Clock Implementation on MC9S08LG32 by: Nitin Gupta Automotive and Industrial Solutions Group 1 Introduction The MC9S08LG32
AN3265 Application note
Application note Handling hardware and software failures with the STM8S-DISCOVERY Application overview This application is based on the STM8S-DISCOVERY. It demonstrates how to use the STM8S window watchdog
8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.
AVR134: Real-Time Clock (RTC) using the Asynchronous Timer Features Real-Time Clock with Very Low Power Consumption (4µA @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts Time,
AN10849. LPC1700 RTC hardware auto calibration. Document information. RTC, Hardware Auto Calibration, LPC1700, Graphic LCD
Rev. 01 1 July 2009 Application note Document information Info Keywords Abstract Content RTC, Hardware Auto Calibration, LPC1700, Graphic LCD Using the LPC1700 RTC s auto calibration feature Revision history
AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE
AVR 8-bit Microcontrollers AVR131: Using the AVR s High-speed PWM APPLICATION NOTE Introduction This application note is an introduction to the use of the high-speed Pulse Width Modulator (PWM) available
AN10850. LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode
LPC1700 timer triggered memory to GPIO data transfer Rev. 01 16 July 2009 Application note Document information Info Keywords Abstract Content LPC1700, GPIO, DMA, Timer0, Sleep Mode This application note
Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs
Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs AN033101-0412 Abstract This describes how to interface the Dallas 1-Wire bus with Zilog s Z8F1680 Series of MCUs as master devices. The Z8F0880,
RENESAS TECHNICAL UPDATE
RENESAS TECHNICAL UPDATE TN-RX*-A***A/E RENESAS TECHNICAL UPDATE 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan Renesas Electronics Corporation Date: Apr. 1, 2013 Product Category
AN108 IMPLEMENTING A REALTIME CLOCK. Relevant Devices. Introduction. Key Points. Overview
IMPLEMENTING A REALTIME CLOCK Relevant Devices This application note applies to the following devices: C8051F000, C8051F001, C8051F002, C8051F005, C8051F006, C8051F007, C8051F010, C8051F011, and C8051F012.
DS1307ZN. 64 x 8 Serial Real-Time Clock
DS137 64 x 8 Serial Real-Time Clock www.maxim-ic.com FEATURES Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap-year compensation valid
www.rohm.com 2012.04 - Rev.F 1/3 c 2013 ROHM Co., Ltd. All rights reserved.
c 2013 ROHM Co., Ltd. All rights reserved. 1/3 2012.04 - Rev.F SIP Design Support Document c 2013 ROHM Co., Ltd. All rights reserved. 2/3 2012.04 - Rev.F SIP Design Support Document c 2013 ROHM Co., Ltd.
AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE
Atmel AVR 8-bit Microcontroller AVR151: Setup and Use of the SPI APPLICATION NOTE Introduction This application note describes how to set up and use the on-chip Serial Peripheral Interface (SPI) of the
Hello, and welcome to this presentation of the STM32L4 reset and clock controller.
Hello, and welcome to this presentation of the STM32L4 reset and clock controller. 1 The STM32L4 reset and clock controller manages system and peripheral clocks. STM32L4 devices embed three internal oscillators,
Old Company Name in Catalogs and Other Documents
To our customers, Old Company Name in Catalogs and Other Documents On pril 1 st, 2010, NC lectronics Corporation merged with Renesas Technology Corporation, and Renesas lectronics Corporation took over
High-Stability Time Adjustment with Real-Time Clock Module
High-Stability Time Adjustment with Real-Time Clock Module An explanation of an Epson real-time clock module with sub-second time adjustment function [Preface] In recent years, it has become simple to
AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction
AVR134: Real Time Clock (RTC) using the Asynchronous Timer Features Real Time Clock with Very Low Power Consumption (4 μa @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts
This document describes the guidelines for Hi-Speed USB 2.0 board design. 1. Introduction... 2. 2. USB Transmission Line... 3
APPLICATION NOTE Summary This document describes the guidelines for Hi-Speed USB 2.0 board design. Operation Check Devices The application explained in this document applies to the following. R01AN3012EJ0100
HT1632C 32 8 &24 16 LED Driver
328 &216 LED Driver Features Operating voltage: 2.V~5.5V Multiple LED display 32 ROW /8 COM and 2 ROW & 16 COM Integrated display RAM select 32 ROW & 8 COM for 6 display RAM, or select 2 ROW & 16 COM for
EMC6D103S. Fan Control Device with High Frequency PWM Support and Hardware Monitoring Features PRODUCT FEATURES ORDER NUMBERS: Data Brief
EMC6D103S Fan Control Device with High Frequency PWM Support and Hardware Monitoring Features PRODUCT FEATURES Data Brief 3.3 Volt Operation (5 Volt Tolerant Input Buffers) SMBus 2.0 Compliant Interface
SILICON TRANSISTOR 2SC3355
DATA SHEET SILICON TRANSISTOR 2SC3355 HIGH FREQUENCY LOW NOISE AMPLIFIER NPN SILICON EPITAXIAL TRANSISTOR DESCRIPTION The 2SC3355 is an NPN silicon epitaxial transistor designed for low noise amplifier
Simplifying System Design Using the CS4350 PLL DAC
Simplifying System Design Using the CS4350 PLL 1. INTRODUCTION Typical Digital to Analog Converters (s) require a high-speed Master Clock to clock their digital filters and modulators, as well as some
LC898300XA. Functions Automatic adjustment to the individual resonance frequency Automatic brake function Initial drive frequency adjustment function
Ordering number : A2053 CMOS LSI Linear Vibrator Driver IC http://onsemi.com Overview is a Linear Vibrator Driver IC for a haptics and a vibrator installed in mobile equipments. The best feature is it
AN2604 Application note
AN2604 Application note STM32F101xx and STM32F103xx RTC calibration Introduction The real-time clock (RTC) precision is a requirement in most embedded applications, but due to external environment temperature
AN3252 Application note
Application note Building a wave generator using STM8L-DISCOVERY Application overview This application note provides a short description of how to use the STM8L-DISCOVERY as a basic wave generator for
Output Filter Design for EMI Rejection of the AAT5101 Class D Audio Amplifier
The AAT50 is a high efficiency, 2.5W mono class D audio power amplifier. It can be used in portable devices, such as MP4s, cell phones, laptops, GPS and PDAs. The device can work as a filterless class
8051 hardware summary
8051 hardware summary 8051 block diagram 8051 pinouts + 5V ports port 0 port 1 port 2 port 3 : dual-purpose (general-purpose, external memory address and data) : dedicated (interfacing to external devices)
ES_LPC4357/53/37/33. Errata sheet LPC4357/53/37/33. Document information
Rev. 1.1 8 August 2012 Errata sheet Document information Info Keywords Abstract Content LPC4357FET256; LPC4357FET180; LPC4357FBD208; LPC4353FET256; LPC4353FET180; LPC4353FBD208; LPC4337FET256; LPC4337FET180;
AN3332 Application note
Application note Generating PWM signals using STM8S-DISCOVERY Application overview This application user manual provides a short description of how to use the Timer 2 peripheral (TIM2) to generate three
AN3998 Application note
Application note PDM audio software decoding on STM32 microcontrollers 1 Introduction This application note presents the algorithms and architecture of an optimized software implementation for PDM signal
AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.
AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System Features 32-bit Real Time Counter (RTC) - 32-bit counter - Selectable clock source 1.024kHz 1Hz - Long overflow time
USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual
USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual Copyright 2007 SofTec Microsystems DC01197 We want your feedback! SofTec Microsystems is always on
10-/100-Mbps Ethernet Media Access Controller (MAC) Core
10-/100-Mbps Ethernet Media Access Controller (MAC) Core Preliminary Product Brief December 1998 Description The Ethernet Media Access Controller (MAC) core is a high-performance core with a low gate count,
HEF4021B. 1. General description. 2. Features and benefits. 3. Ordering information. 8-bit static shift register
Rev. 10 21 March 2016 Product data sheet 1. General description 2. Features and benefits 3. Ordering information The is an (parallel-to-serial converter) with a synchronous serial data input (DS), a clock
PS25202 EPIC Ultra High Impedance ECG Sensor Advance Information
EPIC Ultra High Impedance ECG Sensor Advance Information Data Sheet 291498 issue 2 FEATURES Ultra high input resistance, typically 20GΩ. Dry-contact capacitive coupling. Input capacitance as low as 15pF.
An Introduction to MPLAB Integrated Development Environment
An Introduction to MPLAB Integrated Development Environment 2004 Microchip Technology Incorporated An introduction to MPLAB Integrated Development Environment Slide 1 This seminar is an introduction to
HEF4011B. 1. General description. 2. Features and benefits. 3. Ordering information. 4. Functional diagram. Quad 2-input NAND gate
Rev. 6 10 December 2015 Product data sheet 1. General description 2. Features and benefits 3. Ordering information The is a quad 2-input NAND gate. The outputs are fully buffered for the highest noise
Hello and welcome to this training module for the STM32L4 Liquid Crystal Display (LCD) controller. This controller can be used in a wide range of
Hello and welcome to this training module for the STM32L4 Liquid Crystal Display (LCD) controller. This controller can be used in a wide range of applications such as home appliances, medical, automotive,
Section 7. Oscillator
HIGHLIGHTS Section 7. This section of the manual contains the following topics: 7 7.1 Introduction... 7-2 7.2 CPU Clocking...7-4 7.3 Configuration Registers... 7-5 7.4 Special Function Registers... 7-8
Quad 2-input NAND Schmitt trigger
Rev. 9 15 December 2015 Product data sheet 1. General description 2. Features and benefits 3. Applications The is a quad two-input NAND gate. Each input has a Schmitt trigger circuit. The gate switches
PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section
PRELIMINARY DS2434 Battery Identification Chip FEATURES Provides unique ID number to battery packs PACKAGE OUTLINE Eliminates thermistors by sensing battery temperature on chip DALLAS DS2434 1 2 3 256
AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor. http://onsemi.
Design Examples of On Board Dual Supply Voltage Logic Translators Prepared by: Jim Lepkowski ON Semiconductor Introduction Logic translators can be used to connect ICs together that are located on the
ICS650-01 SYSTEM PERIPHERAL CLOCK SOURCE. Description. Features. Block Diagram DATASHEET
DATASHEET ICS650-01 Description The ICS650-01 is a low-cost, low-jitter, high-performance clock synthesizer for system peripheral applications. Using analog/digital Phase-Locked Loop (PLL) techniques,
F 2 MC-8FX FAMILY MB95200 SERIES ELECTRONIC SAFE DEMO REFERENCE SOLUTION 8-BITMICROCONTROLLER APPLICATION NOTE
Fujitsu Semiconductor (Shanghai) Co., Ltd. Application Note MCU-AN- 500056-E-10 F 2 MC-8FX FAMILY 8-BITMICROCONTROLLER MB95200 SERIES ELECTRONIC SAFE DEMO REFERENCE SOLUTION APPLICATION NOTE Revision History
14-stage ripple-carry binary counter/divider and oscillator
Rev. 8 25 March 2016 Product data sheet 1. General description 2. Features and benefits 3. Ordering information The is a with three oscillator terminals (RS, REXT and CEXT), ten buffered outputs (Q3 to
The Important Points of Multi-layer Ceramic Capacitor Used in Buck Converter circuit
Switching Regulator Series The Important Points of Multi-layer Ceramic Capacitor Used in Buck Converter circuit No.1327EAY7 Multi-layer Ceramic Capacitor (MLCC) with large-capacitance can be used as smoothing-capacitor
DISCRETE SEMICONDUCTORS DATA SHEET. dbook, halfpage M3D088. BB201 Low-voltage variable capacitance double diode. Product specification 2001 Oct 12
DISCRETE SEMICONDUCTORS DATA SHEET dbook, halfpage M3D088 Low-voltage variable capacitance double 2001 Oct 12 Low-voltage variable capacitance double FEATURES Excellent linearity C1: 95 pf; C7.5: 27.6
Bandwidth Calculations for SA-1100 Processor LCD Displays
Bandwidth Calculations for SA-1100 Processor LCD Displays Application Note February 1999 Order Number: 278270-001 Information in this document is provided in connection with Intel products. No license,
CoE3DJ4 Digital Systems Design. Chapter 4: Timer operation
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation Timer There are two 16-bit timers each with four modes of operation Timers are used for (a) interval timing, (b) event counting or (c) baud rate
AN111: Using 8-Bit MCUs in 5 Volt Systems
This document describes how to incorporate Silicon Lab s 8-bit EFM8 and C8051 families of devices into existing 5 V systems. When using a 3 V device in a 5 V system, the user must consider: A 3 V power
Chapter 5 Real time clock by John Leung
Chapter 5 Real time clock 5.1 Philips PCF8563 Real time clock (RTC) Philips PCF8563 (U5) is an I 2 C compatible real time clock (RTC). Alternatively, this chip can be replaced by a software module like
AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction
AVR319: Using the USI module for SPI communication Features C-code driver for SPI master and slave Uses the USI module Supports SPI Mode 0 and 1 Introduction The Serial Peripheral Interface (SPI) allows
APPLICATION. si32library. Callback CMSIS HARDWARE. Figure 1. Firmware Layer Block Diagram
PRECISION32 SOFTWARE DEVELOPMENT KIT CODE EXAMPLES OVERVIEW 1. Introduction The Precision32 code examples are part of the Software Development Kit (SDK) installed with the Precision32 software package
Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ
nc. Order this document by MC68328/D Microprocessor and Memory Technologies Group MC68328 MC68328V Product Brief Integrated Portable System Processor DragonBall ΤΜ As the portable consumer market grows
Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A
Application Note Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A AN026701-0308 Abstract This application note demonstrates a method of implementing the Serial Peripheral Interface
AN2680 Application note
Application note Fan speed controller based on STDS75 or STLM75 digital temperature sensor and ST72651AR6 MCU Introduction This application note describes the method of defining the system for regulating
unit : mm With heat sink (see Pd Ta characteristics)
Ordering number: EN1321E Monolithic Linear IC LA4261 3.5 W 2-Channel AF Power Amplifier for Home Stereos and Music Centers Features. Minimum number of external parts required (No input capacitor, bootstrap
Application Report. 1 Introduction. 2 Resolution of an A-D Converter. 2.1 Signal-to-Noise Ratio (SNR) Harman Grewal... ABSTRACT
Application Report SLAA323 JULY 2006 Oversampling the ADC12 for Higher Resolution Harman Grewal... ABSTRACT This application report describes the theory of oversampling to achieve resolutions greater than
ICS514 LOCO PLL CLOCK GENERATOR. Description. Features. Block Diagram DATASHEET
DATASHEET ICS514 Description The ICS514 LOCO TM is the most cost effective way to generate a high-quality, high-frequency clock output from a 14.31818 MHz crystal or clock input. The name LOCO stands for
150127-Microprocessor & Assembly Language
Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an
MICROPROCESSOR AND MICROCOMPUTER BASICS
Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit
NortechCommander Software Operating Manual MAN-00004 R6
NortechCommander Software Operating Manual MAN-00004 R6 If the equipment described herein bears the symbol, the said equipment complies with the applicable European Union Directive and Standards mentioned
Backup Power Domain. AN0041 - Application Note. Introduction
Backup Power Domain AN0041 - Application Note Introduction This application note describes how to use the EFM32 Backup Power Domain and Backup Real Time Counter. An included software example for the Giant
2. Terminal arrangement. Default (PV display) (SV display) Communication protocol selection Selects the Communication protocol. Modbus ASCII mode:
COMMUNICATION INSTRUCTION MANUAL TEMPERATURE CONTROLLER KT4, KT8 and KT9 No.KTC1E6 2009.05 To prevent accidents arising from the misuse of this controller, please ensure the operator receives this manual.
1-of-4 decoder/demultiplexer
Rev. 6 1 April 2016 Product data sheet 1. General description 2. Features and benefits 3. Applications The contains two 1-of-4 decoders/demultiplexers. Each has two address inputs (na0 and na1, an active
