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

PIC18F2455/2550/4455/4550

25.1Configuration Bits

The Configuration bits can be programmed (read as ‘0’) or left unprogrammed (read as ‘1’) to select various device configurations. These bits are mapped starting at program memory location 300000h.

The user will note that address 300000h is beyond the user program memory space. In fact, it belongs to the configuration memory space (300000h-3FFFFFh), which can only be accessed using table reads and table writes.

Programming the Configuration registers is done in a manner similar to programming the Flash memory. The WR bit in the EECON1 register starts a self-timed write to the Configuration register. In normal operation mode, a TBLWT instruction, with the TBLPTR pointing to the Configuration register, sets up the address and the data for the Configuration register write. Setting the WR bit starts a long write to the Configuration register. The Configuration registers are written a byte at a time. To write or erase a configuration cell, a TBLWT instruction can write a ‘1’ or a ‘0’ into the cell. For additional details on Flash programming, refer to Section 6.5 “Writing to Flash Program Memory”.

TABLE 25-1: CONFIGURATION BITS AND DEVICE IDs

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Default/

File Name

 

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

 

Bit 0

 

Unprogrammed

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Value

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

300000h

CONFIG1L

 

USBDIV

CPUDIV1

CPUDIV0

PLLDIV2

PLLDIV1

 

PLLDIV0

 

--00 0000

300001h

CONFIG1H

 

IESO

FCMEN

FOSC3

FOSC2

FOSC1

 

FOSC0

 

00-- 0101

300002h

CONFIG2L

 

VREGEN

BORV1

BORV0

BOREN1

BOREN0

 

 

 

 

PWRTEN

 

--01 1111

300003h

CONFIG2H

 

WDTPS3

WDTPS2

WDTPS1

WDTPS0

 

WDTEN

 

---1 1111

300005h

CONFIG3H

 

MCLRE

LPT1OSC

PBADEN

 

CCP2MX

 

1--- -011

300006h

CONFIG4L

 

 

 

XINST

ICPRT(3)

LVP

 

STVREN

 

 

DEBUG

 

 

100- -1-1

300008h

CONFIG5L

 

CP3(1)

CP2

CP1

 

CP0

 

---- 1111

300009h

CONFIG5H

 

CPD

CPB

 

 

11-- ----

30000Ah

CONFIG6L

 

WRT3(1)

WRT2

WRT1

 

WRT0

 

---- 1111

30000Bh

CONFIG6H

 

WRTD

WRTB

WRTC

 

 

111- ----

30000Ch

CONFIG7L

 

EBTR3(1)

EBTR2

EBTR1

 

EBTR0

 

---- 1111

30000Dh

CONFIG7H

 

EBTRB

 

 

-1-- ----

3FFFFEh

DEVID1

 

DEV2

DEV1

DEV0

REV4

REV3

REV2

REV1

 

REV0

 

xxxx xxxx(2)

3FFFFFh

DEVID2

 

DEV10

DEV9

DEV8

DEV7

DEV6

DEV5

DEV4

 

DEV3

 

0001 0010(2)

Legend:

x = unknown, u = unchanged, - = unimplemented. Shaded cells are unimplemented, read as ‘0’.

 

 

Note 1:

Unimplemented in PIC18FX455 devices; maintain this bit set.

 

 

 

 

 

 

2:See Register 25-13 and Register 25-14 for DEVID values. DEVID registers are read-only and cannot be programmed by the user.

3:Available only on PIC18F4455/4550 devices in 44-pin TQFP packages. Always leave this bit clear in all other devices.

DS39632D-page 286

Preliminary

2007 Microchip Technology Inc.

PIC18F2455/2550/4455/4550

REGISTER 25-1: CONFIG1L: CONFIGURATION REGISTER 1 LOW (BYTE ADDRESS 300000h)

U-0

U-0

R/P-0

R/P-0

R/P-0

R/P-0

R/P-0

R/P-0

 

 

 

 

 

 

 

 

 

 

USBDIV

 

CPUDIV1

CPUDIV0

PLLDIV2

PLLDIV1

 

PLLDIV0

bit 7

 

 

 

 

 

 

 

 

bit 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Legend:

 

 

 

 

 

 

 

 

 

R = Readable bit

P = Programmable bit

U = Unimplemented bit, read as ‘0’

 

-n = Value when device is unprogrammed

 

u = Unchanged from programmed state

 

 

 

 

 

 

 

 

 

 

 

bit 7-6

Unimplemented: Read as ‘0

 

 

 

 

 

 

bit 5

USBDIV: USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1)

 

 

