Section 27. Device Configuration Bits



Similar documents
Section 19. Voltage Reference

Section 28. In-Circuit Serial Programming (ICSP )

Section 8. Interrupts

dspic33e/pic24e dspic33e/pic24e Flash Programming Specification 1.0 DEVICE OVERVIEW 2.0 PROGRAMMING OVERVIEW OF THE dspic33e/pic24e

Fondamenti su strumenti di sviluppo per microcontrollori PIC

Section 1. Introduction

Section bit A/D Converter

Getting Started with PIC24F/PIC24H Programming and Interfacing in C

FLASH Memory Programming Specification TABLE 1-1: PIN DESCRIPTIONS (DURING PROGRAMMING): PIC16F72

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features:

PIC10F200/202/204/206

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

dspic30f dspic30f Flash Programming Specification 1.0 OVERVIEW AND SCOPE 2.0 PROGRAMMING OVERVIEW OF THE dspic30f 2.1 Hardware Requirements

How To Program A Microcontroller With Memory On A Microchip Microcontroller

Section 14. Compare/Capture/PWM (CCP)

PIC16F84A Data Sheet. 18-pin Enhanced FLASH/EEPROM 8-bit Microcontroller Microchip Technology Inc. DS35007B

Section 7. Oscillator

PIC16F877A. FLASH Memory Programming Specification 1.0 PROGRAMMING THE PIC16F87XA

In-Circuit Serial Programming (ICSP ) Guide

Section bit A/D Converter

ET-BASE AVR ATmega64/128

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Chapter 13. PIC Family Microcontroller

PIC18F2450/4450 Data Sheet

PIC18F2423/2523/4423/4523 Data Sheet

PIC18F1230/1330 Data Sheet

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

Atmel s Self-Programming Flash Microcontrollers

PIC18F2480/2580/4480/4580 Data Sheet

MX PIC24F Educational Module User Manual

Introduction to PIC Programming

AN736. An I 2 C TM Network Protocol for Environmental Monitoring THE I 2 C BUS SPECIFICATION INTRODUCTION

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Dolphin In-Circuit programming Updating Firmware in the field

QL-PROG Microchip MCU Programmer User s Manual Qianlongsheng Electronic Technology Co., Ltd.

Opgui and OpenProg user s guide. v.1.2

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

PIC18F1220/1320 Data Sheet

An Introduction to MPLAB Integrated Development Environment

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

2.0 Command and Data Handling Subsystem

PIC in Practice. A Project-Based Approach. D. W. Smith

PIC12F508/509/16F505 Data Sheet

PRO MATE II USER S GUIDE

K8048 PIC PROGRAMMER BOARD

1. The demonstration code is sending garbage to my terminal program. What are the recommended settings?

Handout 17. by Dr Sheikh Sharif Iqbal. Memory Unit and Read Only Memories

Pololu P-Star 25K50 Micro User s

PICNet 1. PICNet 1 PIC18 Network & SD/MMC Development Board. Features. Applications. Description

PICmicro tm Development Board

PIC16F526 Data Sheet. 14-Pin, 8-Bit Flash Microcontroller Microchip Technology Inc. Preliminary DS41326A

Analog-to-Digital Converters

Use of the ZENA MiWi and P2P Packet Sniffer

PIC12F629/675 Data Sheet

Section 29. Instruction Set

PIC18F2455/2550/4455/4550 Data Sheet

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

1-10 The USB PIC K150 microcontroller programmer Hardware version V2.0 File version V2.0 Product Image

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

Microtronics technologies Mobile:

MPLAB ICD 3 In-Circuit Debugger User s Guide For MPLAB X IDE

RAM & ROM Based Digital Design. ECE 152A Winter 2012

AN1837. Non-Volatile Memory Technology Overview By Stephen Ledford Non-Volatile Memory Technology Center Austin, Texas.

PICkit 3 Programmer/Debugger User s Guide

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

TMU3114MS. USB Full Speed Controller. Data Sheet. Tenx reserves the right to change or discontinue this product without notice. tenx technology inc.

Embedded Software development Process and Tools: Lesson-3 Host and Target Machines

Production Flash Programming Best Practices for Kinetis K- and L-series MCUs

MPLAB C18 C Compiler

