




Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Esta página não é visível na pré-visualização
Não perca as partes importantes!





© 2006 Microchip Technology Inc. DS80278A-page 1
1. Module: Timer1 Module
EXAMPLE 12-1: IMPLEMENTING A REAL-TIME CLOCK USING A TIMER1 INTERRUPT SERVICE
RTCinit MOVLW 80h ; Preload TMR1 register pair MOVWF TMR1H ; for 1 second overflow CLRF TMR1L MOVLW b’00001111’ ; Configure for external clock, MOVWF T1CON ; Asynchronous operation, external oscillator CLRF secs ; Initialize timekeeping registers CLRF mins ; MOVLW. MOVWF hours BSF PIE1, TMR1IE ; Enable Timer1 interrupt RETURN RTCisr ; Insert the next 4 lines of code when TMR ; can not be reliably updated before clock pulse goes low BTFSC TMR1L,0 ; wait for TMR1L to become clear BRA $-2 ; (may already be clear) BTFSS TMR1L,0 ; wait for TMR1L to become set BRA $-2 ; TMR1 has just incremented ; If TMR1 update can be completed before clock pulse goes low ; Start ISR here BSF TMR1H, 7 ; Preload for 1 sec overflow BCF PIR1, TMR1IF ; Clear interrupt flag INCF secs, F ; Increment seconds MOVLW .59 ; 60 seconds elapsed? CPFSGT secs RETURN ; No, done CLRF secs ; Clear seconds INCF mins, F ; Increment minutes MOVLW .59 ; 60 minutes elapsed? CPFSGT mins RETURN ; No, done CLRF mins ; clear minutes INCF hours, F ; Increment hours MOVLW .23 ; 24 hours elapsed? CPFSGT hours RETURN ; No, done CLRF hours ; Reset hours RETURN ; Done
PIC18F2455/2550/4455/4550 Data Sheet Errata
DS80278A-page 2 © 2006 Microchip Technology Inc.
2. Module: Timer1 Module
3. Module: Universal Serial Bus (USB)
4. Module: Master Synchronous Serial Port (MSSP) Module
5. Module: 10-Bit Analog-to-Digital (A/D) Converter Module
6. Module: Special Features of the CPU
DS80278A-page 4 © 2006 Microchip Technology Inc.
9. Module: Electrical Characteristics
TABLE 28-5: USB INTERNAL VOLTAGE REGULATOR SPECIFICATIONS
(PARTIAL PRESENTATION)
© 2006 Microchip Technology Inc. DS80278A-page 5
REVISION HISTORY
© 2006 Microchip Technology Inc. DS80278A-page 7
Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.
Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, K EE L OQ , microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC, and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active Thermistor, Mindi, MiWi, MPASM, MPLIB, MPLINK, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2006, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper.
Note the following details of the code protection feature on Microchip devices:
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona, Gresham, Oregon and Mountain View, California. The Company’s quality system processes and procedures are for its PICmicro®^ 8-bit MCUs, K EE LOQ ®^ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
DS80278A-page 8 © 2006 Microchip Technology Inc.
AMERICAS
Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224- Tel: 480-792- Fax: 480-792- Technical Support: http://support.microchip.com Web Address: www.microchip.com
Asia Pacific Office Suites 3707-14, 37th Floor Tower 6, The Gateway Habour City, Kowloon Hong Kong Tel: 852-2401- Fax: 852-2401-
Atlanta Alpharetta, GA Tel: 770-640- Fax: 770-640-
Boston Westborough, MA Tel: 774-760- Fax: 774-760-
Chicago Itasca, IL Tel: 630-285- Fax: 630-285-
Dallas Addison, TX Tel: 972-818- Fax: 972-818-
Detroit Farmington Hills, MI Tel: 248-538- Fax: 248-538-
Kokomo Kokomo, IN Tel: 765-864- Fax: 765-864-
Los Angeles Mission Viejo, CA Tel: 949-462- Fax: 949-462-
San Jose Mountain View, CA Tel: 650-215- Fax: 650-961-
Toronto Mississauga, Ontario, Canada Tel: 905-673- Fax: 905-673-
ASIA/PACIFIC Australia - Sydney Tel: 61-2-9868- Fax: 61-2-9868- China - Beijing Tel: 86-10-8528- Fax: 86-10-8528- China - Chengdu Tel: 86-28-8676- Fax: 86-28-8676- China - Fuzhou Tel: 86-591-8750- Fax: 86-591-8750- China - Hong Kong SAR Tel: 852-2401- Fax: 852-2401- China - Qingdao Tel: 86-532-8502- Fax: 86-532-8502- China - Shanghai Tel: 86-21-5407- Fax: 86-21-5407- China - Shenyang Tel: 86-24-2334- Fax: 86-24-2334- China - Shenzhen Tel: 86-755-8203- Fax: 86-755-8203- China - Shunde Tel: 86-757-2839- Fax: 86-757-2839- China - Wuhan Tel: 86-27-5980- Fax: 86-27-5980- China - Xian Tel: 86-29-8833- Fax: 86-29-8833-
ASIA/PACIFIC India - Bangalore Tel: 91-80-4182- Fax: 91-80-4182- India - New Delhi Tel: 91-11-5160- Fax: 91-11-5160- India - Pune Tel: 91-20-2566- Fax: 91-20-2566- Japan - Yokohama Tel: 81-45-471- 6166 Fax: 81-45-471- Korea - Gumi Tel: 82-54-473- Fax: 82-54-473- Korea - Seoul Tel: 82-2-554- Fax: 82-2-558-5932 or 82-2-558- Malaysia - Penang Tel: 60-4-646- Fax: 60-4-646- Philippines - Manila Tel: 63-2-634- Fax: 63-2-634- Singapore Tel: 65-6334- Fax: 65-6334- Taiwan - Hsin Chu Tel: 886-3-572- Fax: 886-3-572- Taiwan - Kaohsiung Tel: 886-7-536- Fax: 886-7-536- Taiwan - Taipei Tel: 886-2-2500- Fax: 886-2-2508- Thailand - Bangkok Tel: 66-2-694- Fax: 66-2-694-
EUROPE Austria - Wels Tel: 43-7242-2244- Fax: 43-7242-2244- Denmark - Copenhagen Tel: 45-4450- Fax: 45-4485- France - Paris Tel: 33-1-69-53-63- Fax: 33-1-69-30-90- Germany - Munich Tel: 49-89-627-144- Fax: 49-89-627-144- Italy - Milan Tel: 39-0331- Fax: 39-0331- Netherlands - Drunen Tel: 31-416- Fax: 31-416- Spain - Madrid Tel: 34-91-708-08- Fax: 34-91-708-08- UK - Wokingham Tel: 44-118-921- Fax: 44-118-921-
WORLDWIDE SALES AND S ERVICE
06/08/