Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
даташитина PIC 12F683 .pdf
Скачиваний:
14
Добавлен:
02.02.2015
Размер:
3.06 Mб
Скачать

PIC12F683

12.3.6TIME-OUT SEQUENCE

On power-up, the time-out sequence is as follows:

PWRT time-out is invoked after POR has expired.

OST is activated after the PWRT time-out has expired.

The total time-out will vary based on oscillator configuration and PWRTE bit status. For example, in EC mode with PWRTE bit erased (PWRT disabled), there will be no time-out at all. Figure 12-4, Figure 12-5 and Figure 12-6 depict time-out sequences. The device can execute code from the INTOSC while OST is active by enabling Two-Speed Start-up or Fail-Safe Monitor (see

Section 3.7.2 “Two-Speed Start-up Sequence” and Section 3.8 “Fail-Safe Clock Monitor”).

Since the time-outs occur from the POR pulse, if MCLR is kept low long enough, the time-outs will expire. Then, bringing MCLR high will begin execution immediately (see Figure 12-5). This is useful for testing purposes or to synchronize more than one PIC12F683 device operating in parallel.

Table 12-5 shows the Reset conditions for some special registers, while Table 12-4 shows the Reset conditions for all the registers.

TABLE 12-1: TIME-OUT IN VARIOUS SITUATIONS

12.3.7POWER CONTROL (PCON) REGISTER

The Power Control register PCON (address 8Eh) has two Status bits to indicate what type of Reset occurred last.

Bit 0 is BOR (Brown-out). BOR is unknown on Power-on Reset. It must then be set by the user and checked on subsequent Resets to see if BOR = 0, indicating that a Brown-out has occurred. The BOR Status bit is a “don’t care” and is not necessarily predictable if the brown-out circuit is disabled (BOREN<1:0> = 00 in the Configuration Word register).

Bit 1 is POR (Power-on Reset). It is a ‘0’ on Power-on Reset and unaffected otherwise. The user must write a ‘1’ to this bit following a Power-on Reset. On a subsequent Reset, if POR is ‘0’, it will indicate that a Power-on Reset has occurred (i.e., VDD may have gone too low).

For more

information, see

Section 4.2.4 “Ultra

Low-Power

Wake-up”

and

Section 12.3.4

“Brown-Out Reset (BOR)”.

 

 

Oscillator Configuration

 

 

Power-up

 

Brown-out Reset

Wake-up from

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PWRTE = 0

 

PWRTE = 1

 

PWRTE = 0

 

PWRTE = 1

Sleep

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

XT, HS, LP

TPWRT + 1024 •

 

1024 • TOSC

TPWRT + 1024 •

 

1024 • TOSC

1024 • TOSC

 

 

TOSC

 

 

 

 

TOSC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RC, EC, INTOSC

 

TPWRT

 

 

TPWRT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TABLE 12-2: STATUS/PCON BITS AND THEIR SIGNIFICANCE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

POR

 

BOR

 

TO

 

PD

 

 

Condition

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

x

1

 

1

 

 

Power-on Reset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

u

0

 

1

 

1

 

 

Brown-out Reset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

u

 

u

0

 

 

u

 

WDT Reset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

u

 

u

0

 

0

 

 

WDT Wake-up

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reset during normal operation

 

u

 

u

 

u

 

u

 

MCLR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reset during Sleep

 

u

 

u

1

 

0

 

 

MCLR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Legend:

u = unchanged, x = unknown

 

 

TABLE 12-3: SUMMARY OF REGISTERS ASSOCIATED WITH BROWN-OUT RESET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Value on

Value on

Name

Bit 9

Bit 8

Bit 7

Bit 6

Bit 5

 

Bit 4

Bit 3

Bit 2

 

Bit 1

Bit 0

all other

 

 

POR, BOR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Resets(1)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CONFIG(2)

BOREN1

BOREN0

 

CPD

 

 

CP

 

MCLRE

 

PWRTE

 

WDTE

FOSC2

FOSC1

FOSC0

PCON

 

 

 

 

ULPWUE

SBOREN

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

POR

 

 

BOR

 

--01

--qq

--0u

--uu

STATUS

 

 

 

IRP

RP1

