📄 i2cmem1.lst
字号:
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
013E 20A5 00412 call wr_byte
013F 3003 00413 movlw 0x03
0140 08B4 00414 movf ack,F
0141 1903 00415 btfsc STATUS,Z
0142 20EC 00416 call wr_error
00417
00418 ; Do stop. This starts the write cycle.
0143 2037 00419 call wr_stop
00420
00421 ; Now poll for acknowledge:
0144 202E 00422 poll_for_ack call wr_start
0145 30A6 00423 movlw 0xA6
0146 20A5 00424 call wr_byte
0147 3004 00425 movlw 0x04
0148 08B4 00426 movf ack,F
0149 1903 00427 btfsc STATUS,Z
014A 2944 00428 goto poll_for_ack
00429
00430 ; Increment address/data and loop round:
Message[305]: Using default destination of 1 (file).
014B 0AB0 00431 incf address
Message[305]: Using default destination of 1 (file).
014C 0AB1 00432 incf value
014D 1E30 00433 btfss address,4
014E 2930 00434 goto main_wr_loop
00435
00436 ; Cancel sucessful poll command:
014F 2037 00437 call wr_stop
00438
0150 3010 00439 wait movlw 0x10
0151 2116 00440 call longwait
00441
0152 00442 reset_addr ; Generate start condition...
0152 202E 00443 call wr_start
00444
00445 ; Write command:
0153 30A6 00446 movlw 0xA6
0154 20A5 00447 call wr_byte
0155 3005 00448 movlw 0x05
0156 08B4 00449 movf ack,F
0157 1903 00450 btfsc STATUS,Z
0158 20EC 00451 call wr_error
00452
00453 ; Send address:
0159 01B0 00454 clrf address
015A 0830 00455 movf address,W
015B 20A5 00456 call wr_byte
015C 3006 00457 movlw 0x06
015D 08B4 00458 movf ack,F
015E 1903 00459 btfsc STATUS,Z
015F 20EC 00460 call wr_error
00461
00462 ; Send stop:
MPASM 02.30 Released I2CMEM1.ASM 12-19-2001 11:23:01 PAGE 10
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0160 2037 00463 call wr_stop
00464
0161 202E 00465 read_bytes call wr_start
0162 30A7 00466 movlw 0xA7
0163 20A5 00467 call wr_byte
0164 3007 00468 movlw 0x07
0165 08B4 00469 movf ack,F
0166 1903 00470 btfsc STATUS,Z
0167 20EC 00471 call wr_error
00472
0168 1485 00473 bsf PORTA,1
0169 0000 00474 nop
016A 0000 00475 nop
016B 0000 00476 nop
016C 1085 00477 bcf PORTA,1
00478
00479 ; Do read:
016D 20E0 00480 main_rd_loop call rd_byte
00481
00482 ; Is this the value we expected?
016E 0830 00483 movf address,W
016F 0232 00484 subwf byte,W
0170 3008 00485 movlw 0x08
0171 1D03 00486 btfss STATUS,Z
0172 20EC 00487 call wr_error
00488
00489 ; Increment address/data and loop round:
Message[305]: Using default destination of 1 (file).
0173 0AB0 00490 incf address
0174 1A30 00491 btfsc address,4
0175 2978 00492 goto done
00493
00494 ; Not done yet so acknowledge byte and read next one:
0176 204C 00495 call wr_ack
0177 296D 00496 goto main_rd_loop
00497
00498
00499 ; Stop condition marks end of sequential read:
0178 2057 00500 done call wr_no_ack
0179 2037 00501 call wr_stop
00502
00503 ; End of test:
017A 211E 00504 call hang
00505
00506 END
MPASM 02.30 Released I2CMEM1.ASM 12-19-2001 11:23:01 PAGE 11
SYMBOL TABLE
LABEL VALUE
ACKDT 00000005
ACKEN 00000004
ACKSTAT 00000006
ADCON0 0000001F
ADCON1 0000009F
ADCS0 00000006
ADCS1 00000007
ADDEN 00000003
ADFM 00000007
ADIE 00000006
ADIF 00000006
ADON 00000000
ADRESH 0000001E
ADRESL 0000009E
BCLIE 00000003
BCLIF 00000003
BF 00000000
BRGH 00000002
C 00000000
CCP1CON 00000017
CCP1IE 00000002
CCP1IF 00000002
CCP1M0 00000000
CCP1M1 00000001
CCP1M2 00000002
CCP1M3 00000003
CCP1X 00000005
CCP1Y 00000004
CCP2CON 0000001D
CCP2IE 00000000
CCP2IF 00000000
CCP2M0 00000000
CCP2M1 00000001
CCP2M2 00000002
CCP2M3 00000003
CCP2X 00000005
CCP2Y 00000004
CCPR1H 00000016
CCPR1L 00000015
CCPR2H 0000001C
CCPR2L 0000001B
CHS0 00000003
CHS1 00000004
CHS2 00000005
CKE 00000006
CKP 00000004
CLK 00000006
CREN 00000004
CSRC 00000007
D 00000005
DATA_ADDRESS 00000005
DC 00000001
D_A 00000005
MPASM 02.30 Released I2CMEM1.ASM 12-19-2001 11:23:01 PAGE 12
SYMBOL TABLE
LABEL VALUE
EEADR 0000010D
EEADRH 0000010F
EECON1 0000018C
EECON2 0000018D
EEDATA 0000010C
EEDATH 0000010E
EEIE 00000004
EEIF 00000004
EEPGD 00000007
F 00000001
FERR 00000002
FSR 00000004
GCEN 00000007
GIE 00000007
GO 00000002
GO_DONE 00000002
I2C_DATA 00000005
I2C_READ 00000002
I2C_START 00000003
I2C_STOP 00000004
IBF 00000007
IBOV 00000005
INDF 00000000
INTCON 0000000B
INTE 00000004
INTEDG 00000006
INTF 00000001
IRP 00000007
NOT_A 00000005
NOT_ADDRESS 00000005
NOT_BO 00000000
NOT_BOR 00000000
NOT_DONE 00000002
NOT_PD 00000003
NOT_POR 00000001
NOT_RBPU 00000007
NOT_RC8 00000006
NOT_T1SYNC 00000002
NOT_TO 00000004
NOT_TX8 00000006
NOT_W 00000002
NOT_WRITE 00000002
OBF 00000006
OERR 00000001
OPTION_REG 00000081
P 00000004
PCFG0 00000000
PCFG1 00000001
PCFG2 00000002
PCFG3 00000003
PCL 00000002
PCLATH 0000000A
PCON 0000008E
MPASM 02.30 Released I2CMEM1.ASM 12-19-2001 11:23:01 PAGE 13
SYMBOL TABLE
LABEL VALUE
PEIE 00000006
PEN 00000002
PIE1 0000008C
PIE2 0000008D
PIR1 0000000C
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -