PICDEM-1 User’s Guide
The next section of code performs the initialization of GPFLAG and PORTB.
Start
clrf
movlw
movwf
bsf
GPFLAG
B’00000000’
PORTB
STATUS, RP0
;clr all flags
;make port b outputs
clrf
bcf
TRISB
STATUS, RP0
;
/
After the initialization is completed the program goes into a loop where all
locations of the data EEPROM are written to and then read from for
verification. If all locations verify correctly, the value displayed on the LEDs is
incremented, if a mismatch between what was written and what is read is
found, the LEDs are blinked at a one Hertz rate.
Next
call
call
btfsc
goto
incf
goto
WriteAll
CheckAll
GPFLAG,EEPERROR
BlinkLeds
PORTB, F
Next
;write to all locations
;verify all locations
;no error then skip
;else blink leds.
;inc value in port b
WriteAll writes the value of what is displayed on the LEDs plus one to each
location of the EEPROM. Notice that the write enable bit, WREN , in the
EEPROM control register, EECON1 is set for the entire duration and does not
have to be re-enabled for each byte.
WriteAll
clrf
incf
movwf
bsf
bsf
bcf
WA1
call
incf
btfss
goto
bsf
bcf
bcf
return
DS33015C-page 28
EEADR
PORTB,W
EEDATA
STATUS,RP0
EECON1,WREN
STATUS,RP0
WriteOne
EEADR, F
EEADR,6
WA1
STATUS,RP0
EECON1,WREN
STATUS,RP0
;start at addr = 0
;read current value+1
;ld. data reg.
;select pg 1
;enable write operation
;select pg 0
;write to a location
;inc address
;all 64 done?
;no then do next
;pg 1
;disable write
;pg 0
? 1999 Microchip Technology Inc.
相关PDF资料
DM163004-LT BOARD DEMO PICDEM.NET
DM163005 KIT EVAL PIC16C432/433 LIN BUSS
DM163007 PICDEM CAN-LIN 1 FOR 18C658/858
DM163008 KIT MCP2120/2150 FOR IRDA COMM
DM163010 BOARD DEMO PICDEM USB
DM163012 BOARD DEMO PICDEM FOR 16C781/782
DM163024 BOARD DEMO PICDEM.NET 2
DM163025 PIC DEM FULL SPEED USB DEMO BRD
相关代理商/技术参数
DM163002 制造商:Microchip Technology Inc 功能描述:PIC16C64/74 DEMO BOARD
DM163003 功能描述:开发板和工具包 - PIC / DSPIC PICDEM 3 PIC16C923/4 RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163004 功能描述:开发板和工具包 - PIC / DSPIC USE 579-DM163004-LT RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163004 制造商:Microchip Technology Inc 功能描述:DEMO BOARD W/TCP/IP ((NW))
DM163004-LT 功能描述:开发板和工具包 - PIC / DSPIC PICDEM.net Demo Kit w/o TCP/IP Lean Book RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163005 功能描述:开发板和工具包 - PIC / DSPIC PICDEM PIC16C432/3 RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163006 功能描述:开发板和工具包 - PIC / DSPIC 18R PIC18C601/801 RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163007 功能描述:开发板和工具包 - PIC / DSPIC For PIC18C658/858 RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: