參數(shù)資料
型號: PIC16LF871-I/P
廠商: Microchip Technology
文件頁數(shù): 70/143頁
文件大?。?/td> 0K
描述: IC PIC MCU FLASH 2KX14 40DIP
產(chǎn)品培訓模塊: Asynchronous Stimulus
8-bit PIC® Microcontroller Portfolio
標準包裝: 10
系列: PIC® 16F
核心處理器: PIC
芯體尺寸: 8-位
速度: 20MHz
連通性: UART/USART
外圍設備: 欠壓檢測/復位,POR,PWM,WDT
輸入/輸出數(shù): 33
程序存儲器容量: 3.5KB(2K x 14)
程序存儲器類型: 閃存
EEPROM 大?。?/td> 64 x 8
RAM 容量: 128 x 8
電壓 - 電源 (Vcc/Vdd): 2 V ~ 5.5 V
數(shù)據(jù)轉(zhuǎn)換器: A/D 8x10b
振蕩器型: 外部
工作溫度: -40°C ~ 85°C
封裝/外殼: 40-DIP(0.600",15.24mm)
包裝: 管件
產(chǎn)品目錄頁面: 639 (CN2011-ZH PDF)
PIC16F870/871
DS30569B-page 30
2003 Microchip Technology Inc.
3.5
Reading the FLASH Program
Memory
Reading FLASH program memory is much like that of
EEPROM data memory, only two NOP instructions must
be inserted after the RD bit is set. These two instruction
cycles that the NOP instructions execute, will be used by
the microcontroller to read the data out of program
memory and insert the value into the EEDATH:EEDATA
registers. Data will be available following the second
NOP
instruction. EEDATH and EEDATA will hold their
value until another read operation is initiated, or until
they are written by firmware.
The steps to reading the FLASH program memory are:
1.
Write the address to EEADRH:EEADR. Make
sure that the address is not larger than the
memory size of the PIC16F870/871 devices.
2.
Set the EEPGD bit to point to FLASH program
memory.
3.
Set the RD bit to start the read operation.
4.
Execute two NOP instructions to allow the
microcontroller to read out of program memory.
5.
Read the data from the EEDATH:EEDATA
registers.
EXAMPLE 3-3:
FLASH PROGRAM READ
3.6
Writing to the FLASH Program
Memory
Writing to FLASH program memory is unique, in that
the microcontroller does not execute instructions while
programming is taking place. The oscillator continues
to run and all peripherals continue to operate and
queue interrupts, if enabled. Once the write operation
completes (specification D133), the processor begins
executing code from where it left off. The other impor-
tant difference when writing to FLASH program mem-
ory is that the WRT configuration bit, when clear,
prevents any writes to program memory (see Table 3-1).
Just like EEPROM data memory, there are many steps
in writing to the FLASH program memory. Both address
and data values must be written to the SFRs. The
EEPGD bit must be set, and the WREN bit must be set
to enable writes. The WREN bit should be kept clear at
all times, except when writing to the FLASH program
memory. The WR bit can only be set if the WREN bit
was set in a previous operation (i.e., they both cannot
be set in the same operation). The WREN bit should
then be cleared by firmware after the write. Clearing the
WREN bit before the write actually completes will not
terminate the write in progress.
Writes to program memory must also be prefaced with
a special sequence of instructions that prevent inad-
vertent write operations. This is a sequence of five
instructions that must be executed without interruption
for each byte written. These instructions must then be
followed by two NOP instructions to allow the microcon-
troller to setup for the write operation. Once the write is
complete, the execution of instructions starts with the
instruction after the second NOP.
The steps to write to program memory are:
1.
Write the address to EEADRH:EEADR. Make
sure that the address is not larger than the
memory size of the PIC16F870/871 devices.
2.
Write the 14-bit data value to be programmed in
the EEDATH:EEDATA registers.
3.
Set the EEPGD bit to point to FLASH program
memory.
4.
Set the WREN bit to enable program operations.
5.
Disable interrupts (if enabled).
6.
Execute the special five instruction sequence:
Write 55h to EECON2 in two steps (first to W,
then to EECON2)
Write AAh to EECON2 in two steps (first to W,
then to EECON2)
Set the WR bit
7.
Execute two NOP instructions to allow the
microcontroller to setup for write operation.
8.
Enable interrupts (if using interrupts).
9.
Clear the WREN bit to disable program
operations.
BSF
STATUS, RP1
;
BCF
STATUS, RP0
;Bank 2
MOVF
ADDRL, W
;Write the
MOVWF
EEADR
;address bytes
MOVF
ADDRH,W
;for the desired
MOVWF
EEADRH
;address to read
BSF
STATUS, RP0
;Bank 3
BSF
EECON1, EEPGD ;Point to Program memory
BSF
EECON1, RD
;Start read operation
NOP
;Required two NOPs
NOP
;
BCF
STATUS, RP0
;Bank 2
MOVF
EEDATA, W
;DATAL = EEDATA
MOVWF
DATAL
;
MOVF
EEDATH,W
;DATAH = EEDATH
MOVWF
DATAH
;
相關(guān)PDF資料
PDF描述
PIC24FJ64GB002-I/SO IC MCU 16BIT 64KB FLASH 28SOIC
PIC24FJ64GA104-I/PT IC PIC MCU FLASH 64KB 44-TQFP
PIC18F2420-I/SO IC MCU FLASH 8KX16 28SOIC
TS80C51RA2-MCA IC MCU 8BIT 256BYTE 40MHZ 40-DIP
DSPIC33FJ32GP302-I/MM IC DSPIC MCU/DSP 32K 28-QFN
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
PIC16LF871T-I/L 功能描述:8位微控制器 -MCU 3.5KB 128 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16LF871T-I/PT 功能描述:8位微控制器 -MCU 3.5KB 128 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16LF872-I/SO 功能描述:8位微控制器 -MCU 3.5KB 128 RAM 22 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16LF872-I/SO 制造商:Microchip Technology Inc 功能描述:IC 8BIT FLASH MCU 16LF872 SOIC28
PIC16LF872-I/SP 功能描述:8位微控制器 -MCU 3.5KB 128 RAM 22 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT