Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Архив4 / Proshin_polnostyu_ves_kursach / pic18f2455_2550_4455_4550.pdf
Скачиваний:
49
Добавлен:
07.08.2013
Размер:
7.07 Mб
Скачать

PIC18F2455/2550/4455/4550

12.1Timer1 Operation

Timer1 can operate in one of these modes:

Timer

Synchronous Counter

Asynchronous Counter

The operating mode is determined by the clock select bit, TMR1CS (T1CON<1>). When TMR1CS is cleared (= 0), Timer1 increments on every internal instruction

cycle (FOSC/4). When the bit is set, Timer1 increments on every rising edge of the Timer1 external clock input or the Timer1 oscillator, if enabled.

When Timer1 is enabled, the RC1/T1OSI/UOE and RC0/T1OSO/T13CKI pins become inputs. This means the values of TRISC<1:0> are ignored and the pins are read as ‘0’.

FIGURE 12-1:

TIMER1 BLOCK DIAGRAM

 

 

 

 

Timer1 Oscillator

 

On/Off

 

 

 

 

 

 

 

 

1

 

 

 

 

 

 

T1OSO/T13CKI

 

 

1

 

Synchronize

 

 

 

 

Prescaler

 

 

 

 

FOSC/4

 

 

 

 

 

1, 2, 4, 8

 

Detect

0

 

 

Internal

0

 

 

 

T1OSI

 

Clock

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

T1OSCEN(1)

TMR1CS

 

 

Sleep Input

Timer1

 

 

 

 

 

T1CKPS1:T1CKPS0

 

 

 

 

On/Off

 

 

 

 

 

 

 

T1SYNC

 

 

 

 

 

 

TMR1ON

 

 

 

 

 

 

 

Clear TMR1

 

TMR1L

TMR1

Set

 

 

 

TMR1IF

 

 

 

High Byte

 

 

(CCP Special Event Trigger)

 

on Overflow

 

 

 

 

Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off to eliminate power drain.

FIGURE 12-2: TIMER1 BLOCK DIAGRAM (16-BIT READ/WRITE MODE)

Timer1 Oscillator

1

T1OSO/T13CKI

 

 

 

1

 

 

 

 

 

Prescaler

 

Synchronize

 

 

FOSC/4

 

 

 

 

1, 2, 4, 8

 

Detect

0

 

Internal

0

 

 

 

T1OSI

Clock

 

 

 

 

2

 

 

 

 

 

 

 

 

T1OSCEN(1)

TMR1CS

 

 

Sleep Input

Timer1

 

 

 

T1CKPS1:T1CKPS0

 

 

 

 

On/Off

 

 

 

 

 

T1SYNC

 

 

 

 

 

TMR1ON

 

 

 

 

 

 

Clear TMR1

 

TMR1L

TMR1

Set

 

 

TMR1IF

 

 

High Byte

 

(CCP Special Event Trigger)

 

on Overflow

 

 

 

 

 

 

 

 

8

 

 

 

 

 

Read TMR1L

 

 

 

 

 

Write TMR1L

 

 

 

8

8

 

 

 

 

 

 

 

 

 

 

TMR1H

 

 

 

 

 

8

 

 

 

 

 

8

 

 

 

 

 

 

Internal Data Bus

Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off to eliminate power drain.

DS39632D-page 130

Preliminary

2007 Microchip Technology Inc.

Соседние файлы в папке Proshin_polnostyu_ves_kursach