RP0

 

 

 

 

 

 

 

 

Z

 

DC

 

C

 

 

 

 

 

 

 

 

 

TO

 

 

PD

 

 

 

0001

1xxx

000q

quuu

Legend:

u = unchanged, x = unknown, – = unimplemented bit, reads as ‘0’, q = value depends on condition. Shaded cells are not used by BOR.

Note 1:

Other (non Power-up) Resets include MCLR Reset and Watchdog Timer Reset during normal operation.

 

 

 

 

2:See Configuration Word register (Register 12-1) for operation of all register bits.

DS41211D-page 88

2007 Microchip Technology Inc.

PIC12F683

FIGURE 12-4: TIME-OUT SEQUENCE ON POWER-UP (DELAYED MCLR)

VDD

 

MCLR

 

Internal POR

 

 

TPWRT

PWRT Time-out

TOST

OST Time-out

 

Internal Reset

 

FIGURE 12-5: TIME-OUT SEQUENCE ON POWER-UP (DELAYED MCLR)

VDD

 

MCLR

 

Internal POR

 

 

TPWRT

PWRT Time-out

TOST

OST Time-out

 

Internal Reset

 

FIGURE 12-6: TIME-OUT SEQUENCE ON POWER-UP (MCLR WITH VDD)

VDD

 

MCLR

 

Internal POR

 

 

TPWRT

PWRT Time-out

TOST

 

OST Time-out

 

Internal Reset

 

2007 Microchip Technology Inc.

DS41211D-page 89

PIC12F683

TABLE 12-4:

INITIALIZATION CONDITION FOR REGISTERS

 

 

 

 

 

 

 

 

 

Wake-up from Sleep

 

 

 

 

 

MCLR Reset

 

 

 

 

 

through Interrupt

Register

Address

Power-on Reset

 

WDT Reset

 

Wake-up from Sleep through

 

 

 

 

Brown-out Reset(1)

 

 

 

 

WDT Time-out

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

W

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

 

INDF

00h/80h

xxxx xxxx

 

xxxx xxxx

uuuu uuuu

 

 

 

 

 

 

TMR0

01h

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

 

 

PCL

02h/82h

0000

0000

0000

0000

PC + 1(3)

STATUS

03h/83h

0001

1xxx

 

000q

quuu(4)

uuuq quuu(4)

FSR

04h/84h

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

 

GPIO

05h

--x0 x000

 

--x0 x000

--uu uuuu

 

 

 

 

 

PCLATH

0Ah/8Ah

---0 0000

---0 0000

---u uuuu

 

 

 

 

 

 

INTCON

0Bh/8Bh

0000

0000

0000 0000

uuuu uuuu(2)

PIR1

0Ch

0000

0000

0000 0000

uuuu uuuu(2)

TMR1L

0Eh

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

 

TMR1H

0Fh

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

 

 

T1CON

10h

0000

0000

 

uuuu uuuu

-uuu uuuu

 

 

 

 

 

 

TMR2

11h

0000

0000

0000 0000

uuuu uuuu

 

 

 

 

 

T2CON

12h

-000 0000

-000 0000

-uuu uuuu

 

 

 

 

 

 

CCPR1L

13h

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

 

CCPR1H

14h

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

CCP1CON

15h

--00 0000

--00 0000

--uu uuuu

 

 

 

 

 

WDTCON

18h

---0 1000

---0 1000

---u uuuu

 

 

 

 

 

 

CMCON0

19h

0000

0000

0000 0000

uuuu uuuu

 

 

 

 

 

CMCON1

20h

---- --10

---- --10

---- --uu

 

 

 

 

 

 

ADRESH

1Eh

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

ADCON0

1Fh

00-- 0000

00-- 0000

uu-- uuuu

 

 

 

 

 

 

OPTION_REG

81h

1111

1111

1111 1111

uuuu uuuu

 

 

 

 

 

TRISIO

85h

--11 1111

--11 1111

--uu uuuu

 

 

 

 

 

 

PIE1

8Ch

0000

0000

0000 0000

uuuu uuuu

 

 

 

 

 

 

PCON

8Eh

--01 --0x

 

--0u --uu(1,5)

--uu --uu

OSCCON

8Fh

-110 q000

 