PIC16F87X Data Sheet. 28/40-Pin 8-Bit CMOS FLASH Microcontrollers Microchip Technology Inc. DS30292C

Freescale Semiconductor, I

Simple Alarm System WIRELESS AND REMOTE CONTROLLED PERSONAL APPLIANCE CODE WORD ORGANIZATION TRANSMISSION FORMAT

PIC18F23K20/24K20/25K20/26K20/ 43K20/44K20/45K20/46K20 Data Sheet

Microcontrollers Figure 26-1 Objectives Key Words and Terms 26.1 OVERVIEW OF THE MICROCONTROLLER microcontroller

UM0834 User manual. Developing and debugging your STM8S-DISCOVERY application code. Introduction. Reference documents

EasyPIC4 User s Manual

PIC10F200/202/204/206 Data Sheet

miniflash User Manual

RFID Based Centralized Patient Monitoring System and Tracking (RPMST)

Chapter 1 Lesson 3 Hardware Elements in the Embedded Systems Chapter-1L03: "Embedded Systems - ", Raj Kamal, Publs.: McGraw-Hill Education

Microcontrollers in Practice

AN10866 LPC1700 secondary USB bootloader

Voice Dialer Speech Recognition Dialing IC

How To Use Microchip.Com

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

STK User Guide

Memory. The memory types currently in common usage are:

PIC16CR7X Data Sheet. 28/40-Pin, 8-Bit CMOS ROM Microcontrollers Microchip Technology Inc. DS21993A

AN-812 APPLICATION NOTE

EXERCISE 3: String Variables and ASCII Code

I 2 C Master Mode Overview and Use of the PICmicro MSSP I 2 C Interface with a 24xx01x EEPROM

DS1821 Programmable Digital Thermostat and Thermometer

8-Bit CMOS Microcontrollers with A/D Converter

Z8 Encore! XP F082A Series Development Kit

PIC18F87J10 Family Data Sheet

ABRIDGED DATA SHEET EVALUATION KIT AVAILABLE

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

Am186ER/Am188ER AMD Continues 16-bit Innovation

Transcription:

M Section 27. Device Configuration Bits HIGHLIGHTS This section of the manual contains the following major topics: 27.1 Introduction...27-2 27.2 Configuration Word Bits...27-4 27.3 Program Verification/Code Protection...27-8 27.4 ID Locations...27-9 27.5 Design Tips...27-10 27.6 Related Application Notes...27-11 27.7 Revision History...27-12 27 Device Configuration Bits 1997 Microchip Technology Inc. DS31027A page 27-1

PICmicro MID-RANGE MCU FAMILY 27.1 Introduction The device configuration bits allow each user to customize certain aspects of the device to the needs of the application. When the device powers up, the state of these bits determines the modes that the device uses. Subsection 27.2 Configuration Word Bits discusses the configuration bits, and the modes that they can be configured to. These bits are mapped in program memory location 2007h. This location is not accessible during normal device operation (can be accessed only during programming mode). The configuration bits can be programmed (read as '0') or left unprogrammed (read as '1') to select various device configurations. The ability to change these settings once they have been programmed depends on the memory technology and the package type. For Read Only Memory (ROM) devices, these bits are specified at time of ROM code submittal and once the device is masked may not be changed for those devices (would require a new mask code). For One Time Programmable (OTP) devices, once these bits are programmed ( 0 ), they may not be changed. For windowed EPROM devices, once these bits are programmed ( 0 ), the device must be UV erased to return the configuration word to the erased state. UV erasing the device also erases the program memory. For Flash devices, these bits may be erased and reprogrammed. Microchip does not recommend code protecting windowed devices. DS31027A-page 27-2 1997 Microchip Technology Inc.

Section 27. Device Configuration Bits Section 27.2 is forced to the next page for formatting purposes. 27 Device Configuration Bits 1997 Microchip Technology Inc. DS31027A-page 27-3