1 = USB clock source comes from the 96 MHz PLL divided by 2

 

 

 

 

0 = USB clock source comes directly from the primary oscillator block with no postscale

 

bit 4-3

CPUDIV1:CPUDIV0: System Clock Postscaler Selection bits

 

 

 

For XT, HS, EC and ECIO Oscillator modes:

11 = Primary oscillator divided by 4 to derive system clock 10 = Primary oscillator divided by 3 to derive system clock 01 = Primary oscillator divided by 2 to derive system clock

00 = Primary oscillator used directly for system clock (no postscaler)

For XTPLL, HSPLL, ECPLL and ECPIO Oscillator modes: 11 = 96 MHz PLL divided by 6 to derive system clock

10 = 96 MHz PLL divided by 4 to derive system clock 01 = 96 MHz PLL divided by 3 to derive system clock 00 = 96 MHz PLL divided by 2 to derive system clock

bit 2-0

PLLDIV2:PLLDIV0: PLL Prescaler Selection bits

 

111

= Divide by 12 (48 MHz oscillator input)

 

110

= Divide by 10 (40 MHz oscillator input)

 

101

= Divide by 6 (24 MHz oscillator input)

 

100

= Divide by 5

(20 MHz oscillator input)

 

011

= Divide by 4

(16 MHz oscillator input)

 

010

= Divide by 3

(12 MHz oscillator input)

 

001

= Divide by 2

(8 MHz oscillator input)

 

000

= No prescale (4 MHz oscillator input drives PLL directly)

2007 Microchip Technology Inc.

Preliminary

DS39632D-page 287

PIC18F2455/2550/4455/4550

REGISTER 25-2: CONFIG1H: CONFIGURATION REGISTER 1 HIGH (BYTE ADDRESS 300001h)

R/P-0

R/P-0

U-0

U-0

R/P-0

R/P-1

R/P-0

R/P-1

 

 

 

 

 

 

 

 

 

 

 

IESO

FCMEN

 

 

FOSC3(1)

FOSC2(1)

 

FOSC1(1)

FOSC0(1)

bit 7

 

 

 

 

 

 

 

 

 

 

bit 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Legend:

 

 

 

 

 

 

 

 

 

 

 

R = Readable bit

 

P = Programmable bit

U = Unimplemented bit, read as ‘0’

 

-n = Value when device is unprogrammed

 

 

u = Unchanged from programmed state

 

 

 

 

 

 

 

bit 7

IESO: Internal/External Oscillator Switchover bit

 

 

 

 

 

1 = Oscillator Switchover mode enabled

 

 

 

 

 

 

0 = Oscillator Switchover mode disabled

 

 

 

 

 

bit 6

FCMEN: Fail-Safe Clock Monitor Enable bit

 

 

 

 

 

1 = Fail-Safe Clock Monitor enabled

 

 

 

 

 

 

0 = Fail-Safe Clock Monitor disabled

 

 

 

 

 

bit 5-4

Unimplemented: Read as ‘0

 

 

 

 

 

 

 

bit 3-0

FOSC3:FOSC0: Oscillator Selection bits(1)

 

 

 

 

 

 

111x

= HS oscillator, PLL enabled (HSPLL)

 

 

 

 

 

110x

= HS oscillator (HS)

 

 

 

 

 

 

 

 

1011

= Internal oscillator, HS oscillator used by USB (INTHS)

 

 

 

1010

= Internal oscillator, XT used by USB (INTXT)

 

 

 

 

 

1001

= Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)

 

 

1000

= Internal oscillator, port function on RA6, EC used by USB (INTIO)

 

 

 

0111

= EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)

 

 

 

0110

= EC oscillator, PLL enabled, port function on RA6 (ECPIO)

 

 

 

0101

= EC oscillator, CLKO function on RA6 (EC)

 

 

 

 

 

0100

= EC oscillator, port function on RA6 (ECIO)

 

 

 

 

 

001x

= XT oscillator, PLL enabled (XTPLL)

 

 

 

 

 

000x

= XT oscillator (XT)

 

 

 

 

 

 

 

Note 1: The microcontroller and USB module both use the selected oscillator as their clock source in XT, HS and EC modes. The USB module uses the indicated XT, HS or EC oscillator as its clock source whenever the microcontroller uses the internal oscillator.

DS39632D-page 288

Preliminary

2007 Microchip Technology Inc.

PIC18F2455/2550/4455/4550

REGISTER 25-3: CONFIG2L: CONFIGURATION REGISTER 2 LOW (BYTE ADDRESS 300002h)

U-0

 

U-0

R/P-0

R/P-1

R/P-1

R/P-1

