参数资料
型号: PIC16F877-20I/PQ
厂商: Microchip Technology
文件页数: 159/218页
文件大小: 0K
描述: IC MCU FLASH 8KX14 EE 44-MQFP
产品培训模块: Asynchronous Stimulus
标准包装: 96
系列: PIC® 16F
核心处理器: PIC
芯体尺寸: 8-位
速度: 20MHz
连通性: I²C,SPI,UART/USART
外围设备: 欠压检测/复位,POR,PWM,WDT
输入/输出数: 33
程序存储器容量: 14KB(8K x 14)
程序存储器类型: 闪存
EEPROM 大小: 256 x 8
RAM 容量: 368 x 8
电压 - 电源 (Vcc/Vdd): 4 V ~ 5.5 V
数据转换器: A/D 8x10b
振荡器型: 外部
工作温度: -40°C ~ 85°C
封装/外壳: 44-QFP
包装: 托盘
第1页第2页第3页第4页第5页第6页第7页第8页第9页第10页第11页第12页第13页第14页第15页第16页第17页第18页第19页第20页第21页第22页第23页第24页第25页第26页第27页第28页第29页第30页第31页第32页第33页第34页第35页第36页第37页第38页第39页第40页第41页第42页第43页第44页第45页第46页第47页第48页第49页第50页第51页第52页第53页第54页第55页第56页第57页第58页第59页第60页第61页第62页第63页第64页第65页第66页第67页第68页第69页第70页第71页第72页第73页第74页第75页第76页第77页第78页第79页第80页第81页第82页第83页第84页第85页第86页第87页第88页第89页第90页第91页第92页第93页第94页第95页第96页第97页第98页第99页第100页第101页第102页第103页第104页第105页第106页第107页第108页第109页第110页第111页第112页第113页第114页第115页第116页第117页第118页第119页第120页第121页第122页第123页第124页第125页第126页第127页第128页第129页第130页第131页第132页第133页第134页第135页第136页第137页第138页第139页第140页第141页第142页第143页第144页第145页第146页第147页第148页第149页第150页第151页第152页第153页第154页第155页第156页第157页第158页当前第159页第160页第161页第162页第163页第164页第165页第166页第167页第168页第169页第170页第171页第172页第173页第174页第175页第176页第177页第178页第179页第180页第181页第182页第183页第184页第185页第186页第187页第188页第189页第190页第191页第192页第193页第194页第195页第196页第197页第198页第199页第200页第201页第202页第203页第204页第205页第206页第207页第208页第209页第210页第211页第212页第213页第214页第215页第216页第217页第218页
2001 Microchip Technology Inc.
DS30292C-page 43
PIC16F87X
4.2
Reading the EEPROM Data
Memory
Reading EEPROM data memory only requires that the
desired address to access be written to the EEADR
register and clear the EEPGD bit. After the RD bit is set,
data will be available in the EEDATA register on the
very next instruction cycle. EEDATA will hold this value
until another read operation is initiated or until it is writ-
ten by firmware.
The steps to reading the EEPROM data memory are:
1.
Write the address to EEDATA. Make sure that
the address is not larger than the memory size
of the PIC16F87X device.
2.
Clear the EEPGD bit to point to EEPROM data
memory.
3.
Set the RD bit to start the read operation.
4.
Read the data from the EEDATA register.
EXAMPLE 4-1:
EEPROM DATA READ
4.3
Writing to the EEPROM Data
Memory
There are many steps in writing to the EEPROM data
memory. Both address and data values must be written
to the SFRs. The EEPGD bit must be cleared, 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 EEPROM data. 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 com-
pletes will not terminate the write in progress.
Writes to EEPROM data memory must also be pref-
aced with a special sequence of instructions, that pre-
vent inadvertent write operations. This is a sequence of
five instructions that must be executed without interrup-
tions. The firmware should verify that a write is not in
progress, before starting another cycle.
The steps to write to EEPROM data memory are:
1.
If step 10 is not implemented, check the WR bit
to see if a write is in progress.
2.
Write the address to EEADR. Make sure that the
address is not larger than the memory size of
the PIC16F87X device.
3.
Write the 8-bit data value to be programmed in
the EEDATA register.
4.
Clear the EEPGD bit to point to EEPROM data
memory.
5.
Set the WREN bit to enable program operations.
6.
Disable interrupts (if enabled).
7.
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
8.
Enable interrupts (if using interrupts).
9.
Clear the WREN bit to disable program opera-
tions.
10. At the completion of the write cycle, the WR bit
is cleared and the EEIF interrupt flag bit is set.
(EEIF must be cleared by firmware.) If step 1 is
not implemented, then firmware should check
for EEIF to be set, or WR to clear, to indicate the
end of the program cycle.
EXAMPLE 4-2:
EEPROM DATA WRITE
BSF
STATUS, RP1
;
BCF
STATUS, RP0
;Bank 2
MOVF
ADDR, W
;Write address
MOVWF
EEADR
;to read from
BSF
STATUS, RP0
;Bank 3
BCF
EECON1, EEPGD
;Point to Data memory
BSF
EECON1, RD
;Start read operation
BCF
STATUS, RP0
;Bank 2
MOVF
EEDATA, W
;W = EEDATA
BSF
STATUS, RP1
;
BSF
STATUS, RP0
;Bank 3
BTFSC
EECON1, WR
;Wait for
GOTO
$-1
;write to finish
BCF
STATUS, RP0
;Bank 2
MOVF
ADDR, W
;Address to
MOVWF
EEADR
;write to
MOVF
VALUE, W
;Data to
MOVWF
EEDATA
;write
BSF
STATUS, RP0
;Bank 3
BCF
EECON1, EEPGD ;Point to Data memory
BSF
EECON1, WREN
;Enable writes
;Only disable interrupts
BCF
INTCON, GIE
;if already enabled,
;otherwise discard
MOVLW
0x55
;Write 55h to
MOVWF
EECON2
;EECON2
MOVLW
0xAA
;Write AAh to
MOVWF
EECON2
;EECON2
BSF
EECON1, WR
;Start write operation
;Only enable interrupts
BSF
INTCON, GIE
;if using interrupts,
;otherwise discard
BCF
EECON1, WREN
;Disable writes
相关PDF资料
PDF描述
PIC16LC76-04/SP IC MCU OTP 8KX14 A/D PWM 28DIP
DG9461DV-T1-E3 IC SWITCH LV SPDT 6TSOP
VE-J42-IX-F1 CONVERTER MOD DC/DC 15V 75W
DG9232DY-T1-E3 IC SWITCH DUAL SPST 8SOIC
VE-J41-IX-F3 CONVERTER MOD DC/DC 12V 75W
相关代理商/技术参数
参数描述
PIC16F87720IPT 制造商:Microchip Technology Inc 功能描述:
PIC16F87720P 制造商:Microchip Technology Inc 功能描述:
PIC16F877A DEV KIT W/PCW 功能描述:开发板和工具包 - PIC / DSPIC PIC16F877A EMBD C DEV KIT W/PCW RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
PIC16F877A DEV KIT W/PCWH 功能描述:开发板和工具包 - PIC / DSPIC PIC16F877A EMBD C DEV KIT W/PCWH RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
PIC16F877A DEVELOPMENT BOARD KIT 功能描述:DEVELOPMENT BOARD FOR PIC16F877A RoHS:否 类别:编程器,开发系统 >> 通用嵌入式开发板和套件(MCU、DSP、FPGA、CPLD等) 系列:- 标准包装:1 系列:PICDEM™ 类型:MCU 适用于相关产品:PIC10F206,PIC16F690,PIC16F819 所含物品:板,线缆,元件,CD,PICkit 编程器 产品目录页面:659 (CN2011-ZH PDF)