-110 q000

-uuu uuuu

 

 

 

 

 

 

OSCTUNE

90h

---0 0000

 

---u uuuu

---u uuuu

 

 

 

 

 

 

 

 

PR2

92h

1111

1111

1111

1111

1111

1111

 

 

 

 

 

WPU

95h

--11 -111

--11 -111

uuuu uuuu

 

 

 

 

 

IOC

96h

--00 0000

--00 0000

--uu uuuu

 

 

 

 

 

VRCON

99h

0-0- 0000

0-0- 0000

u-u- uuuu

 

 

 

 

 

 

EEDAT

9Ah

0000

0000

0000 0000

uuuu uuuu

 

 

 

 

 

 

EEADR

9Bh

0000

0000

0000 0000

uuuu uuuu

 

 

 

 

 

 

 

 

 

Legend: u = unchanged, x = unknown, – = unimplemented bit, reads as ‘0’, q = value depends on condition.

Note 1: If VDD goes too low, Power-on Reset will be activated and registers will be affected differently.

2:One or more bits in INTCON and/or PIR1 will be affected (to cause wake-up).

3:When the wake-up is due to an interrupt and the GIE bit is set, the PC is loaded with the interrupt vector (0004h).

4:See Table 12-5 for Reset value for specific condition.

5:If Reset was due to brown-out, then bit 0 = 0. All other Resets will cause bit 0 = u.

DS41211D-page 90

2007 Microchip Technology Inc.

PIC12F683

TABLE 12-4: INITIALIZATION CONDITION FOR REGISTERS (CONTINUED)

 

 

 

 

 

 

 

Wake-up from Sleep

 

 

 

 

 

MCLR Reset

 

 

 

 

 

through Interrupt

Register

Address

Power-on Reset

 

WDT Reset

 

Wake-up from Sleep through

 

 

 

 

Brown-out Reset(1)

 

 

 

 

WDT Time-out

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EECON1

 

9Ch

---- x000

 

---- q000

---- uuuu

 

 

 

 

 

 

EECON2

 

9Dh

---- ----

---- ----

---- ----

 

 

 

 

 

 

 

ADRESL

 

9Eh

xxxx xxxx

 

uuuu uuuu

uuuu uuuu

 

 

 

 

 

 

ANSEL

 

9Fh

-000 1111

-000 1111

-uuu uuuu

 

 

 

 

 

 

Legend:

u = unchanged, x = unknown, – = unimplemented bit, reads as ‘0’, q = value depends on condition.

Note 1:

If VDD goes too low, Power-on Reset will be activated and registers will be affected differently.

2:One or more bits in INTCON and/or PIR1 will be affected (to cause wake-up).

3:When the wake-up is due to an interrupt and the GIE bit is set, the PC is loaded with the interrupt vector (0004h).

4:See Table 12-5 for Reset value for specific condition.

5:If Reset was due to brown-out, then bit 0 = 0. All other Resets will cause bit 0 = u.

TABLE 12-5: INITIALIZATION CONDITION FOR SPECIAL REGISTERS

 

 

Condition

Program

Status

PCON

 

 

Counter

Register

Register

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Power-on Reset

000h

0001

1xxx

--01 --0x

 

 

 

 

 

 

 

 

Reset during Normal Operation

000h

 

 

 

 

MCLR

000u

uuuu

--0u --uu

 

 

Reset during Sleep

000h

 

 

 

 

MCLR

0001

0uuu

--0u --uu

 

WDT Reset

000h

0000

uuuu

--0u --uu

 

 

 

 

 

 

WDT Wake-up

PC + 1

uuu0 0uuu

--uu --uu

 

 

 

 

 

 

 

Brown-out Reset

000h

0001

1uuu

--01 --10

 

 

 

 

 

 

Interrupt Wake-up from Sleep

PC + 1(1)

uuu1 0uuu

--uu --uu

Legend: u = unchanged, x = unknown, – = unimplemented bit, reads as ‘0’.

Note 1: When the wake-up is due to an interrupt and Global Interrupt Enable bit, GIE, is set, the PC is loaded with the interrupt vector (0004h) after execution of PC + 1.

2007 Microchip Technology Inc.

DS41211D-page 91