PIC16F87X Datasheet

  • PIC16F87X

  • 28/40-pin 8-Bit CMOS FLASH Microcontrollers

  • 1377.31KB

  • Microchip

扫码查看芯片数据手册

上传产品规格书

PDF预览

PIC16F87X
4.6
Writing to the FLASH Program
Memory
trol bit (EECON1<7>), and then set control bit WR
(EECON1<1>). The sequence in Example 4-4 must be
followed to initiate a write to program memory.
The microcontroller will then halt internal operations
during the next two instruction cycles for the T
PEW
(parameter D133) in which the write takes place. This
is not SLEEP mode, as the clocks and peripherals will
continue to run. Therefore, the two instructions follow-
ing the 鈥淏SF
EECON, WR鈥?/div>
should be
NOP
instructions.
After the write cycle, the microcontroller will resume
operation with the 3rd instruction after the EECON1
write instruction.
A word of the FLASH program memory may only be
written to if the word is in a non-code protected seg-
ment of memory and the WRT configuration bit is set.
To write a FLASH program location, the first two bytes
of the address must be written to the EEADR and
EEADRH registers and two bytes of the data to the
EEDATA and EEDATH registers, set the EEPGD con-
EXAMPLE 4-4:
FLASH PROGRAM WRITE
BSF
BCF
MOVLW
MOVWF
MOVLW
MOVWF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
BSF
BSF
STATUS, RP1
STATUS, RP0
ADDRH
EEADRH
ADDRL
EEADR
DATAH
EEDATH
DATAL
EEDATA
STATUS, RP0
EECON1, EEPGD
EECON1, WREN
;
; Bank 2
;
; MSByte of Program Address to read
;
; LSByte of Program Address to read
;
; MS Program Memory Value to write
;
; LS Program Memory Value to write
; Bank 3
; Point to PROGRAM memory
; Enable writes
BCF
MOVLW
Required
Sequence
MOVWF
MOVLW
MOVWF
BSF
INTCON, GIE
55h
EECON2
AAh
EECON2
EECON1, WR
; Disable Interrupts
;
; Write 55h
;
; Write AAh
; Set WR bit to begin write
NOP
NOP
; Instructions here are ignored by the microcontroller
; Microcontroller will halt operation and wait for
; a write complete. After the write
; the microcontroller continues with 3rd instruction
BSF
BCF
INTCON,
GIE
; Enable Interrupts
; Disable writes
EECON1, WREN
4.7
Write Verify
Depending on the application, good programming prac-
tice may dictate that the value written to the memory
should be verified against the original value. This
should be used in applications where excessive writes
can stress bits near the specification limit.
Generally a write failure will be a bit which was written
as a '1', but reads back as a '0' (due to leakage off the
bit).
1999 Microchip Technology Inc.
DS30292B-page 45

PIC16F87X相关型号PDF文件下载

  • 型号
    版本
    描述
    厂商
    下载
  • 英文版
    8-Pin FLASH-Based 8-Bit CMOS Microcontrollers
    MICROCHIP
  • 英文版
    8-Pin, 8-Bit CMOS Microcontroller with EEPROM Data Memory
    MICROCHIP ...
  • 英文版
    8-Pin, 8-Bit CMOS Microcontroller with A/D Converter and EEP...
    MICROCHIP ...
  • 英文版
    8-Pin, 8-Bit CMOS Microcontrollers
    MICROCHIP ...
  • 英文版
    EPROM Memory Programming Specification
    MICROCHIP ...
  • 英文版
    8-Pin FLASH-Based 8-Bit CMOS Microcontrollers
    MICROCHIP ...
  • 英文版
    Microcontroller
    MICROCHIP
  • 英文版
    Microcontroller 
    Microchip
  • 英文版
    Microcontroller
    ETC
  • 英文版
    EPROM-Based 8-Bit CMOS Microcontroller
    MICROCHIP
  • 英文版
    8-Pin, 8-Bit CMOS Microcontrollers
    MICROCHIP
  • 英文版
    8-Pin, 8-Bit CMOS Microcontrollers
    MICROCHIP ...
  • 英文版
    ETC
  • 英文版
    EPROM Memory Programming Specification
    MICROCHIP
  • 英文版
    EPROM Memory Programming Specification
    MICROCHIP ...
  • 英文版
    28-Pin Programmable Mixed Signal Controller
    Microchip
  • 英文版
    EPROM Memory Programming Specification
    Microchip
  • 英文版
    Microcontroller
    ETC
  • 英文版
    Microcontroller
    ETC
  • 英文版
    EPROM/ROM-Based 8-Bit CMOS Microcontroller Series
    MICROCHIP

扫码下载APP,
一键连接广大的电子世界。

在线人工客服

买家服务:
卖家服务:

0571-85317607

客服在线时间周一至周五
9:00-17:30

关注官方微信号,
第一时间获取资讯。

建议反馈

联系人:

联系方式:

按住滑块,拖拽到最右边
>>
感谢您向阿库提出的宝贵意见,您的参与是维库提升服务的动力!意见一经采纳,将有感恩红包奉上哦!