R/P-1

R/P-1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VREGEN

 

BORV1(1)

BORV0(1)

 

BOREN1(2)

BOREN0(2)

 

PWRTEN

(2)

bit 7

 

 

 

 

 

 

 

 

 

 

 

bit 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Legend:

 

 

 

 

 

 

 

 

 

 

 

 

 

R = Readable bit

 

 

P = Programmable bit

U = Unimplemented bit, read as ‘0’

 

 

-n = Value when device is unprogrammed

 

u = Unchanged from programmed state

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

bit 7-6

Unimplemented: Read as ‘0

 

 

 

 

 

 

 

 

bit 5

VREGEN: USB Internal Voltage Regulator Enable bit

 

 

 

 

 

 

 

1 = USB voltage regulator enabled

 

 

 

 

 

 

 

 

 

0 = USB voltage regulator disabled

 

 

 

 

 

 

 

bit 4-3

BORV1:BORV0: Brown-out Reset Voltage bits(1)

 

 

 

 

 

 

 

11

= Minimum setting

 

 

 

 

 

 

 

 

 

 

.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00

= Maximum setting

 

 

 

 

 

 

 

 

bit 2-1

BOREN1:BOREN0: Brown-out Reset Enable bits(2)

 

 

 

 

 

 

 

11

= Brown-out Reset enabled in hardware only (SBOREN is disabled)

 

 

 

 

 

 

10

= Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled)

 

 

01

= Brown-out Reset enabled and controlled by software (SBOREN is enabled)

 

 

 

 

00

= Brown-out Reset disabled in hardware and software

 

 

 

 

 

 

 

 

Power-up Timer Enable bit(2)

 

 

 

 

 

 

 

bit 0

PWRTEN:

 

 

 

 

 

 

 

 

 

1 = PWRT disabled

 

 

 

 

 

 

 

 

 

 

0 = PWRT enabled

 

 

 

 

 

 

 

 

Note 1: See Section 28.0 “Electrical Characteristics” for the specifications.

2:The Power-up Timer is decoupled from Brown-out Reset, allowing these features to be independently controlled.

2007 Microchip Technology Inc.

Preliminary

DS39632D-page 289

PIC18F2455/2550/4455/4550

REGISTER 25-4: CONFIG2H: CONFIGURATION REGISTER 2 HIGH (BYTE ADDRESS 300003h)

U-0

U-0

U-0

R/P-1

R/P-1

R/P-1

R/P-1

R/P-1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

WDTPS3

WDTPS2

 

WDTPS1

WDTPS0

WDTEN

bit 7

 

 

 

 

 

 

 

 

 

 

bit 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Legend:

 

 

 

 

 

 

 

 

 

 

 

R = Readable bit

 

P = Programmable bit

U = Unimplemented bit, read as ‘0’

 

-n = Value when device is unprogrammed

 

u = Unchanged from programmed state

 

 

 

 

 

 

 

 

 

 

 

bit 7-5

Unimplemented: Read as ‘0

 

 

 

 

 

 

bit 4-1

WDTPS3:WDTPS0: Watchdog Timer Postscale Select bits

 

 

 

 

1111

= 1:32,768

 

 

 

 

 

 

 

 

 

1110

= 1:16,384

 

 

 

 

 

 

 

 

 

1101

= 1:8,192

 

 

 

 

 

 

 

 

 

1100

= 1:4,096

 

 

 

 

 

 

 

 

 

1011

= 1:2,048

 

 

 

 

 

 

 

 

 

1010

= 1:1,024

 

 

 

 

 

 

 

 

 

1001

= 1:512

 

 

 

 

 

 

 

 

 

 

1000

= 1:256

 

 

 

 

 

 

 

 

 

 

0111

= 1:128

 

 

 

 

 

 

 

 

 

 

0110

= 1:64

 

 

 

 

 

 

 

 

 

 

0101

= 1:32

 

 

 

 

 

 

 

 

 

 

0100

= 1:16

 

 

 

 

 

 

 

 

 

 

0011

= 1:8

 

 

 

 

 

 

 

 

 

 

0010

= 1:4

 

 

 

 

 

 

 

 

 

 

0001

= 1:2

 

 

 

 

 

 

 

 

 

 

0000

= 1:1

 

 

 

 

 

 

 

 

 

bit 0

WDTEN: Watchdog Timer Enable bit

 

 

 

 

 

 

1 = WDT enabled

 

 

 

 

 

 

 

 

 

0 = WDT disabled (control is placed on the SWDTEN bit)

 

 

 

DS39632D-page 290

Preliminary

2007 Microchip Technology Inc.

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