Information

© 2006 Microchip Technology Inc. DS80278A-page 1
PIC18F2455/2550/4455/4550
Clarifications/Corrections to the Data
Sheet:
In the Device Data Sheet (DS39632C), the following
clarifications and corrections should be noted. Any
silicon issues for the PIC18F2455/2550/4455/4550 will
be reported in a separate silicon errata. Please check
the Microchip web site for any existing issues.
1. Module: Timer1 Module
The Real-Time Clock application example, cited in
Section 12.6 “Using Timer1 as a Real-Time
Clock,” has changed.
“Example 12-1: Implementing a Real-Time
Clock Using a Timer1 Interrupt Service” is
corrected to the following example.
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 .12
MOVWF hours
BSF PIE1, TMR1IE ; Enable Timer1 interrupt
RETURN
RTCisr
; Insert the next 4 lines of code when TMR1
; 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

Summary of content (8 pages)