PICmicro MID-RANGE MCU FAMILY 27.2 Configuration Word Bits These configuration bits specify some of the modes of the device, and are programmed by a device programmer, or by using the In-Circuit Serial Programming (ICSP) feature of the midrange devices. The device is not able to read the values of these bits, and there placement is automatically taken care of when you select the device in you device programmer. For additional information, please refer to the Programming Specification of the Device. Note 1: Always ensure that your device programmer has the same device selected as you are programming. Note 2: Microchip recommends that the desired configuration bit states be embedded in to the application source code. This is easily done in the MPASM assembler by the use of the CONFIG directive. See Subsection 27.2.1 MPASM s CONFIG Directive. CP1:CP0: Code Protection bits 11 = Code protection off 10 = See device data sheet 01 = See device data sheet 00 = All memory is code protected Some devices may use more or less bits to determine the code protect. Presently there are also some devices that use only one bit (CP0). For these devices the bit description is: 1 = Code protection off 0 = Code protection on DP: Data EEPROM Memory Code Protection bit 1 = Code protection off 0 = Data EEPROM Memory is code protected This bit is used when a device with ROM program memory also has Data EEPROM memory. BODEN: Brown-out Reset Enable bit 1 = BOR enabled 0 = BOR disabled Enabling Brown-out Reset automatically enables the Power-up Timer (PWRT) regardless of the value of bit PWRTE. Ensure the Power-up Timer is enabled anytime Brown-out Reset is enabled. PWRTE: Power-up Timer Enable bit 1 = PWRT disabled 0 = PWRT enabled Note 1: Enabling Brown-out Reset automatically enables Power-up Timer (PWRT) regardless of the value of bit PWRTE. Ensure the Power-up Timer is enabled anytime Brown-out Reset is enabled. Note 2: Some original PICmicros have the polarity of this bit reversed. Note 3: MCLRE: MCLR Pin Function Select bit 1 = Pin s function is MCLR 0 = Pin s function is as a digital I/O. MCLR is internally tied to VDD. WDTE: Watchdog Timer Enable bit 1 = WDT enabled 0 = WDT disabled DS31027A-page 27-4 1997 Microchip Technology Inc.

Section 27. Device Configuration Bits FOSC1:FOSC0: Oscillator Selection bits 11 = RC oscillator 10 = HS oscillator 01 = XT oscillator 00 = LP oscillator FOSC2:FOSC0: Oscillator Selection bits 111 = EXTRC oscillator, with CLKOUT 110 = EXTRC oscillator 101 = INTRC oscillator, with CLKOUT 100 = INTRC oscillator 011 = Reserved 010 = HS oscillator 001 = XT oscillator 000 = LP oscillator Unimplemented: Read as '1' Legend R = Readable bit P = Programmable bit U = Unimplemented bit, read as 0 - n = Value at POR reset u = Unchanged from programmed state The bit position of the configuration bits is device dependent. Please refer to the device programming specification for bit placement. The use of a Microchip device programmer does not require you to know the bit locations. 27 Device Configuration Bits 1997 Microchip Technology Inc. DS31027A-page 27-5

PICmicro MID-RANGE MCU FAMILY 27.2.1 MPASM s CONFIG Directive Microchip s assembler, MPASM, has a nice feature that allows you to specify, in the source code file, the selected states of the configuration bits for this program. This ensures that when programming a device for an application the required configuration is also programmed. This minimizes the risk of programming the wrong device configuration, and wondering why it no longer works in the application. Example 27-1 show a template for using the CONFIG directive. Example 27-1:Using the CONFIG Directive, a Source File Template LIST p = p16c77 ; List Directive, ; Revision History ; #INCLUDE <P16C77.INC> ; Microchip Device Header File ; #INCLUDE <MY_STD.MAC> ; File which includes my standard macros #INCLUDE <APP.MAC> ; File which includes macros specific ; to this application ; ; Specify Device Configuration Bits ; CONFIG _XT_OSC & _PWRTE_ON & _BODEN_OFF & _CP_OFF & _WDT_ON ; org 0x00 ; Start of Program Memory RESET_ADDR : ; First instruction to execute after a reset end The Symbols that are currently in the Microchip Device Header files that make using the CONFIG directive straight forward are shown in Table 27-1. For the symbols available for your device, please refer to that device s Microchip Include file. As long as the correct device is specified (in the LIST and INCLUDE file directives), the correct polarity of all bits is ensured. DS31027A-page 27-6 1997 Microchip Technology Inc.

Section 27. Device Configuration Bits Table 27-1: CONFIG Directive Symbols (From Microchip Header Files) Feature SYMBOLS _RC_OSC _EXTRC_OSC _EXTRC_OSC_CLKOUT _EXTRC_OSC_NOCLKOUT _INTRC_OSC Oscillators _INTRC_OSC_CLKOUT _INTRC_OSC_NOCLKOUT _LP_OSC _XT_OSC _HS_OSC _WDT_ON Watch Dog Timer _WDT_OFF _PWRTE_ON Power-up Timer _PWRTE_OFF _BODEN_ON Brown-out Reset _BODEN_OFF _MCLRE_ON Master Clear Enable _MCLRE_OFF _CP_ALL _CP_ON Code Protect _CP_75 _CP_50 _CP_OFF _DP_ON Code Protect Data EEPROM _DP_OFF _CPC_ON Code Protect Calibration Space _CPC_OFF Note 1: Not all configuration bit symbols may be available on any one device. Please refer to the MIcrochip include file of that device for available symbols. 27 Device Configuration Bits 1997 Microchip Technology Inc. DS31027A-page 27-7

PICmicro MID-RANGE MCU FAMILY 27.3 Program Verification/Code Protection 27.3.1 ROM Devices If the code protection bit(s) have not been programmed, the on-chip program memory can be read out for verification purposes. Microchip does not recommend code protecting windowed devices. When a ROM device also has Data EEPROM memory, an additional code protect configuration bit may be implemented. The program memory configuration bit is submitted as part of the ROM code submittal. The Data EEPROM memory code protect configuration bit will be an EEPROM bit. When ROM devices complete testing, the EEPROM data memory code protect bit will be programmed to the same state as the program memory code protect bit. That is data EEPROM code protect is off, when program memory code protect is off, and data EEPROM code protect is on for all other selections. In applications where the device is code protected and the data EEPROM needs to be programmed before the application can be released, the data EEPROM memory must have the entire data EEPROM memory erased. The device programming specification details the steps to do this. Microchip device programmers implement the specified sequence. Once this sequence is complete, the Data EEPROM memory code protect is disabled. This allows the desired data to be programmed into the device. After programming the data EEPROM memory array, the data EEPROM memory code protect configuration bit should be programmed as desired. DS31027A-page 27-8 1997 Microchip Technology Inc.

Section 27. Device Configuration Bits 27.4 ID Locations Four memory locations (2000h - 2003h) are designated as ID locations where the user can store checksum or other code-identification numbers. These locations are not accessible during normal execution but are readable and writable during program/verify. It is recommended that only the 4 least significant bits of the ID location are used. 27 Device Configuration Bits 1997 Microchip Technology Inc. DS31027A-page 27-9

PICmicro MID-RANGE MCU FAMILY 27.5 Design Tips Question 1: Answer 1: I have a JW device and I can no longer program it (reads scrambled data or all '0's). What s wrong with the device? Nothing. You probably code protected the device. If this is the case, the device is no longer usable. See Subsection 27.3 Program Verification/Code Protection for more details. Question 2: Answer 2: In converting from a PIC16C74 to a PIC16C74A, my application no longer works. 1. Did you re-assemble the source file specifying the PIC16C74A in the INCLUDE file and LIST directives. The use of the CONFIG directive is highly recommended. 2. On the device programmer, did you specify the PIC16C74A, and were all the configuration bits as desired? Question 3: When I erase the device, the program memory is blank but the configuration word is not yet erased. Answer 3: That is by design. Also remember that Microchip does not recommend code protecting windowed devices. DS31027A-page 27-10 1997 Microchip Technology Inc.

Section 27. Device Configuration Bits 27.6 Related Application Notes This section lists application notes that are related to this section of the manual. These application notes may not be written specifically for the Mid-Range MCU family (that is they may be written for the Base-Line, or High-End families), but the concepts are pertinent, and could be used (with modification and possible limitations). The current application notes related to Configuration Word are: Title Application Note # No related Application Notes at this time. 27 Device Configuration Bits 1997 Microchip Technology Inc. DS31027A-page 27-11

PICmicro MID-RANGE MCU FAMILY 27.7 Revision History Revision A This is the initial released revision of the Configuration Word description. DS31027A-page 27-12 1997 Microchip Technology Inc.